Add messages (#148)
This commit is contained in:

committed by
Rafał Borcz

parent
48f96b5932
commit
92baecbd0d
BIN
app/src/main/res/drawable-hdpi/ic_stat_notify_message.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_stat_notify_message.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/drawable-mdpi/ic_stat_notify_message.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_stat_notify_message.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 214 B |
BIN
app/src/main/res/drawable-xhdpi/ic_stat_notify_message.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_stat_notify_message.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 268 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_stat_notify_message.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_stat_notify_message.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 401 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_stat_notify_message.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_stat_notify_message.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 458 B |
9
app/src/main/res/drawable/ic_more_messages_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_more_messages_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z" />
|
||||
</vector>
|
@ -57,4 +57,4 @@
|
||||
android:text="@string/grade_no_items"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
33
app/src/main/res/layout/fragment_message.xml
Normal file
33
app/src/main/res/layout/fragment_message.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/messageTabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/colorPrimary"
|
||||
android:elevation="5dp"
|
||||
android:visibility="invisible"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabMaxWidth="0dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabTextColor="@android:color/white" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/messageViewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="48dp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/messageProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
90
app/src/main/res/layout/fragment_message_preview.xml
Normal file
90
app/src/main/res/layout/fragment_message_preview.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<FrameLayout 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">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageSubject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textSize="22sp"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageAuthor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="15sp"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="15sp"
|
||||
tools:text="@tools:sample/date/ddmmyy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/messageError"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
android:visibility="invisible">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="100dp"
|
||||
android:minHeight="100dp"
|
||||
app:srcCompat="@drawable/ic_more_messages_24dp"
|
||||
app:tint="?android:attr/textColorPrimary"
|
||||
tools:ignore="contentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/message_preview_error"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/messageProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true" />
|
||||
</FrameLayout>
|
50
app/src/main/res/layout/fragment_message_tab.xml
Normal file
50
app/src/main/res/layout/fragment_message_tab.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<FrameLayout 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">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/messageTabSwipe"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/messageTabRecycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/messageTabProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/messageTabEmpty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="100dp"
|
||||
android:minHeight="100dp"
|
||||
app:srcCompat="@drawable/ic_more_messages_24dp"
|
||||
app:tint="?android:attr/textColorPrimary"
|
||||
tools:ignore="contentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/message_no_items"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
52
app/src/main/res/layout/item_message.xml
Normal file
52
app/src/main/res/layout/item_message.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tool="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_all_divider"
|
||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageItemAuthor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginRight="40dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="15sp"
|
||||
tool:text="@tools:sample/full_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageItemDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toEndOf="@id/messageItemAuthor"
|
||||
android:layout_toRightOf="@id/messageItemAuthor"
|
||||
android:gravity="end"
|
||||
android:textSize="13sp"
|
||||
tool:text="@tools:sample/date/mmddyy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageItemSubject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/messageItemAuthor"
|
||||
android:layout_alignStart="@id/messageItemAuthor"
|
||||
android:layout_alignLeft="@id/messageItemAuthor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
tool:text="@tools:sample/lorem" />
|
||||
|
||||
</RelativeLayout>
|
@ -11,6 +11,7 @@
|
||||
<string name="settings_title">Ustawienia</string>
|
||||
<string name="more_title">Więcej</string>
|
||||
<string name="about_title">O aplikacji</string>
|
||||
<string name="message_title">Wiadomości</string>
|
||||
<string name="note_title">Uwagi i osiągnięcia</string>
|
||||
<string name="homework_title">Zadania domowe</string>
|
||||
<string name="account_title">Wybierz konto</string>
|
||||
@ -68,8 +69,7 @@
|
||||
<plurals name="grade_new_items">
|
||||
<item quantity="one">Nowa ocena</item>
|
||||
<item quantity="few">Nowe oceny</item>
|
||||
<item quantity="many">Nowych ocen</item>
|
||||
<item quantity="other">Nowych ocen</item>
|
||||
<item quantity="many">Nowe oceny</item>
|
||||
</plurals>
|
||||
|
||||
|
||||
@ -124,6 +124,38 @@
|
||||
<string name="exam_type">Typ</string>
|
||||
<string name="exam_entry_date">Data wpisu</string>
|
||||
|
||||
|
||||
<!--Message-->
|
||||
<string name="message_inbox">Odebrane</string>
|
||||
<string name="message_sent">Wysłane</string>
|
||||
<string name="message_trash">Kosz</string>
|
||||
<string name="message_no_subject">(brak tematu)</string>
|
||||
<string name="message_no_items">Brak wiadomości</string>
|
||||
<string name="message_preview_error">Wystąpił błąd podczas pobierania treści wiadomości</string>
|
||||
<string name="message_from">Od: %s</string>
|
||||
<string name="message_to">Do: %s</string>
|
||||
<string name="message_date">Data: %s</string>
|
||||
<plurals name="message_number_item">
|
||||
<item quantity="one">%d wiadomość</item>
|
||||
<item quantity="few">%d wiadomości</item>
|
||||
<item quantity="many">%d wiadomości</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="message_new_items">
|
||||
<item quantity="one">Nowa wiadomość</item>
|
||||
<item quantity="few">Nowe wiadomości</item>
|
||||
<item quantity="many">Nowe wiadomości</item>
|
||||
</plurals>
|
||||
|
||||
|
||||
<!--Message notify-->
|
||||
<string name="notify_message_channel">Nowe wiadomości</string>
|
||||
<plurals name="notify_message_new_items">
|
||||
<item quantity="one">Dostałeś %1$d wiadomość</item>
|
||||
<item quantity="few">"Dostałeś %1$d wiadomości</item>
|
||||
<item quantity="many">Dostałeś %1$d wiadomości</item>
|
||||
</plurals>
|
||||
|
||||
<!--About-->
|
||||
<string name="about_source_code">Kod źródłowy</string>
|
||||
<string name="about_feedback">Zgłoś błąd</string>
|
||||
|
@ -11,6 +11,7 @@
|
||||
<string name="settings_title">Settings</string>
|
||||
<string name="more_title">More</string>
|
||||
<string name="about_title">About</string>
|
||||
<string name="message_title">Messages</string>
|
||||
<string name="note_title">Notes and achievements</string>
|
||||
<string name="homework_title">Homework</string>
|
||||
<string name="account_title">Choose account</string>
|
||||
@ -113,6 +114,34 @@
|
||||
<string name="exam_type">Type</string>
|
||||
<string name="exam_entry_date">Entry date</string>
|
||||
|
||||
|
||||
<!--Message-->
|
||||
<string name="message_inbox">Inbox</string>
|
||||
<string name="message_sent">Sent</string>
|
||||
<string name="message_trash">Trash</string>
|
||||
<string name="message_no_subject">(no subject)</string>
|
||||
<string name="message_no_items">No messages</string>
|
||||
<string name="message_preview_error">An error occurred while downloading message content</string>
|
||||
<string name="message_from">From: %s</string>
|
||||
<string name="message_to">To: %s</string>
|
||||
<string name="message_date">Date: %s</string>
|
||||
<plurals name="message_number_item">
|
||||
<item quantity="one">%d message</item>
|
||||
<item quantity="other">%d messages</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="message_new_items">
|
||||
<item quantity="one">New message</item>
|
||||
<item quantity="other">New messages</item>
|
||||
</plurals>
|
||||
|
||||
<!--Message notify-->
|
||||
<string name="notify_message_channel">New messages</string>
|
||||
<plurals name="notify_message_new_items">
|
||||
<item quantity="one">You received %1$d message</item>
|
||||
<item quantity="other">You received %1$d messages</item>
|
||||
</plurals>
|
||||
|
||||
<!--About-->
|
||||
<string name="about_source_code">Source code</string>
|
||||
<string name="about_feedback">Report a bug</string>
|
||||
|
Reference in New Issue
Block a user