Added FormattedDate.kt to produce formatted strings more easily; TaskOverviewAdapter.kt now produces expandable items

This commit is contained in:
denizk0461
2023-05-23 12:39:43 +02:00
parent ce0667300d
commit e52a055cf1
17 changed files with 266 additions and 53 deletions
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,18.69L7.84,6.14 5.27,3.49 4,4.76l2.8,2.8v0.01c-0.52,0.99 -0.8,2.16 -0.8,3.42v5l-2,2v1h13.73l2,2L21,19.72l-1,-1.03zM12,22c1.11,0 2,-0.89 2,-2h-4c0,1.11 0.89,2 2,2zM18,14.68L18,11c0,-3.08 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68c-0.15,0.03 -0.29,0.08 -0.42,0.12 -0.1,0.03 -0.2,0.07 -0.3,0.11h-0.01c-0.01,0 -0.01,0 -0.02,0.01 -0.23,0.09 -0.46,0.2 -0.68,0.31 0,0 -0.01,0 -0.01,0.01L18,14.68z"/>
</vector>
+72 -2
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat
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="wrap_content"
android:paddingHorizontal="8dp"
@@ -17,12 +18,81 @@
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:padding="16dp">
android:padding="16dp"
android:background="@drawable/selectable_item_background"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="22sp"
app:fontFamily="@font/lato_bolditalic"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/icon_notify_header"
android:layout_marginEnd="8dp"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon_notify_header"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:importantForAccessibility="no"
app:layout_constraintTop_toTopOf="@id/text_title"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_due_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/layout_expanded_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.divider.MaterialDivider
android:id="@+id/divider"
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="4dp"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/layout_due_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon_notify_date"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:importantForAccessibility="no"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_notify_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
+6
View File
@@ -90,6 +90,12 @@
<string name="task_order_menu_date_created">Erstellungszeit</string>
<string name="task_order_menu_date_due">Abgabezeit</string>
<string name="formatted_date_string_localised">%s um %s</string>
<string name="task_item_notification_none">Du wirst nicht benachrichtigt.</string>
<string name="task_item_notification_active_future">Du wirst am %s um %s benachrichtigt.</string>
<string name="task_item_notification_active_past">Du wurdest am %s um %s benachrichtigt.</string>
<string name="task_overview_snack_unimplemented">Aufgaben sind noch nicht implementiert!</string>
<string name="task_overview_fab_add_task">Aufgabe hinzufügen</string>
+7
View File
@@ -91,6 +91,13 @@
<string name="task_order_menu_date_created">Date created</string>
<string name="task_order_menu_date_due">Date due</string>
<string name="formatted_date_string_comma" translatable="false">%s, %s</string>
<string name="formatted_date_string_localised">%s at %s</string>
<string name="task_item_notification_none">You won\'t be notified</string>
<string name="task_item_notification_active_future">You will be notified on %s at %s.</string>
<string name="task_item_notification_active_past">You were notified on %s at %s.</string>
<string name="task_overview_snack_unimplemented">Tasks are not yet implemented!</string>
<string name="task_overview_fab_add_task">Add task</string>