Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f015ac6e authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Change MMS compression to auto

parent 350c8ec4
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+18 −0
Original line number Diff line number Diff line
@@ -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?) {
+1 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@
    </string-array>

    <string-array name="mms_sizes">
        <item>Automatic</item>
        <item>Automatic (uses allowed carrier max size)</item>
        <item>100KB</item>
        <item>200KB</item>
        <item>300KB</item>