1
0

Add a summary of grades (#127)

This commit is contained in:
Rafał Borcz
2018-06-04 21:47:46 +02:00
committed by Mikołaj Pich
parent dde5775a41
commit 0e16519baf
40 changed files with 791 additions and 178 deletions

View File

@ -6,45 +6,166 @@
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.ui.main.grades.GradesFragment">
<RelativeLayout
android:id="@+id/grade_fragment_no_item_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/grade_fragment_no_item_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/grade_fragment_no_item_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:minHeight="100dp"
android:minWidth="100dp"
android:tint="@android:color/black"
app:srcCompat="@drawable/ic_menu_grade_26dp"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/grade_fragment_no_item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/fragment_no_grades"
android:gravity="center"
android:textSize="20sp" />
</RelativeLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/grade_fragment_swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/grade_fragment_recycler"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/grade_fragment_details_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/grade_fragment_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/grade_fragment_summary_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<RelativeLayout
android:id="@+id/grade_fragment_summary_calculated_container"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_toLeftOf="@id/grade_fragment_summary_final_container"
android:layout_toStartOf="@id/grade_fragment_summary_final_container">
<TextView
android:id="@+id/grade_fragment_summary_calculated_average_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="@string/grades_summary_calculated_average"
android:textSize="16sp" />
<TextView
android:id="@+id/grade_fragment_summary_calculated_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/grade_fragment_summary_calculated_average_text"
android:layout_centerHorizontal="true"
android:text="6,00"
android:textSize="21sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/grade_fragment_summary_final_container"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginEnd="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/grade_fragment_summary_final_average_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:minLines="2"
android:text="@string/grades_summary_final_average"
android:textSize="16sp" />
<TextView
android:id="@+id/grade_fragment_summary_final_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/grade_fragment_summary_final_average_text"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:text="6,00"
android:textSize="21sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/grade_fragment_summary_predicted_container"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:layout_toEndOf="@id/grade_fragment_summary_final_container"
android:layout_toRightOf="@id/grade_fragment_summary_final_container">
<TextView
android:id="@+id/grade_fragment_summary_predicted_average_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:maxLines="2"
android:text="@string/grades_summary_predicted_average"
android:textSize="16sp" />
<TextView
android:id="@+id/grade_fragment_summary_predicted_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/grade_fragment_summary_predicted_average_text"
android:layout_centerHorizontal="true"
android:text="6,00"
android:textSize="21sp" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/grade_fragment_summary_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/grade_fragment_summary_calculated_container"
android:layout_marginTop="20dp" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<RelativeLayout
android:id="@+id/grade_fragment_no_item_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/grade_fragment_no_item_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/grade_fragment_no_item_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:minHeight="100dp"
android:minWidth="100dp"
android:tint="@android:color/black"
app:srcCompat="@drawable/ic_menu_grade_26dp"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/grade_fragment_no_item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:gravity="center"
android:text="@string/fragment_no_grades"
android:textSize="20sp" />
</RelativeLayout>
</FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -51,6 +51,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/grade_header_average_text"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:text="@string/info_grades_predicted_rating"
android:textColor="@color/secondary_text"
@ -61,8 +63,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/grade_header_average_text"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_toEndOf="@+id/grade_header_predicted_rating_text"
android:layout_toRightOf="@+id/grade_header_predicted_rating_text"

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEE"
android:paddingBottom="7dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="7dp">
<TextView
android:id="@+id/grades_summary_header_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="40dp"
android:layout_marginRight="40dp"
android:layout_toLeftOf="@id/grades_summary_header_average"
android:layout_toStartOf="@id/grades_summary_header_average"
android:text="@string/app_name"
android:textSize="17sp" />
<TextView
android:id="@+id/grades_summary_header_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
</RelativeLayout>

View File

@ -0,0 +1,75 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/grades_summary_subitem_predicted_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_border"
android:minHeight="35dp">
<TextView
android:id="@+id/grades_summary_subitem_predicted_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:text="@string/grades_predicted_rating"
android:textSize="14sp" />
<TextView
android:id="@+id/grades_summary_subitem_predicted_grade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="25dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="25dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="@id/grades_summary_subitem_predicted_name"
android:layout_toRightOf="@id/grades_summary_subitem_predicted_name"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/grades_summary_subitem_final_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/grades_summary_subitem_predicted_container"
android:background="@drawable/ic_border"
android:minHeight="35dp">
<TextView
android:id="@+id/grades_summary_subitem_final_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:text="@string/grades_final_rating"
android:textSize="14sp" />
<TextView
android:id="@+id/grades_summary_subitem_final_grade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="25dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="25dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="@id/grades_summary_subitem_final_name"
android:layout_toRightOf="@id/grades_summary_subitem_final_name"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
</RelativeLayout>
</RelativeLayout>