mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Added tabletUI option: "Automatic" (#6208)
* added automatic tablet ui option; useful for foldables * set automatic as default, rename setting * remove redundant checks Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> * remove redundant checks Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> * fix defaultValue Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
This commit is contained in:
@@ -316,6 +316,7 @@ fun Context.isTablet(): Boolean {
|
||||
fun Context.prepareTabletUiContext(): Context {
|
||||
val configuration = resources.configuration
|
||||
val expected = when (Injekt.get<PreferencesHelper>().tabletUiMode().get()) {
|
||||
PreferenceValues.TabletUiMode.AUTOMATIC -> isTablet()
|
||||
PreferenceValues.TabletUiMode.ALWAYS -> true
|
||||
PreferenceValues.TabletUiMode.LANDSCAPE -> configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
|
||||
PreferenceValues.TabletUiMode.NEVER -> false
|
||||
|
||||
Reference in New Issue
Block a user