1
0

Add a view of free days to the timetable (#57)

* Fix Timetable freeze when app was killed
* Add views for free days
This commit is contained in:
Rafał Borcz
2018-03-06 00:57:06 +01:00
committed by Mikołaj Pich
parent e274949257
commit c3803b1c96
17 changed files with 233 additions and 78 deletions

View File

@ -19,18 +19,18 @@
android:layout_below="@+id/grade_fragment_no_item_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:contentDescription="@string/activity_dashboard_text"
android:minHeight="100dp"
android:minWidth="100dp"
android:tint="@android:color/black"
app:srcCompat="@drawable/ic_menu_grade_26dp" />
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:id="@+id/grade_fragment_no_item_text"
android:textAlignment="center"
android:textSize="20sp" />
</RelativeLayout>

View File

@ -1,5 +1,6 @@
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/timetable_tab_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -18,6 +19,45 @@
android:indeterminate="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/timetable_tab_fragment_no_item_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/timetable_tab_fragment_no_item_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/timetable_tab_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_timetable_24dp"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/timetable_tab_fragment_no_item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/info_free_week"
android:textAlignment="center"
android:textSize="20sp" />
<TextView
android:id="@+id/timetable_tab_fragment_no_item_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textSize="20sp"
android:layout_below="@id/timetable_tab_fragment_no_item_image"
android:textAlignment="center"
android:layout_marginTop="15dp" />
</RelativeLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/timetable_tab_fragment_swipe_refresh"
android:layout_width="match_parent"

View File

@ -29,7 +29,7 @@
android:layout_below="@+id/grade_header_subject_text"
android:layout_marginTop="5dp"
android:text="@string/app_name"
android:textColor="#4C4C4C"
android:textColor="@color/secondary_text"
android:textSize="12sp" />
<TextView
@ -43,7 +43,7 @@
android:layout_toEndOf="@+id/grade_header_average_text"
android:layout_toRightOf="@+id/grade_header_average_text"
android:text="@string/app_name"
android:textColor="#4C4C4C"
android:textColor="@color/secondary_text"
android:textSize="12sp" />
<ImageView

View File

@ -1,51 +1,71 @@
<RelativeLayout 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"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_border"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
android:foreground="?attr/selectableItemBackgroundBorderless">
<TextView
android:id="@+id/timetable_header_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@id/timetable_header_alert_image"
android:layout_toStartOf="@+id/timetable_header_alert_image"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:textSize="19sp" />
<RelativeLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<TextView
android:id="@+id/timetable_header_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/timetable_header_day"
android:layout_marginTop="5dp"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="#4C4C4C"
android:textSize="14sp" />
<TextView
android:id="@+id/timetable_header_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@id/timetable_header_alert_image"
android:layout_toStartOf="@+id/timetable_header_alert_image"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:textSize="19sp" />
<ImageView
android:id="@+id/timetable_header_alert_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/ic_exclamation_24dp"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/timetable_header_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/timetable_header_day"
android:layout_marginTop="5dp"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="@color/secondary_text"
android:textSize="14sp" />
</RelativeLayout>
<TextView
android:id="@+id/timetable_header_free_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="180dp"
android:layout_marginStart="180dp"
android:gravity="end"
android:maxLines="2"
android:text="@string/app_name"
android:textColor="@color/secondary_text"
android:textSize="16sp" />
<ImageView
android:id="@+id/timetable_header_alert_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/ic_exclamation_24dp"
tools:ignore="contentDescription" />
</RelativeLayout>
</FrameLayout>

View File

@ -61,7 +61,7 @@
android:layout_alignStart="@id/timetable_subItem_lesson"
android:maxLines="1"
android:text="@string/grades_text"
android:textColor="#4C4C4C"
android:textColor="@color/secondary_text"
android:textSize="12sp" />
<TextView
@ -77,7 +77,7 @@
android:layout_toRightOf="@+id/timetable_subItem_time"
android:maxLines="1"
android:text="@string/grades_text"
android:textColor="#4C4C4C"
android:textColor="@color/secondary_text"
android:textSize="12sp"
tool:ignore="all"/>

View File

@ -73,6 +73,7 @@
<string name="info_average_grades">Średnia: %1$.2f</string>
<string name="info_no_average">Brak średniej</string>
<string name="info_free_week">Brak lekcji w tym tygodniu</string>
<string name="timetable_subitem_room">Sala %s</string>
<plurals name="numberOfGradesPlurals">

View File

@ -10,5 +10,7 @@
<color name="three_grade">#FFE68C</color>
<color name="two_grade">#CE9AD2</color>
<color name="one_grade">#d32f2f</color>
<color name="secondary_text">#4c4c4c</color>
<color name="default_grade">#cdcdcd</color>
<color name="free_day">#eee</color>
</resources>

View File

@ -72,6 +72,7 @@
<string name="info_average_grades">Average: %1$.2f</string>
<string name="info_no_average">No average</string>
<string name="info_free_week">No lesson in this week</string>
<string name="error_host_offline">Technical break</string>
<string name="timetable_subitem_room">Room %s</string>