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

Commit a25713db authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge branch 'issue-1723'

parents 40e8cfef 83898b17
Loading
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ import com.moez.QKSMS.common.util.extensions.setVisible
import com.moez.QKSMS.common.widget.FieldDialog
import com.moez.QKSMS.common.widget.FieldDialog
import com.moez.QKSMS.feature.blocking.BlockingDialog
import com.moez.QKSMS.feature.blocking.BlockingDialog
import com.moez.QKSMS.feature.conversationinfo.injection.ConversationInfoModule
import com.moez.QKSMS.feature.conversationinfo.injection.ConversationInfoModule
import com.moez.QKSMS.feature.themepicker.ThemePickerController
import com.moez.QKSMS.injection.appComponent
import com.moez.QKSMS.injection.appComponent
import com.uber.autodispose.android.lifecycle.scope
import com.uber.autodispose.android.lifecycle.scope
import com.uber.autodispose.autoDisposable
import com.uber.autodispose.autoDisposable
@@ -99,8 +98,6 @@ class ConversationInfoController(


    override fun notificationClicks(): Observable<*> = notifications.clicks()
    override fun notificationClicks(): Observable<*> = notifications.clicks()


    override fun themeClicks(): Observable<*> = themePrefs.clicks()

    override fun archiveClicks(): Observable<*> = archive.clicks()
    override fun archiveClicks(): Observable<*> = archive.clicks()


    override fun blockClicks(): Observable<*> = block.clicks()
    override fun blockClicks(): Observable<*> = block.clicks()
@@ -124,8 +121,6 @@ class ConversationInfoController(


        notifications.isEnabled = !state.blocked
        notifications.isEnabled = !state.blocked


        themePrefs.isEnabled = !state.blocked

        archive.isEnabled = !state.blocked
        archive.isEnabled = !state.blocked
        archive.title = activity?.getString(when (state.archived) {
        archive.title = activity?.getString(when (state.archived) {
            true -> R.string.info_unarchive
            true -> R.string.info_unarchive
@@ -142,12 +137,6 @@ class ConversationInfoController(


    override fun showNameDialog(name: String) = nameDialog.setText(name).show()
    override fun showNameDialog(name: String) = nameDialog.setText(name).show()


    override fun showThemePicker(threadId: Long) {
        router.pushController(RouterTransaction.with(ThemePickerController(threadId))
                .pushChangeHandler(QkChangeHandler())
                .popChangeHandler(QkChangeHandler()))
    }

    override fun showBlockingDialog(conversations: List<Long>, block: Boolean) {
    override fun showBlockingDialog(conversations: List<Long>, block: Boolean) {
        blockingDialog.show(activity!!, conversations, block)
        blockingDialog.show(activity!!, conversations, block)
    }
    }
+0 −4
Original line number Original line Diff line number Diff line
@@ -141,10 +141,6 @@ class ConversationInfoPresenter @Inject constructor(
                .subscribe { conversation -> navigator.showNotificationSettings(conversation.id) }
                .subscribe { conversation -> navigator.showNotificationSettings(conversation.id) }


        // Show the theme settings for the conversation
        // Show the theme settings for the conversation
        view.themeClicks()
                .withLatestFrom(conversation) { _, conversation -> conversation }
                .autoDisposable(view.scope())
                .subscribe { conversation -> view.showThemePicker(conversation.id) }


        // Toggle the archived state of the conversation
        // Toggle the archived state of the conversation
        view.archiveClicks()
        view.archiveClicks()
+0 −2
Original line number Original line Diff line number Diff line
@@ -27,14 +27,12 @@ interface ConversationInfoView : QkViewContract<ConversationInfoState> {
    fun nameClicks(): Observable<*>
    fun nameClicks(): Observable<*>
    fun nameChanges(): Observable<String>
    fun nameChanges(): Observable<String>
    fun notificationClicks(): Observable<*>
    fun notificationClicks(): Observable<*>
    fun themeClicks(): Observable<*>
    fun archiveClicks(): Observable<*>
    fun archiveClicks(): Observable<*>
    fun blockClicks(): Observable<*>
    fun blockClicks(): Observable<*>
    fun deleteClicks(): Observable<*>
    fun deleteClicks(): Observable<*>
    fun confirmDelete(): Observable<*>
    fun confirmDelete(): Observable<*>


    fun showNameDialog(name: String)
    fun showNameDialog(name: String)
    fun showThemePicker(threadId: Long)
    fun showBlockingDialog(conversations: List<Long>, block: Boolean)
    fun showBlockingDialog(conversations: List<Long>, block: Boolean)
    fun requestDefaultSms()
    fun requestDefaultSms()
    fun showDeleteDialog()
    fun showDeleteDialog()
+0 −9
Original line number Original line Diff line number Diff line
@@ -43,7 +43,6 @@ import com.moez.QKSMS.common.widget.FieldDialog
import com.moez.QKSMS.common.widget.PreferenceView
import com.moez.QKSMS.common.widget.PreferenceView
import com.moez.QKSMS.feature.settings.about.AboutController
import com.moez.QKSMS.feature.settings.about.AboutController
import com.moez.QKSMS.feature.settings.swipe.SwipeActionsController
import com.moez.QKSMS.feature.settings.swipe.SwipeActionsController
import com.moez.QKSMS.feature.themepicker.ThemePickerController
import com.moez.QKSMS.injection.appComponent
import com.moez.QKSMS.injection.appComponent
import com.moez.QKSMS.repository.SyncRepository
import com.moez.QKSMS.repository.SyncRepository
import com.moez.QKSMS.util.Preferences
import com.moez.QKSMS.util.Preferences
@@ -55,7 +54,6 @@ import io.reactivex.subjects.Subject
import kotlinx.android.synthetic.main.settings_controller.*
import kotlinx.android.synthetic.main.settings_controller.*
import kotlinx.android.synthetic.main.settings_controller.view.*
import kotlinx.android.synthetic.main.settings_controller.view.*
import kotlinx.android.synthetic.main.settings_switch_widget.view.*
import kotlinx.android.synthetic.main.settings_switch_widget.view.*
import kotlinx.android.synthetic.main.settings_theme_widget.*
import javax.inject.Inject
import javax.inject.Inject


class SettingsController : QkController<SettingsView, SettingsState, SettingsPresenter>(), SettingsView {
class SettingsController : QkController<SettingsView, SettingsState, SettingsPresenter>(), SettingsView {
@@ -137,7 +135,6 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
    override fun mmsSizeSelected(): Observable<Int> = mmsSizeDialog.adapter.menuItemClicks
    override fun mmsSizeSelected(): Observable<Int> = mmsSizeDialog.adapter.menuItemClicks


    override fun render(state: SettingsState) {
    override fun render(state: SettingsState) {
        themePreview.setBackgroundTint(state.theme)
        night.summary = state.nightModeSummary
        night.summary = state.nightModeSummary
        nightModeDialog.adapter.selectedItem = state.nightModeId
        nightModeDialog.adapter.selectedItem = state.nightModeId
        nightStart.setVisible(state.nightModeId == Preferences.NIGHT_MODE_AUTO)
        nightStart.setVisible(state.nightModeId == Preferences.NIGHT_MODE_AUTO)
@@ -221,12 +218,6 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
                .popChangeHandler(QkChangeHandler()))
                .popChangeHandler(QkChangeHandler()))
    }
    }


    override fun showThemePicker() {
        router.pushController(RouterTransaction.with(ThemePickerController())
                .pushChangeHandler(QkChangeHandler())
                .popChangeHandler(QkChangeHandler()))
    }

    override fun showAbout() {
    override fun showAbout() {
        router.pushController(RouterTransaction.with(AboutController())
        router.pushController(RouterTransaction.with(AboutController())
                .pushChangeHandler(QkChangeHandler())
                .pushChangeHandler(QkChangeHandler())
+0 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,6 @@ class SettingsPresenter @Inject constructor(
                    Timber.v("Preference click: ${context.resources.getResourceName(it.id)}")
                    Timber.v("Preference click: ${context.resources.getResourceName(it.id)}")


                    when (it.id) {
                    when (it.id) {
                        R.id.theme -> view.showThemePicker()


                        R.id.night -> view.showNightModeDialog()
                        R.id.night -> view.showNightModeDialog()


Loading