Merge pull request #332 from KryptKode/feat/group_msgs_as_mms

add setting for sending group message as MMS
This commit is contained in:
Tibor Kaputa 2022-04-18 10:07:43 +02:00 committed by GitHub
commit 0d3c87a67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 0 deletions

View File

@ -39,6 +39,7 @@ class SettingsActivity : SimpleActivity() {
setupUseSimpleCharacters() setupUseSimpleCharacters()
setupEnableDeliveryReports() setupEnableDeliveryReports()
setupSendLongMessageAsMMS() setupSendLongMessageAsMMS()
setupGroupMessageAsMMS()
setupLockScreenVisibility() setupLockScreenVisibility()
setupMMSFileSizeLimit() setupMMSFileSizeLimit()
updateTextColors(settings_scrollview) 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() { private fun setupLockScreenVisibility() {
settings_lock_screen_visibility.text = getLockScreenVisibilityText() settings_lock_screen_visibility.text = getLockScreenVisibilityText()
settings_lock_screen_visibility_holder.setOnClickListener { settings_lock_screen_visibility_holder.setOnClickListener {

View File

@ -969,5 +969,6 @@ fun Context.getSendMessageSettings(): Settings {
settings.deliveryReports = config.enableDeliveryReports settings.deliveryReports = config.enableDeliveryReports
settings.sendLongAsMms = config.sendLongMessageMMS settings.sendLongAsMms = config.sendLongMessageMMS
settings.sendLongAsMmsAfter = 1 settings.sendLongAsMmsAfter = 1
settings.group = config.sendGroupMessageMMS
return settings return settings
} }

View File

@ -32,6 +32,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(SEND_LONG_MESSAGE_MMS, false) get() = prefs.getBoolean(SEND_LONG_MESSAGE_MMS, false)
set(sendLongMessageMMS) = prefs.edit().putBoolean(SEND_LONG_MESSAGE_MMS, sendLongMessageMMS).apply() set(sendLongMessageMMS) = prefs.edit().putBoolean(SEND_LONG_MESSAGE_MMS, sendLongMessageMMS).apply()
var sendGroupMessageMMS: Boolean
get() = prefs.getBoolean(SEND_GROUP_MESSAGE_MMS, true)
set(sendGroupMessageMMS) = prefs.edit().putBoolean(SEND_GROUP_MESSAGE_MMS, sendGroupMessageMMS).apply()
var lockScreenVisibilitySetting: Int var lockScreenVisibilitySetting: Int
get() = prefs.getInt(LOCK_SCREEN_VISIBILITY, LOCK_SCREEN_SENDER_MESSAGE) get() = prefs.getInt(LOCK_SCREEN_VISIBILITY, LOCK_SCREEN_SENDER_MESSAGE)
set(lockScreenVisibilitySetting) = prefs.edit().putInt(LOCK_SCREEN_VISIBILITY, lockScreenVisibilitySetting).apply() 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 LOCK_SCREEN_VISIBILITY = "lock_screen_visibility"
const val ENABLE_DELIVERY_REPORTS = "enable_delivery_reports" const val ENABLE_DELIVERY_REPORTS = "enable_delivery_reports"
const val SEND_LONG_MESSAGE_MMS = "send_long_message_mms" 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 MMS_FILE_SIZE_LIMIT = "mms_file_size_limit"
const val PINNED_CONVERSATIONS = "pinned_conversations" const val PINNED_CONVERSATIONS = "pinned_conversations"
const val LAST_EXPORT_PATH = "last_export_path" const val LAST_EXPORT_PATH = "last_export_path"

View File

@ -281,6 +281,22 @@
</RelativeLayout> </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 <RelativeLayout
android:id="@+id/settings_mms_file_size_limit_holder" android:id="@+id/settings_mms_file_size_limit_holder"
android:layout_width="match_parent" android:layout_width="match_parent"