Fix toolbar being expanded when opening preference dialogs

This commit is contained in:
arkon 2020-08-04 08:56:30 -04:00
parent 885552b792
commit 885ace111e
2 changed files with 6 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import android.view.ViewGroup
import android.widget.Toast
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.isVisible
import androidx.preference.PreferenceDialogController
import com.bluelinelabs.conductor.Conductor
import com.bluelinelabs.conductor.Controller
import com.bluelinelabs.conductor.ControllerChangeHandler
@ -317,6 +318,9 @@ class MainActivity : BaseActivity<MainActivityBinding>() {
if (from is DialogController || to is DialogController) {
return
}
if (from is PreferenceDialogController || to is PreferenceDialogController) {
return
}
supportActionBar?.setDisplayHomeAsUpEnabled(router.backstackSize != 1)

View file

@ -11,6 +11,8 @@ import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.anilist.AnilistApi
import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi
import eu.kanade.tachiyomi.data.track.shikimori.ShikimoriApi
import eu.kanade.tachiyomi.ui.setting.track.TrackLoginDialog
import eu.kanade.tachiyomi.ui.setting.track.TrackLogoutDialog
import eu.kanade.tachiyomi.util.preference.defaultValue
import eu.kanade.tachiyomi.util.preference.infoPreference
import eu.kanade.tachiyomi.util.preference.initThenAdd
@ -20,8 +22,6 @@ import eu.kanade.tachiyomi.util.preference.switchPreference
import eu.kanade.tachiyomi.util.preference.titleRes
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.widget.preference.LoginPreference
import eu.kanade.tachiyomi.ui.setting.track.TrackLoginDialog
import eu.kanade.tachiyomi.ui.setting.track.TrackLogoutDialog
import uy.kohesive.injekt.injectLazy
class SettingsTrackingController :