#1223 - Add option to only show mobile numbers

This commit is contained in:
Moez Bhatti
2018-08-10 22:37:05 -04:00
parent d6bf211d9f
commit caae77a189
10 changed files with 99 additions and 15 deletions
@@ -138,6 +138,7 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
systemFont.checkbox.isChecked = state.systemFontEnabled
unicode.checkbox.isChecked = state.stripUnicodeEnabled
mobileOnly.checkbox.isChecked = state.mobileOnly
mmsSize.summary = state.maxMmsSizeSummary
mmsSizeDialog.adapter.selectedItem = state.maxMmsSizeId
@@ -78,6 +78,9 @@ class SettingsPresenter @Inject constructor(
disposables += prefs.unicode.asObservable()
.subscribe { enabled -> newState { copy(stripUnicodeEnabled = enabled) } }
disposables += prefs.mobileOnly.asObservable()
.subscribe { enabled -> newState { copy(mobileOnly = enabled) } }
val mmsSizeLabels = context.resources.getStringArray(R.array.mms_sizes)
val mmsSizeIds = context.resources.getIntArray(R.array.mms_sizes_ids)
disposables += prefs.mmsSize.asObservable()
@@ -130,6 +133,8 @@ class SettingsPresenter @Inject constructor(
R.id.unicode -> prefs.unicode.set(!prefs.unicode.get())
R.id.mobileOnly -> prefs.mobileOnly.set(!prefs.mobileOnly.get())
R.id.mmsSize -> view.showMmsSizePicker()
R.id.sync -> {
@@ -38,6 +38,7 @@ data class SettingsState(
val systemFontEnabled: Boolean = false,
val splitSmsEnabled: Boolean = false,
val stripUnicodeEnabled: Boolean = false,
val mobileOnly: Boolean = false,
val maxMmsSizeSummary: String = "100KB",
val maxMmsSizeId: Int = 100
)
@@ -0,0 +1,27 @@
<!--
~ Copyright (C) 2017 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/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19H7V5h10v14z"/>
</vector>
@@ -153,6 +153,15 @@
app:title="@string/settings_unicode_title"
app:widget="@layout/settings_switch_widget" />
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/mobileOnly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/ic_smartphone_black_24dp"
app:summary="@string/settings_mobile_summary"
app:title="@string/settings_mobile_title"
app:widget="@layout/settings_switch_widget" />
<com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/mmsSize"
android:layout_width="match_parent"
@@ -203,6 +203,8 @@
<string name="settings_delivery_summary">Confirm that messages were sent successfully</string>
<string name="settings_unicode_title">Strip accents</string>
<string name="settings_unicode_summary">Remove accents from characters in outgoing SMS messages</string>
<string name="settings_mobile_title">Mobile numbers only</string>
<string name="settings_mobile_summary">When composing a message, only show mobile numbers</string>
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
<string name="settings_sync_title">Sync messages</string>
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>