Move blocked messages to their own screen

This commit is contained in:
moezbhatti
2019-08-29 00:14:02 +02:00
parent e163022f50
commit cdfd75fc01
13 changed files with 240 additions and 90 deletions
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS 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.
~
~ QKSMS 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 QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<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"
android:background="?android:attr/windowBackground">
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/empty"
style="@style/TextSecondary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="56dp"
android:text="@string/blocked_messages_empty" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/conversations"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/blocked_list_item" />
</FrameLayout>
@@ -17,7 +17,7 @@
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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"
@@ -25,71 +25,35 @@
android:background="?android:attr/windowBackground"
android:clipToPadding="false">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/parent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/blockingManager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/blocking_manager_title"
tools:summary="@string/blocking_manager_qksms_title" />
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/blockedNumbers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:title="@string/blocked_messages_title" />
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/blockingManager"
app:summary="@string/blocking_drop_summary"
app:title="@string/blocking_drop_title"
app:widget="@layout/settings_switch_widget" />
<View
android:id="@+id/conversationsDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="?android:attr/divider"
app:layout_constraintTop_toBottomOf="@+id/drop" />
</LinearLayout>
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/blockedLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:text="@string/blocking_conversations"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/conversationsDivider"
app:textSize="secondary" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/empty"
style="@style/TextSecondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="56dp"
android:text="@string/blocking_empty"
app:layout_constraintTop_toBottomOf="@+id/blockedLabel" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/conversations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/blockedLabel"
tools:listitem="@layout/blocked_list_item" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</ScrollView>
+3 -1
View File
@@ -255,7 +255,6 @@
<string name="blocking_drop_title">Drop messages</string>
<string name="blocking_drop_summary">Drop incoming messages from blocked senders instead of hiding them</string>
<string name="blocking_conversations">Blocked conversations</string>
<string name="blocking_empty">Your blocked conversations will appear here</string>
<string name="blocking_manager_title">Blocking Manager</string>
<string name="blocking_manager_qksms_title">QKSMS</string>
@@ -274,6 +273,9 @@
<string name="blocked_numbers_dialog_hint">Phone number</string>
<string name="blocked_numbers_dialog_block">Block</string>
<string name="blocked_messages_title">Blocked messages</string>
<string name="blocked_messages_empty">Your blocked messages will appear here</string>
<string name="blocking_block_title">Block</string>
<string name="blocking_unblock_title">Unblock</string>
<plurals name="blocking_block_external">