Add a summary of grades (#127)
This commit is contained in:

committed by
Mikołaj Pich

parent
dde5775a41
commit
0e16519baf
10
app/src/main/res/drawable/ic_action_menu_semester.xml
Normal file
10
app/src/main/res/drawable/ic_action_menu_semester.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z" />
|
||||
</vector>
|
13
app/src/main/res/drawable/ic_action_menu_summary.xml
Normal file
13
app/src/main/res/drawable/ic_action_menu_summary.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#FFF"
|
||||
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFF"
|
||||
android:pathData="M12,2a10,10 0,1 0,0 20,10 10,0 0,0 0,-20zM12,20a8,8 0,1 1,0 -16,8 8,0 0,1
|
||||
0,16z" />
|
||||
</vector>
|
@ -1,4 +1,4 @@
|
||||
<!-- drawable/exclamation.xml -->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
|
@ -1,5 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/>
|
||||
</vector>
|
@ -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>
|
@ -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"
|
34
app/src/main/res/layout/grades_summary_header.xml
Normal file
34
app/src/main/res/layout/grades_summary_header.xml
Normal 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>
|
75
app/src/main/res/layout/grades_summary_subitem.xml
Normal file
75
app/src/main/res/layout/grades_summary_subitem.xml
Normal 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>
|
20
app/src/main/res/menu/grades_action_menu.xml
Normal file
20
app/src/main/res/menu/grades_action_menu.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="io.github.wulkanowy.timetable.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_semester_switch"
|
||||
android:icon="@drawable/ic_action_menu_semester"
|
||||
android:orderInCategory="2"
|
||||
android:title="@string/switch_semester"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_summary_switch"
|
||||
android:icon="@drawable/ic_action_menu_summary"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/action_title_summary"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
@ -1,13 +0,0 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="io.github.wulkanowy.timetable.MainActivity"
|
||||
>
|
||||
<item
|
||||
android:id="@+id/action_filter"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/switch_semester"
|
||||
android:icon="@drawable/ic_filter_list_black_24dp"
|
||||
app:showAsAction="always"
|
||||
/>
|
||||
</menu>
|
@ -81,6 +81,9 @@
|
||||
<string name="info_free_week">Brak lekcji w tym tygodniu</string>
|
||||
<string name="timetable_subitem_room">Sala %s</string>
|
||||
|
||||
<string name="grades_predicted_rating">Przewidywana</string>
|
||||
<string name="grades_final_rating">Końcowa</string>
|
||||
|
||||
<plurals name="numberOfGradesPlurals">
|
||||
<item quantity="one">%d ocena</item>
|
||||
<item quantity="few">%d oceny</item>
|
||||
@ -154,4 +157,10 @@
|
||||
<string name="exams_no_entries">Brak sprawdzianów w tym tygodniu</string>
|
||||
<string name="exams_type">Typ</string>
|
||||
<string name="exams_dialog_entry_date">Data wpisu</string>
|
||||
|
||||
<string name="grades_summary_calculated_average">Obliczona średnia</string>
|
||||
<string name="grades_summary_predicted_average">Szacowana średnia</string>
|
||||
<string name="grades_summary_final_average">Końcowa średnia</string>
|
||||
<string name="action_title_summary">Podsumowanie</string>
|
||||
<string name="action_title_details">Szczegóły</string>
|
||||
</resources>
|
||||
|
@ -80,6 +80,9 @@
|
||||
<string name="info_grades_final_rating">Final: %1$s</string>
|
||||
<string name="info_free_week">No lesson in this week</string>
|
||||
|
||||
<string name="grades_predicted_rating">Predicted</string>
|
||||
<string name="grades_final_rating">Final</string>
|
||||
|
||||
<string name="timetable_subitem_room">Room %s</string>
|
||||
|
||||
<plurals name="numberOfGradesPlurals">
|
||||
@ -149,4 +152,10 @@
|
||||
<string name="exams_no_entries">No exams in this week</string>
|
||||
<string name="exams_type">Type</string>
|
||||
<string name="exams_dialog_entry_date">Date of entry</string>
|
||||
|
||||
<string name="grades_summary_calculated_average">Calculated average</string>
|
||||
<string name="grades_summary_predicted_average">Predicted average</string>
|
||||
<string name="grades_summary_final_average">Final average</string>
|
||||
<string name="action_title_summary">Summary</string>
|
||||
<string name="action_title_details">Details</string>
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user