mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 19:31:49 +01:00
Fixes for older versions of android
This commit is contained in:
parent
dd25736fb9
commit
1f6230c5a3
@ -139,8 +139,9 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||||||
val container: ViewGroup = findViewById(R.id.reader_container)
|
val container: ViewGroup = findViewById(R.id.reader_container)
|
||||||
val readerBHeight = reader_menu_bottom.layoutParams.height
|
val readerBHeight = reader_menu_bottom.layoutParams.height
|
||||||
container.doOnApplyWindowInsets { _, insets, padding ->
|
container.doOnApplyWindowInsets { _, insets, padding ->
|
||||||
val bottomInset = insets.mandatorySystemGestureInsets.bottom - insets
|
val bottomInset = if (Build.VERSION.SDK_INT >= 29)
|
||||||
.systemWindowInsetBottom
|
(insets.mandatorySystemGestureInsets.bottom - insets.systemWindowInsetBottom)
|
||||||
|
else 0
|
||||||
reader_menu_bottom.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
reader_menu_bottom.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
height = readerBHeight + bottomInset
|
height = readerBHeight + bottomInset
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia
|
|||||||
viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false)
|
viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false)
|
||||||
|
|
||||||
rotation_mode.bindToPreference(preferences.rotation(), 1)
|
rotation_mode.bindToPreference(preferences.rotation(), 1)
|
||||||
background_color.bindToPreference(preferences.readerTheme())
|
background_color.bindToPreference(preferences.readerTheme(), 0, true)
|
||||||
show_page_number.bindToPreference(preferences.showPageNumber())
|
show_page_number.bindToPreference(preferences.showPageNumber())
|
||||||
fullscreen.bindToPreference(preferences.fullscreen())
|
fullscreen.bindToPreference(preferences.fullscreen())
|
||||||
keepscreen.bindToPreference(preferences.keepScreenOn())
|
keepscreen.bindToPreference(preferences.keepScreenOn())
|
||||||
@ -95,9 +95,13 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia
|
|||||||
/**
|
/**
|
||||||
* Binds a spinner to an int preference with an optional offset for the value.
|
* Binds a spinner to an int preference with an optional offset for the value.
|
||||||
*/
|
*/
|
||||||
private fun Spinner.bindToPreference(pref: Preference<Int>, offset: Int = 0) {
|
private fun Spinner.bindToPreference(pref: Preference<Int>, offset: Int = 0, shouldDismiss:
|
||||||
|
Boolean
|
||||||
|
= false) {
|
||||||
onItemSelectedListener = IgnoreFirstSpinnerListener { position ->
|
onItemSelectedListener = IgnoreFirstSpinnerListener { position ->
|
||||||
pref.set(position + offset)
|
pref.set(position + offset)
|
||||||
|
if (shouldDismiss)
|
||||||
|
dismiss()
|
||||||
}
|
}
|
||||||
setSelection(pref.getOrDefault() - offset, false)
|
setSelection(pref.getOrDefault() - offset, false)
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import android.graphics.BitmapFactory
|
|||||||
import android.graphics.PointF
|
import android.graphics.PointF
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
import android.view.GestureDetector
|
import android.view.GestureDetector
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
@ -347,6 +348,7 @@ class PagerPageHolder(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
addView(subsamplingImageView)
|
addView(subsamplingImageView)
|
||||||
|
if (Build.VERSION.SDK_INT >= 29)
|
||||||
subsamplingImageView?.isForceDarkAllowed = false
|
subsamplingImageView?.isForceDarkAllowed = false
|
||||||
return subsamplingImageView!!
|
return subsamplingImageView!!
|
||||||
}
|
}
|
||||||
|
6
app/src/main/res/values-night/colors.xml
Normal file
6
app/src/main/res/values-night/colors.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="drawerHighlight">@color/md_grey_800</color>
|
||||||
|
<color name="drawerPrimary">@color/colorAccentDark</color>
|
||||||
|
<color name="oldNavBarBackground">#B3000000</color>
|
||||||
|
</resources>
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Custom Attributes-->
|
<!-- Custom Attributes-->
|
||||||
<item name="navigation_view_theme">@style/Theme.Widget.NavigationView.Dark</item>
|
<item name="navigation_view_theme">@style/Theme.Widget.NavigationView</item>
|
||||||
<item name="selectable_list_drawable">@drawable/list_item_selector_dark</item>
|
<item name="selectable_list_drawable">@drawable/list_item_selector_dark</item>
|
||||||
<item name="selectable_library_drawable">@drawable/library_item_selector_dark</item>
|
<item name="selectable_library_drawable">@drawable/library_item_selector_dark</item>
|
||||||
<item name="text_color_primary">@color/textColorPrimaryDark</item>
|
<item name="text_color_primary">@color/textColorPrimaryDark</item>
|
||||||
@ -33,13 +33,13 @@
|
|||||||
<item name="icon_color">@color/iconColorDark</item>
|
<item name="icon_color">@color/iconColorDark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Base.Reader.Light" parent="Theme.Base">
|
<style name="Theme.Base.Reader.Light" parent="Theme.Tachiyomi">
|
||||||
<item name="colorPrimary">@color/colorDarkPrimary</item>
|
<item name="colorPrimary">@color/colorDarkPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorDarkPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorDarkPrimaryDark</item>
|
||||||
<item name="android:colorBackground">@color/backgroundDark</item>
|
<item name="android:colorBackground">@color/backgroundDark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Tachiyomi.DarkBlue" parent="Theme.Base">
|
<style name="Theme.Tachiyomi.DarkBlue" parent="Theme.Tachiyomi">
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
</style>
|
</style>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<!--==============-->
|
<!--==============-->
|
||||||
<!-- Amoled Theme -->
|
<!-- Amoled Theme -->
|
||||||
<!--==============-->
|
<!--==============-->
|
||||||
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base">
|
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Tachiyomi">
|
||||||
<item name="colorPrimary">@color/colorAmoledPrimary</item>
|
<item name="colorPrimary">@color/colorAmoledPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorAmoledPrimary</item>
|
<item name="colorPrimaryDark">@color/colorAmoledPrimary</item>
|
||||||
<item name="android:colorBackground">@color/md_black_1000</item>
|
<item name="android:colorBackground">@color/md_black_1000</item>
|
||||||
|
@ -7,26 +7,7 @@
|
|||||||
<!-- Attributes specific for SDK 21 and up -->
|
<!-- Attributes specific for SDK 21 and up -->
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
<item name="android:navigationBarColor">@color/colorPrimary</item>
|
<item name="android:navigationBarColor">@color/oldNavBarBackground</item>
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Theme.Tachiyomi.DarkBlue" parent="Theme.Base">
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
|
|
||||||
<!-- Attributes specific for SDK 21 and up -->
|
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:navigationBarColor">@color/colorDarkPrimaryDark</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!--==============-->
|
|
||||||
<!-- Amoled Theme -->
|
|
||||||
<!--==============-->
|
|
||||||
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base">
|
|
||||||
<!-- Attributes specific for SDK 21 and up -->
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!--==============-->
|
<!--==============-->
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="Base.Theme.AppCompat" parent="@style/Base.V26.Theme.AppCompat" />
|
<!--<style name="Base.Theme.AppCompat" parent="@style/Base.V26.Theme.AppCompat" />
|
||||||
<style name="Base.Theme.AppCompat.Light" parent="@style/Base.V26.Theme.AppCompat.Light" />
|
<style name="Base.Theme.AppCompat.Light" parent="@style/Base.V26.Theme.AppCompat.Light" />
|
||||||
<style name="Base.Widget.AppCompat.Toolbar" parent="@style/Base.V26.Widget.AppCompat.Toolbar" />
|
<style name="Base.Widget.AppCompat.Toolbar" parent="@style/Base.V26.Widget.AppCompat.Toolbar" />
|
||||||
<style name="Base.V26.Theme.AppCompat" parent="@style/Base.V23.Theme.AppCompat">
|
<style name="Base.V26.Theme.AppCompat" parent="@style/Base.V23.Theme.AppCompat">
|
||||||
@ -15,5 +15,5 @@
|
|||||||
<item name="android:touchscreenBlocksFocus">true</item>
|
<item name="android:touchscreenBlocksFocus">true</item>
|
||||||
<item name="android:keyboardNavigationCluster">true</item>
|
<item name="android:keyboardNavigationCluster">true</item>
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||||
</style>
|
</style> -->
|
||||||
</resources>
|
</resources>
|
@ -6,19 +6,4 @@
|
|||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Tachiyomi.DarkBlue" parent="Theme.Base">
|
|
||||||
<!-- Attributes specific for SDK 21 and up -->
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!--==============-->
|
|
||||||
<!-- Amoled Theme -->
|
|
||||||
<!--==============-->
|
|
||||||
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base">
|
|
||||||
<!-- Attributes specific for SDK 21 and up -->
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
</resources>
|
@ -3,6 +3,8 @@
|
|||||||
<!-- Application Colors -->
|
<!-- Application Colors -->
|
||||||
<color name="colorPrimary">#54759E</color>
|
<color name="colorPrimary">#54759E</color>
|
||||||
<color name="colorPrimaryDark">#54759E</color>
|
<color name="colorPrimaryDark">#54759E</color>
|
||||||
|
<color name="drawerHighlight">@color/md_black_1000_12</color>
|
||||||
|
<color name="drawerPrimary">@color/colorPrimary</color>
|
||||||
<!-- Dark Application Colors -->
|
<!-- Dark Application Colors -->
|
||||||
<color name="colorDarkPrimary">#212121</color>
|
<color name="colorDarkPrimary">#212121</color>
|
||||||
<color name="colorDarkPrimaryDark">#212121</color>
|
<color name="colorDarkPrimaryDark">#212121</color>
|
||||||
@ -15,6 +17,7 @@
|
|||||||
<color name="textColorHintLight">@color/md_black_1000_38</color>
|
<color name="textColorHintLight">@color/md_black_1000_38</color>
|
||||||
<color name="dividerLight">@color/md_black_1000_12</color>
|
<color name="dividerLight">@color/md_black_1000_12</color>
|
||||||
<color name="rippleColorLight">@color/md_black_1000_12</color>
|
<color name="rippleColorLight">@color/md_black_1000_12</color>
|
||||||
|
<color name="oldNavBarBackground">#B3FFFFFF</color>
|
||||||
|
|
||||||
<color name="preference_fallback_accent_color">@color/colorAccentLight</color>
|
<color name="preference_fallback_accent_color">@color/colorAccentLight</color>
|
||||||
|
|
||||||
|
@ -35,13 +35,12 @@
|
|||||||
<!--==============-->
|
<!--==============-->
|
||||||
<!--NavigationView-->
|
<!--NavigationView-->
|
||||||
<!--==============-->
|
<!--==============-->
|
||||||
<style name="Theme.Widget.NavigationView" />
|
<style name="Theme.Widget.NavigationView">
|
||||||
|
<item name="colorControlHighlight">@color/drawerHighlight</item>
|
||||||
<style name="Theme.Widget.NavigationView.Dark">
|
<item name="colorPrimary">@color/drawerPrimary</item>
|
||||||
<item name="colorControlHighlight">@color/md_grey_900</item>
|
|
||||||
<item name="colorPrimary">?colorAccent</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<!--===============-->
|
<!--===============-->
|
||||||
<!--Text Appearance-->
|
<!--Text Appearance-->
|
||||||
<!--===============-->
|
<!--===============-->
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Custom Attributes-->
|
<!-- Custom Attributes-->
|
||||||
|
<item name="navigation_view_theme">@style/Theme.Widget.NavigationView</item>
|
||||||
<item name="selectable_list_drawable">@drawable/list_item_selector_light</item>
|
<item name="selectable_list_drawable">@drawable/list_item_selector_light</item>
|
||||||
<item name="selectable_library_drawable">@drawable/library_item_selector_light</item>
|
<item name="selectable_library_drawable">@drawable/library_item_selector_light</item>
|
||||||
<item name="text_color_primary">@color/textColorPrimaryLight</item>
|
<item name="text_color_primary">@color/textColorPrimaryLight</item>
|
||||||
@ -39,10 +40,9 @@
|
|||||||
<item name="icon_color">@color/iconColorLight</item>
|
<item name="icon_color">@color/iconColorLight</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Tachiyomi" parent="Theme.Base">
|
<style name="Theme.Tachiyomi" parent="Theme.Base"/>
|
||||||
<!-- Attributes specific for SDK 16 to SDK 20 -->
|
<style name="Theme.Tachiyomi.DarkBlue" parent="Theme.Tachiyomi"/>
|
||||||
</style>
|
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Tachiyomi"/>
|
||||||
|
|
||||||
<!--==============-->
|
<!--==============-->
|
||||||
<!-- Reader Theme -->
|
<!-- Reader Theme -->
|
||||||
<!--==============-->
|
<!--==============-->
|
||||||
|
Loading…
Reference in New Issue
Block a user