From e04433b3461bb8094f543c3a12fda8c39c33886a Mon Sep 17 00:00:00 2001 From: darthpaul Date: Sun, 17 Apr 2022 18:01:45 +0100 Subject: [PATCH 1/2] add setting for sending group message as MMS --- .../smsmessenger/activities/SettingsActivity.kt | 9 +++++++++ .../smsmessenger/extensions/Context.kt | 1 + .../smsmessenger/helpers/Config.kt | 4 ++++ .../smsmessenger/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 16 ++++++++++++++++ 5 files changed, 31 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt index dfc2dab7..fe85f50b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt @@ -39,6 +39,7 @@ class SettingsActivity : SimpleActivity() { setupUseSimpleCharacters() setupEnableDeliveryReports() setupSendLongMessageAsMMS() + setupGroupMessageAsMMS() setupLockScreenVisibility() setupMMSFileSizeLimit() updateTextColors(settings_scrollview) @@ -184,6 +185,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupGroupMessageAsMMS() { + settings_send_group_message_mms.isChecked = config.sendGroupMessageMMS + settings_send_group_message_mms_holder.setOnClickListener { + settings_send_group_message_mms.toggle() + config.sendGroupMessageMMS = settings_send_group_message_mms.isChecked + } + } + private fun setupLockScreenVisibility() { settings_lock_screen_visibility.text = getLockScreenVisibilityText() settings_lock_screen_visibility_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt index e29cb15b..4f120ab5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt @@ -969,5 +969,6 @@ fun Context.getSendMessageSettings(): Settings { settings.deliveryReports = config.enableDeliveryReports settings.sendLongAsMms = config.sendLongMessageMMS settings.sendLongAsMmsAfter = 1 + settings.group = config.sendGroupMessageMMS return settings } diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt index 79d4c398..4f7ff450 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt @@ -32,6 +32,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(SEND_LONG_MESSAGE_MMS, false) set(sendLongMessageMMS) = prefs.edit().putBoolean(SEND_LONG_MESSAGE_MMS, sendLongMessageMMS).apply() + var sendGroupMessageMMS: Boolean + get() = prefs.getBoolean(SEND_GROUP_MESSAGE_MMS, false) + set(sendGroupMessageMMS) = prefs.edit().putBoolean(SEND_GROUP_MESSAGE_MMS, sendGroupMessageMMS).apply() + var lockScreenVisibilitySetting: Int get() = prefs.getInt(LOCK_SCREEN_VISIBILITY, LOCK_SCREEN_SENDER_MESSAGE) set(lockScreenVisibilitySetting) = prefs.edit().putInt(LOCK_SCREEN_VISIBILITY, lockScreenVisibilitySetting).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt index 8359b33b..6e46f4c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt @@ -17,6 +17,7 @@ const val USE_SIMPLE_CHARACTERS = "use_simple_characters" const val LOCK_SCREEN_VISIBILITY = "lock_screen_visibility" const val ENABLE_DELIVERY_REPORTS = "enable_delivery_reports" const val SEND_LONG_MESSAGE_MMS = "send_long_message_mms" +const val SEND_GROUP_MESSAGE_MMS = "send_group_message_mms" const val MMS_FILE_SIZE_LIMIT = "mms_file_size_limit" const val PINNED_CONVERSATIONS = "pinned_conversations" const val LAST_EXPORT_PATH = "last_export_path" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 9e26cbd7..b7147f6b 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -281,6 +281,22 @@ + + + + + + Date: Mon, 18 Apr 2022 10:05:45 +0200 Subject: [PATCH 2/2] after some testing, lets enable group message MMS sending by default --- .../kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt index 4f7ff450..edca4fef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt @@ -33,7 +33,7 @@ class Config(context: Context) : BaseConfig(context) { set(sendLongMessageMMS) = prefs.edit().putBoolean(SEND_LONG_MESSAGE_MMS, sendLongMessageMMS).apply() var sendGroupMessageMMS: Boolean - get() = prefs.getBoolean(SEND_GROUP_MESSAGE_MMS, false) + get() = prefs.getBoolean(SEND_GROUP_MESSAGE_MMS, true) set(sendGroupMessageMMS) = prefs.edit().putBoolean(SEND_GROUP_MESSAGE_MMS, sendGroupMessageMMS).apply() var lockScreenVisibilitySetting: Int