diff --git a/domain/src/main/java/com/moez/QKSMS/util/Preferences.kt b/domain/src/main/java/com/moez/QKSMS/util/Preferences.kt index debc976b31de6a2821c227b8f4cc36a5d023d71f..b9aa930324b0b283ff662c42d263523efb85b9f4 100644 --- a/domain/src/main/java/com/moez/QKSMS/util/Preferences.kt +++ b/domain/src/main/java/com/moez/QKSMS/util/Preferences.kt @@ -120,7 +120,7 @@ class Preferences @Inject constructor( val mobileOnly = rxPrefs.getBoolean("mobileOnly", false) val autoDelete = rxPrefs.getInteger("autoDelete", 0) val longAsMms = rxPrefs.getBoolean("longAsMms", false) - val mmsSize = rxPrefs.getInteger("mmsSize", 300) + val mmsSize = rxPrefs.getInteger("mmsSize", -1) val logging = rxPrefs.getBoolean("logging", false) init { diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt index 06ab61d5b1b18bc258a507d3f312589cd7802447..aad641a4f3a48bcddac19fde8725d075d4669936 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt @@ -23,8 +23,10 @@ import android.animation.ObjectAnimator import android.app.AlertDialog import android.content.Intent import android.content.res.ColorStateList +import android.content.SharedPreferences import android.os.Build import android.os.Bundle +import android.preference.PreferenceManager import android.view.Gravity import android.view.Menu import android.view.MenuItem @@ -179,6 +181,22 @@ class MainActivity : QkThemedActivity(), MainView { if (Build.VERSION.SDK_INT <= 22) { toolbarSearch.setBackgroundTint(resolveThemeColor(R.attr.bubbleColor)) } + + val sharedPreferences: SharedPreferences = + PreferenceManager.getDefaultSharedPreferences(this) + val editor: SharedPreferences.Editor = sharedPreferences.edit() + var changeDefault: Int = sharedPreferences.getInt("changeDefault", 0) + when (changeDefault) { + 0 -> { + // Set MMS site auto (-1) if its 300kb + val mmsSize: Int = sharedPreferences.getInt("mmsSize", 300) + if (mmsSize == 300) { + editor.putInt("mmsSize", -1) + } + changeDefault++ + } + } + editor.putInt("changeDefault", changeDefault).apply() } override fun onNewIntent(intent: Intent?) { diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index ac330d353ba370a816d33398e1745d4fc4ca4fb5..7351432965826f0769cf54e00b8ae5baca54b4a6 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -457,7 +457,7 @@ - Automatic + Automatic (uses allowed carrier max size) 100KB 200KB 300KB