add setting for sending group message as MMS

This commit is contained in:
darthpaul 2022-04-17 18:01:45 +01:00
parent 1b8c841cf6
commit e04433b346
5 changed files with 31 additions and 0 deletions

View File

@ -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 {

View File

@ -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
}

View File

@ -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()

View File

@ -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"

View File

@ -281,6 +281,22 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_send_group_message_mms_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_send_group_message_mms"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/group_message_mms" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_mms_file_size_limit_holder"
android:layout_width="match_parent"