Move option to edit blocking manager settings to selection screen

This commit is contained in:
moezbhatti
2019-07-30 12:09:37 -04:00
parent 816a355d13
commit 9ebf4bfd4b
23 changed files with 214 additions and 95 deletions
@@ -34,39 +34,13 @@
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/blockingManager"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@id/settingsDivider"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/blocking_manager_title"
tools:summary="@string/app_name" />
<View
android:id="@+id/settingsDivider"
android:layout_width="1dp"
android:layout_height="38dp"
android:background="?android:attr/divider"
app:layout_constraintBottom_toBottomOf="@id/blockingManager"
app:layout_constraintEnd_toStartOf="@id/settings"
app:layout_constraintStart_toEndOf="@id/blockingManager"
app:layout_constraintTop_toTopOf="@id/blockingManager" />
<ImageView
android:id="@+id/settings"
android:layout_width="72dp"
android:layout_height="72dp"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/blocking_manager_settings_cd"
android:padding="24dp"
android:src="@drawable/ic_settings_black_24dp"
app:layout_constraintBottom_toBottomOf="@id/blockingManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/settingsDivider"
app:layout_constraintTop_toTopOf="@id/blockingManager"
tools:tint="@color/tools_theme" />
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/drop"
android:layout_width="match_parent"
@@ -35,21 +35,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:summary="@string/blocking_manager_qksms_summary"
app:title="@string/app_name" />
app:title="@string/app_name"
app:widget="@layout/blocking_manager_list_option" />
<com.moez.QKSMS.common.widget.RadioPreferenceView
android:id="@+id/callControl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:summary="@string/blocking_manager_call_control_summary"
app:title="@string/blocking_manager_call_control_title" />
app:title="@string/blocking_manager_call_control_title"
app:widget="@layout/blocking_manager_list_option" />
<com.moez.QKSMS.common.widget.RadioPreferenceView
android:id="@+id/shouldIAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:summary="@string/blocking_manager_sia_summary"
app:title="@string/blocking_manager_sia_title" />
app:title="@string/blocking_manager_sia_title"
app:widget="@layout/blocking_manager_list_option" />
</LinearLayout>
@@ -0,0 +1,28 @@
<?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/>.
-->
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/launch"
android:layout_width="56dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:orientation="vertical"
android:padding="16dp"
android:src="@drawable/ic_chevron_right_black_24dp"
android:tint="?android:attr/textColorTertiary" />
@@ -39,11 +39,12 @@
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/titleView"
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="72dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toStartOf="@id/widgetFrame"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Default SMS App" />
@@ -60,4 +61,14 @@
app:layout_constraintTop_toBottomOf="@id/titleView"
tools:text="QKSMS is your default SMS app" />
<FrameLayout
android:id="@+id/widgetFrame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginEnd="24dp" />
</merge>
+3 -1
View File
@@ -21,6 +21,7 @@
<attr name="title" format="string" />
<attr name="summary" format="string" />
<attr name="widget" format="reference" />
<attr name="textColor" format="enum">
<enum name="theme" value="0" />
@@ -50,13 +51,14 @@
<declare-styleable name="PreferenceView">
<attr name="title" />
<attr name="summary" />
<attr name="widget" format="reference" />
<attr name="widget" />
<attr name="icon" format="reference" />
</declare-styleable>
<declare-styleable name="RadioPreferenceView">
<attr name="title" />
<attr name="summary" />
<attr name="widget" />
</declare-styleable>
</resources>
@@ -252,7 +252,6 @@
<string name="settings_delay_duration_hint">Enter duration (seconds)</string>
<string name="blocking_title">Blocking</string>
<string name="blocking_manager_settings_cd">Open settings for selected blocking manager</string>
<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>