1
0

Add homework (#181)

This commit is contained in:
Mikołaj Pich
2018-11-14 09:18:00 +01:00
committed by Rafał Borcz
parent 24f59b45c3
commit 9f04dbf60f
25 changed files with 821 additions and 6 deletions

View File

@ -0,0 +1,10 @@
<!--https://materialdesignicons.com/icon/notebook-->
<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="#000"
android:pathData="M3,7V5H5V4C5,2.89 5.9,2 7,2H13V9L15.5,7.5L18,9V2H19C20.05,2 21,2.95 21,4V20C21,21.05 20.05,22 19,22H7C5.95,22 5,21.05 5,20V19H3V17H5V13H3V11H5V7H3M7,11H5V13H7V11M7,7V5H5V7H7M7,19V17H5V19H7Z" />
</vector>

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="@+id/homework_dialog_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/all_details"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/all_subject"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkDialogSubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/all_no_data"
android:textIsSelectable="true"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/all_teacher"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkDialogTeacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/all_no_data"
android:textIsSelectable="true"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/all_date"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkDialogDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/all_no_data"
android:textIsSelectable="true"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/all_entry_date"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkDialogEntryDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/all_no_data"
android:textIsSelectable="true"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/all_content"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkDialogContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:lineSpacingMultiplier="1.2"
android:text="@string/all_no_data"
android:textIsSelectable="true"
android:textSize="12sp" />
<Button
android:id="@+id/homeworkDialogClose"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="15dp"
android:text="@string/all_close"
android:textAllCaps="true"
android:textSize="15sp" />
</LinearLayout>
</ScrollView>

View File

@ -69,7 +69,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/note_content"
android:text="@string/all_content"
android:textSize="17sp" />
<TextView

View File

@ -0,0 +1,96 @@
<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.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="50dp">
<ProgressBar
android:id="@+id/homeworkProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/homeworkSwipe"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/homeworkRecycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/homeworkEmpty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="10dp"
android:visibility="gone">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="100dp"
android:minHeight="100dp"
app:srcCompat="@drawable/ic_menu_main_homework_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/homework_no_items"
android:textSize="20sp" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:background="?android:attr/windowBackground"
android:elevation="10dp"
android:orientation="horizontal">
<Button
android:id="@+id/homeworkPreviousButton"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="4dp"
android:gravity="start|center"
android:text="@string/all_prev"
android:textAlignment="gravity" />
<TextView
android:id="@+id/homeworkNavDate"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/app_name" />
<Button
android:id="@+id/homeworkNextButton"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_weight="1"
android:drawablePadding="4dp"
android:gravity="end|center"
android:text="@string/all_next"
android:textAlignment="gravity" />
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,49 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/homework_subitem_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_all_divider"
android:foreground="?attr/selectableItemBackgroundBorderless">
<TextView
android:id="@+id/homeworkItemSubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:text="@string/all_date"
android:textSize="17sp" />
<TextView
android:id="@+id/homeworkItemTeacher"
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_marginTop="10dp"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_toEndOf="@id/homeworkItemSubject"
android:layout_toRightOf="@id/homeworkItemSubject"
android:gravity="end"
android:text="@string/all_teacher"
android:textSize="13sp" />
<TextView
android:id="@+id/homeworkItemContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/homeworkItemSubject"
android:layout_alignStart="@id/homeworkItemSubject"
android:layout_alignLeft="@id/homeworkItemSubject"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="15dp"
android:lineSpacingMultiplier="1.2"
android:text="@string/all_content"
android:textSize="14sp" />
</RelativeLayout>

View File

@ -12,6 +12,7 @@
<string name="more_title">Więcej</string>
<string name="about_title">O aplikacji</string>
<string name="note_title">Uwagi i osiągnięcia</string>
<string name="homework_title">Zadania domowe</string>
<!--Login form-->
@ -120,7 +121,6 @@
<!--Note-->
<string name="note_no_items">Brak informacji o uwagach</string>
<string name="note_content">Treść</string>
<plurals name="note_number_item">
<item quantity="one">%d uwaga</item>
<item quantity="few">%d uwagi</item>
@ -136,11 +136,17 @@
</plurals>
<!--Homework-->
<string name="homework_no_items">Brak zadań domowych</string>
<!--Generic-->
<string name="all_content">Treść</string>
<string name="all_description">Opis</string>
<string name="all_no_description">Brak opisu</string>
<string name="all_teacher">Nauczyciel</string>
<string name="all_date">Data</string>
<string name="all_entry_date">Data wpisu</string>
<string name="all_color">Kolor</string>
<string name="all_details">Szczegóły</string>
<string name="all_category">Kategoria</string>

View File

@ -12,6 +12,7 @@
<string name="more_title">More</string>
<string name="about_title">About</string>
<string name="note_title">Notes and achievements</string>
<string name="homework_title">Homework</string>
<!--Login form-->
@ -109,7 +110,6 @@
<!--Note-->
<string name="note_no_items">No info about notes</string>
<string name="note_content">Content</string>
<plurals name="note_number_item">
<item quantity="one">%d note</item>
<item quantity="other">%d notes</item>
@ -121,11 +121,17 @@
</plurals>
<!--Homework-->
<string name="homework_no_items">No info about homework</string>
<!--Generic-->
<string name="all_content">Content</string>
<string name="all_description">Description</string>
<string name="all_no_description">No description</string>
<string name="all_teacher">Teacher</string>
<string name="all_date">Date</string>
<string name="all_entry_date">Entry date</string>
<string name="all_color">Color</string>
<string name="all_details">Details</string>
<string name="all_category">Category</string>