mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:21:49 +01:00
Set orientation icon correctly when opening reader
This commit is contained in:
parent
a906e9b302
commit
edeee54fb2
@ -422,8 +422,6 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
|
|
||||||
presenter.setMangaOrientationType(newOrientation.flagValue)
|
presenter.setMangaOrientationType(newOrientation.flagValue)
|
||||||
|
|
||||||
updateOrientationShortcut(newOrientation.flagValue)
|
|
||||||
|
|
||||||
menuToggleToast?.cancel()
|
menuToggleToast?.cancel()
|
||||||
menuToggleToast = toast(newOrientation.stringRes)
|
menuToggleToast = toast(newOrientation.stringRes)
|
||||||
}
|
}
|
||||||
@ -792,6 +790,7 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
if (newOrientation.flag != requestedOrientation) {
|
if (newOrientation.flag != requestedOrientation) {
|
||||||
requestedOrientation = newOrientation.flag
|
requestedOrientation = newOrientation.flag
|
||||||
}
|
}
|
||||||
|
updateOrientationShortcut(presenter.getMangaOrientationType(resolveDefault = false))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -527,10 +527,11 @@ class ReaderPresenter(
|
|||||||
/**
|
/**
|
||||||
* Returns the orientation type used by this manga or the default one.
|
* Returns the orientation type used by this manga or the default one.
|
||||||
*/
|
*/
|
||||||
fun getMangaOrientationType(): Int {
|
fun getMangaOrientationType(resolveDefault: Boolean = true): Int {
|
||||||
val default = preferences.defaultOrientationType()
|
val default = preferences.defaultOrientationType()
|
||||||
return when (manga?.orientationType) {
|
val orientation = OrientationType.fromPreference(manga?.orientationType)
|
||||||
OrientationType.DEFAULT.flagValue -> default
|
return when {
|
||||||
|
resolveDefault && orientation == OrientationType.DEFAULT -> default
|
||||||
else -> manga?.orientationType ?: default
|
else -> manga?.orientationType ?: default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user