1
0

Android Notifications implementation (#33)

* Fix bug with the number of grades in snackbar
* Add basic grade notification
* Add notification icons
* Add intent to notification 
* Improve login activity appearance
* Improve dashboard appearance
* Small amendments
* Change splash logo
This commit is contained in:
Rafał Borcz
2017-11-16 20:52:47 +01:00
committed by Mikołaj Pich
parent e5ea6e0b41
commit 2fbd2da60c
58 changed files with 373 additions and 74 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 KiB

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="51.67464"
android:viewportHeight="51.67464">
<group
android:translateX="13.83732"
android:translateY="13.83732">
<path
android:fillColor="#FF000000"
android:pathData="M10.545,11h-2.215c-0.158,-1.234 -0.428,-1.971 -2.092,-2.691 -1.38,-0.598 -2.238,-1.83 -2.238,-3.218 0,-2.021 1.652,-3.317 3.286,-3.459 0.625,-0.999 1.731,-1.632 2.94,-1.632 0.877,0 1.697,0.325 2.323,0.892 0.793,-0.576 1.747,-0.892 2.743,-0.892 2.596,0 4.708,2.1 4.708,4.682s-2.112,4.682 -4.708,4.682c-0.606,0 -1.165,-0.129 -1.658,-0.242 -1.001,-0.231 -2.327,-0.563 -3.089,1.878zM6.012,5.091c0,0.871 0.788,1.279 1.029,1.384 0.84,0.364 1.926,0.834 2.609,2.102 0.815,-1.108 1.755,-1.632 2.904,-1.632 0.858,0 2.083,0.419 2.737,0.419 1.487,0 2.697,-1.203 2.697,-2.682 0,-2.79 -3.694,-3.635 -5.517,-1.166 -0.707,-2.031 -3.865,-1.937 -3.887,0.219 -0.67,-0.61 -2.572,-0.331 -2.572,1.356zM17,14l-2.154,3 -3.846,-5c-0.364,0.316 -0.932,0.474 -1.5,0.474s-1.136,-0.158 -1.5,-0.474l-8,12h24l-7,-10zM7.005,17.097l1.12,0.903 1.5,-1.604 1.667,1.604 1.083,-0.933 2.527,3.285 2.078,-2.894 3.179,4.542h-16.422l3.268,-4.903z" />
</group>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M 5.898438 2.199219 L 10 6.300781 C 10 6.300781 10 7.5 8.800781 8.800781 C 7.5
10 6.300781 10 6.300781 10 L 2.199219 5.898438 C 1.601563 8.199219 2.398438 11
4.101563 12.699219 C 6.699219 15.300781 9.898438 13 10.601563 13.699219 C
14.199219 17.300781 17.101563 21 17.300781 21.199219 C 18.398438 22.300781
20.199219 22.300781 21.199219 21.300781 C 22.300781 20.199219 22.199219 18.5
21.101563 17.398438 C 21 17.300781 17.101563 14.199219 13.5 10.601563 C
12.800781 9.898438 15.300781 6.800781 12.601563 4.101563 C 11 2.398438 8.199219
1.601563 5.898438 2.199219 Z M 20.199219 19 C 20.199219 19.699219 19.699219
20.199219 19 20.199219 C 18.300781 20.199219 17.800781 19.699219 17.800781 19 C
17.800781 18.300781 18.300781 17.800781 19 17.800781 C 19.699219 17.800781
20.199219 18.300781 20.199219 19 Z" />
</vector>

View File

@ -0,0 +1,10 @@
<!-- drawable/numeric_6_box_multiple_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="26dp"
android:width="26dp"
android:viewportWidth="26"
android:viewportHeight="26">
<path
android:fillColor="#000000"
android:pathData="M13,11H15V13H13M13,15H15A2,2 0 0,0 17,13V11C17,9.89 16.1,9 15,9H13V7H17V5H13A2,2 0 0,0 11,7V13C11,14.11 11.9,15 13,15M21,17H7V3H21M21,1H7A2,2 0 0,0 5,3V17A2,2 0 0,0 7,19H21A2,2 0 0,0 23,17V3A2,2 0 0,0 21,1M3,5H1V21A2,2 0 0,0 3,23H19V21H3V5Z" />
</vector>

View File

@ -1,8 +0,0 @@
<!-- drawable/numeric_6_box_multiple_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="26dp"
android:width="26dp"
android:viewportWidth="26"
android:viewportHeight="26">
<path android:fillColor="#ffffff" android:pathData="M13,11H15V13H13M13,15H15A2,2 0 0,0 17,13V11C17,9.89 16.1,9 15,9H13V7H17V5H13A2,2 0 0,0 11,7V13C11,14.11 11.9,15 13,15M21,17H7V3H21M21,1H7A2,2 0 0,0 5,3V17A2,2 0 0,0 7,19H21A2,2 0 0,0 23,17V3A2,2 0 0,0 21,1M3,5H1V21A2,2 0 0,0 3,23H19V21H3V5Z" />
</vector>

View File

@ -15,10 +15,12 @@
android:id="@+id/login_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="178dp"
android:gravity="center_horizontal"
android:layout_centerVertical="true"
android:visibility="gone"
>
android:visibility="gone">
<ProgressBar
android:id="@+id/login_progress_horizontal"
@ -28,10 +30,9 @@
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="91dp"
android:minHeight="30dp"
android:indeterminate="true"
android:minWidth="220dp"
/>
android:minHeight="30dp"
android:minWidth="220dp" />
<TextView
android:id="@+id/login_progress_text"
@ -39,8 +40,7 @@
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/login_progress_horizontal"
android:layout_centerHorizontal="true"
android:layout_marginBottom="42dp"
/>
android:layout_marginBottom="42dp" />
</RelativeLayout>
<ScrollView

View File

@ -11,7 +11,7 @@
android:layout_height="200dp"
android:layout_gravity="center"
android:layout_marginTop="70dp"
android:src="@drawable/logo_image"
android:src="@drawable/ic_logo_splash"
tools:ignore="ContentDescription" />
<TextView

View File

@ -2,11 +2,34 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="io.github.wulkanowy.activity.dashboard.attendance.AttendanceFragment">
<TextView
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Frekwencja" />
android:gravity="center">
<ImageView
android:id="@+id/wrench_under_construction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="45dp"
android:contentDescription="@string/activity_dashboard_text"
android:minHeight="100dp"
android:minWidth="100dp"
app:srcCompat="@drawable/ic_wrench_construction" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/activity_under_construction"
android:textSize="17sp"
android:textAlignment="center"
android:id="@+id/textView3" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -1,12 +1,35 @@
<android.support.design.widget.CoordinatorLayout 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"
tools:context="io.github.wulkanowy.activity.dashboard.board.BoardFragment">
<TextView
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Dashboard" />
android:gravity="center">
<ImageView
android:id="@+id/wrench_under_construction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="45dp"
android:contentDescription="@string/activity_dashboard_text"
android:minHeight="100dp"
android:minWidth="100dp"
app:srcCompat="@drawable/ic_wrench_construction" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/activity_under_construction"
android:textSize="17sp"
android:textAlignment="center"
android:id="@+id/textView3" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -1,10 +1,39 @@
<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/coordinator_grade"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.activity.dashboard.grades.GradesFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:id="@+id/fragment_no_grades">
<ImageView
android:id="@+id/wrench_under_construction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:contentDescription="@string/activity_dashboard_text"
android:minHeight="100dp"
android:minWidth="100dp"
app:srcCompat="@drawable/icon_grade_26dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/fragment_no_grades"
android:textSize="20sp"
android:textAlignment="center"
android:id="@+id/textView3" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"

View File

@ -2,11 +2,34 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="io.github.wulkanowy.activity.dashboard.lessonplan.LessonPlanFragment">
<TextView
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Plan lekcji" />
android:gravity="center">
<ImageView
android:id="@+id/wrench_under_construction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="45dp"
android:contentDescription="@string/activity_dashboard_text"
android:minHeight="100dp"
android:minWidth="100dp"
app:srcCompat="@drawable/ic_wrench_construction" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/activity_under_construction"
android:textSize="17sp"
android:textAlignment="center"
android:id="@+id/textView3" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -4,11 +4,11 @@
android:id="@+id/grade_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginStart="5dp"
android:layout_marginBottom="10dp"
android:foreground="?attr/selectableItemBackgroundBorderless"
card_view:cardElevation="0dp">
@ -19,7 +19,8 @@
android:layout_marginEnd="7dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_marginStart="7dp">
android:layout_marginStart="7dp"
android:layout_marginTop="7dp">
<TextView
android:id="@+id/grade_text"

View File

@ -3,7 +3,7 @@
<item
android:id="@+id/navigation_marks"
android:icon="@drawable/icon_marks_26dp"
android:icon="@drawable/icon_grade_26dp"
android:title="@string/grades_text" />
<item

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -23,38 +23,59 @@
<string name="action_create_account">Nie masz jeszcze konta? Załóż je</string>
<string name="action_forgot_password">Zapomniałeś hasła?</string>
<string name="color_black_text">Czarny</string>
<string name="color_red_text">Czerwony</string>
<string name="color_blue_text">Niebieski</string>
<string name="color_green_text">Zielony</string>
<string name="noColor_text">Brak koloru</string>
<string name="activity_dashboard_text">Aktywność dashboard</string>
<string name="dashboard_text">Dashboard</string>
<string name="grades_text">Oceny</string>
<string name="attendance_text">Frekwencja</string>
<string name="lessonplan_text">Plan lekcji</string>
<string name="settings_text">Ustawienia</string>
<string name="activity_under_construction">Ta część aplikacji jest w budowie</string>
<string name="fragment_no_grades">Brak ocen</string>
<string name="noInternet_text">Brak połączenia z internetem</string>
<string name="root_failed_text">To urządzenie posiada posiada podwyższone uprawnienia (root). Automatyczne logowanie zosatło wyłączone.</string>
<string name="encrypt_failed_text">Szyfrowanie nie powiodło się. Automatyczne logowanie zostało wyłączone</string>
<string name="version_text">Wersja %1$s</string>
<string name="refresh_error_text">"Podczas odświeżania zawartości wystąpił błąd. "</string>
<string name="dialog_description_text">Opis</string>
<string name="dialog_weight_text">Waga</string>
<string name="noDescription_text">Brak opisu</string>
<string name="dialog_teacher_text">Nauczyciel</string>
<string name="dialog_date_text">Data</string>
<string name="dialog_color_text">Kolor</string>
<string name="color_black_text">Czarny</string>
<string name="color_red_text">Czerwony</string>
<string name="color_blue_text">Niebieski</string>
<string name="color_green_text">Zielony</string>
<string name="noColor_text">Brak koloru</string>
<string name="dialog_close">Zamknij</string>
<string name="refresh_error_text">"Podczas odświeżania zawartości wystąpił błąd. "</string>
<string name="snackbar_no_grades">Brak nowych ocen</string>
<string name="snackbar_new_grade">Ilość nowych ocen: %1$d</string>
<plurals name="numberOfGrades">
<string name="info_average_grades">Średnia: %1$.2f</string>
<string name="info_no_average">Brak średniej</string>
<plurals name="numberOfGradesPlurals">
<item quantity="one">%d ocena</item>
<item quantity="few">%d oceny</item>
<item quantity="many">%d ocen</item>
<item quantity="other">%d ocen</item>
</plurals>
<string name="info_average_grades">Średnia: %1$.2f</string>
<string name="info_no_average">Brak średniej</string>
<plurals name="newGradePlurals">
<item quantity="one">Nowa ocena</item>
<item quantity="few">Nowe oceny</item>
<item quantity="many">Nowych ocen</item>
<item quantity="other">Nowych ocen</item>
</plurals>
<plurals name="receivedNewGradePlurals">
<item quantity="one">Dostałeś %1$d ocenę</item>
<item quantity="few">"Dostałeś %1$d oceny</item>
<item quantity="many">Dostałeś %1$d ocen</item>
<item quantity="other">Dostałeś %1$d ocen</item>
</plurals>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -35,6 +35,8 @@
<string name="attendance_text">Attendance</string>
<string name="lessonplan_text">Lesson Plan</string>
<string name="settings_text">Settings</string>
<string name="activity_under_construction">This section of app is under construction.</string>
<string name="fragment_no_grades">No grades</string>
<string name="noInternet_text">No internet connection</string>
<string name="root_failed_text">This device is rooted. Automatic login has been disabled</string>
@ -53,10 +55,21 @@
<string name="snackbar_no_grades">No new grades</string>
<string name="snackbar_new_grade">Number of new grades: %1$d</string>
<plurals name="numberOfGrades">
<string name="info_average_grades">Average: %1$.2f</string>
<string name="info_no_average">No average</string>
<plurals name="numberOfGradesPlurals">
<item quantity="one">%d grade</item>
<item quantity="other">%d grades</item>
</plurals>
<string name="info_average_grades">Average: %1$.2f</string>
<string name="info_no_average">No average</string>
<plurals name="newGradePlurals">
<item quantity="one">New grade</item>
<item quantity="other">New grades</item>
</plurals>
<plurals name="receivedNewGradePlurals">
<item quantity="one">You received %1$d grade</item>
<item quantity="other">You received %1$d grades</item>
</plurals>
</resources>