changes to make scheduled messages activity ui compliant with the rest of the app message listing activities. now allows sending and deleting multiple scheduled messages at once

This commit is contained in:
gavine99
2025-02-19 18:51:36 +11:00
parent 302dadd077
commit d7c5b1b71e
13 changed files with 430 additions and 241 deletions
@@ -17,145 +17,177 @@
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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:layout_height="match_parent"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constrainedHeight="true"
app:layout_constraintHeight_max="140dp"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:id="@+id/empty"
android:layout_width="match_parent"
<dev.octoshrimpy.quik.common.widget.QkTextView
android:id="@+id/toolbarTitle"
style="@style/ToolbarText"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="24dp"
android:paddingEnd="24dp">
<dev.octoshrimpy.quik.common.widget.QkTextView
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/scheduled_empty_description"
android:textColor="?android:attr/textColorSecondary" />
<Space
android:layout_width="match_parent"
android:layout_height="56dp" />
<dev.octoshrimpy.quik.common.widget.TightTextView
style="@style/ScheduledSampleTextStyle"
android:layout_gravity="end"
android:text="@string/scheduled_empty_message_1" />
<dev.octoshrimpy.quik.common.widget.TightTextView
android:id="@+id/sampleMessage"
style="@style/ScheduledSampleTextStyle"
android:layout_marginTop="16dp"
android:background="@drawable/rounded_rectangle_22dp"
android:text="@string/scheduled_empty_message_2"
tools:backgroundTint="@color/tools_theme"
tools:textColor="@color/textPrimaryDark" />
<dev.octoshrimpy.quik.common.widget.TightTextView
style="@style/ScheduledSampleTextStyle"
android:layout_gravity="end"
android:layout_marginTop="16dp"
android:text="@string/scheduled_empty_message_3" />
<dev.octoshrimpy.quik.common.widget.QkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:gravity="end"
android:text="@string/scheduled_empty_message_3_timestamp"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="italic"
app:textSize="secondary" />
<Space
android:layout_width="match_parent"
android:layout_height="56dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/messages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/scheduled_message_list_item" />
android:textDirection="ltr"
tools:text="Moez Bhatti" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.Toolbar>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/compose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:contentDescription="@string/scheduled_compose_cd"
android:src="@drawable/ic_schedule_send_black_24dp"
android:tint="@color/white"
android:visibility="visible"
tools:backgroundTint="@color/tools_theme" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/upgrade"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:background="@drawable/rounded_rectangle_24dp"
android:elevation="4dp"
android:gravity="center"
android:visibility="gone"
tools:backgroundTint="@color/tools_theme">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<ImageView
android:id="@+id/upgradeIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:src="@drawable/ic_star_black_24dp"
tools:tint="@color/textPrimaryDark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical">
<dev.octoshrimpy.quik.common.widget.QkTextView
android:id="@+id/upgradeLabel"
<LinearLayout
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="24dp"
android:paddingEnd="24dp">
<dev.octoshrimpy.quik.common.widget.QkTextView
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/scheduled_empty_description"
android:textColor="?android:attr/textColorSecondary" />
<Space
android:layout_width="match_parent"
android:layout_height="56dp" />
<dev.octoshrimpy.quik.common.widget.TightTextView
style="@style/ScheduledSampleTextStyle"
android:layout_gravity="end"
android:text="@string/scheduled_empty_message_1" />
<dev.octoshrimpy.quik.common.widget.TightTextView
android:id="@+id/sampleMessage"
style="@style/ScheduledSampleTextStyle"
android:layout_marginTop="16dp"
android:background="@drawable/rounded_rectangle_22dp"
android:text="@string/scheduled_empty_message_2"
tools:backgroundTint="@color/tools_theme"
tools:textColor="@color/textPrimaryDark" />
<dev.octoshrimpy.quik.common.widget.TightTextView
style="@style/ScheduledSampleTextStyle"
android:layout_gravity="end"
android:layout_marginTop="16dp"
android:text="@string/scheduled_empty_message_3" />
<dev.octoshrimpy.quik.common.widget.QkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:gravity="end"
android:text="@string/scheduled_empty_message_3_timestamp"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="italic"
app:textSize="secondary" />
<Space
android:layout_width="match_parent"
android:layout_height="56dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/messages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/scheduled_message_list_item" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/compose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/title_qksms_plus"
android:textColor="@color/textPrimaryDark"
android:textStyle="bold"
app:textSize="primary" />
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:contentDescription="@string/scheduled_compose_cd"
android:src="@drawable/ic_schedule_send_black_24dp"
android:tint="@color/white"
android:visibility="visible"
tools:backgroundTint="@color/tools_theme" />
</LinearLayout>
<LinearLayout
android:id="@+id/upgrade"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:background="@drawable/rounded_rectangle_24dp"
android:elevation="4dp"
android:gravity="center"
android:visibility="gone"
tools:backgroundTint="@color/tools_theme">
<include layout="@layout/collapsing_toolbar" />
<ImageView
android:id="@+id/upgradeIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:src="@drawable/ic_star_black_24dp"
tools:tint="@color/textPrimaryDark" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?android:attr/divider" />
<dev.octoshrimpy.quik.common.widget.QkTextView
android:id="@+id/upgradeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/title_qksms_plus"
android:textColor="@color/textPrimaryDark"
android:textStyle="bold"
app:textSize="primary" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?android:attr/divider" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2025
~
~ This file is part of QUIK.
~
~ QUIK is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QUIK is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QUIK. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/select_all"
android:icon="?attr/actionModeSelectAllDrawable"
android:title="@string/main_menu_select_all"
android:visible="false"
app:showAsAction="ifRoom" />
<item
android:id="@+id/delete"
android:icon="@drawable/ic_delete_white_24dp"
android:title="@string/main_menu_delete"
android:visible="false"
app:showAsAction="ifRoom" />
<item
android:id="@+id/copy"
android:icon="@drawable/ic_content_copy_black_24dp"
android:title="@string/compose_menu_copy"
android:visible="false"
app:showAsAction="never" />
<item
android:id="@+id/send_now"
android:icon="@drawable/ic_send_black_24dp"
android:title="@string/main_menu_send_now"
android:visible="false"
app:showAsAction="never" />
</menu>
+5 -5
View File
@@ -57,6 +57,7 @@
<string name="main_menu_read">Mark read</string>
<string name="main_menu_unread">Mark unread</string>
<string name="main_menu_block">Block</string>
<string name="main_menu_send_now">Send now</string>
<string name="main_menu_rename_conversation">Rename conversation</string>
<string name="main_syncing">Syncing messages…</string>
<string name="main_sender_you">You: %s</string>
@@ -102,6 +103,10 @@
<item quantity="one">Are you sure you would like to delete this message?</item>
<item quantity="other">Are you sure you would like to delete %d messages?</item>
</plurals>
<plurals name="dialog_send_now">
<item quantity="one">Are you sure you would like to send this message now?</item>
<item quantity="other">Are you sure you would like to send %d messages now?</item>
</plurals>
<string name="dialog_clear_compose_title">Clear message</string>
<string name="dialog_clear_compose">Clear the message? This action can\'t be undone.</string>
@@ -234,11 +239,6 @@
<string name="scheduled_compose_cd">Schedule a message</string>
<string name="scheduled_options_title">Scheduled message</string>
<string name="attachment_missing">Missing</string>
<string-array name="scheduled_options">
<item>Send now</item>
<item>Copy text</item>
<item>Delete</item>
</string-array>
<string name="settings_category_appearance">Appearance</string>
<string name="settings_category_general">General</string>