mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Display option to select Max MMS size
This commit is contained in:
@@ -29,4 +29,8 @@ fun Context.getColorCompat(colorRes: Int): Int {
|
||||
|
||||
fun Context.makeToast(@StringRes res: Int, duration: Int = Toast.LENGTH_SHORT) {
|
||||
Toast.makeText(this, res, duration).show()
|
||||
}
|
||||
|
||||
fun Context.makeToast(text: String, duration: Int = Toast.LENGTH_SHORT) {
|
||||
Toast.makeText(this, text, duration).show()
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import common.di.appComponent
|
||||
import common.util.extensions.dpToPx
|
||||
import common.util.extensions.makeToast
|
||||
import common.util.extensions.setVisible
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
@@ -49,6 +50,7 @@ class SettingsActivity : QkActivity<SettingsViewModel>(), SettingsView {
|
||||
override val preferenceClickIntent: Subject<PreferenceView> = PublishSubject.create()
|
||||
override val themeSelectedIntent: Observable<Int> by lazy { themeAdapter.colorSelected }
|
||||
override val ringtoneSelectedIntent: Subject<String> = PublishSubject.create()
|
||||
override val mmsSizeSelectedIntent: Subject<Int> = PublishSubject.create()
|
||||
|
||||
// TODO remove this
|
||||
private val progressDialog by lazy {
|
||||
@@ -170,6 +172,10 @@ class SettingsActivity : QkActivity<SettingsViewModel>(), SettingsView {
|
||||
startActivityForResult(intent, 123)
|
||||
}
|
||||
|
||||
override fun showMmsSizePicker() {
|
||||
makeToast("Max MMS size")
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == 123 && resultCode == Activity.RESULT_OK) {
|
||||
|
||||
@@ -29,6 +29,8 @@ interface SettingsView : QkView<SettingsState> {
|
||||
val preferenceClickIntent: Subject<PreferenceView>
|
||||
val themeSelectedIntent: Observable<Int>
|
||||
val ringtoneSelectedIntent: Observable<String>
|
||||
val mmsSizeSelectedIntent: Observable<Int>
|
||||
|
||||
fun showRingtonePicker(default: Uri)
|
||||
fun showMmsSizePicker()
|
||||
}
|
||||
|
||||
@@ -114,8 +114,7 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
|
||||
R.id.mms -> prefs.mms.set(!prefs.mms.get())
|
||||
|
||||
R.id.mmsSize -> {
|
||||
}
|
||||
R.id.mmsSize -> view.showMmsSizePicker()
|
||||
|
||||
R.id.sync -> {
|
||||
newState { it.copy(syncing = true) }
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
android:id="@+id/mmsSize"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:title="@string/settings_mms_size_title" />
|
||||
|
||||
<presentation.common.widget.PreferenceView
|
||||
|
||||
Reference in New Issue
Block a user