mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 12:38:58 +01:00
Remove legacy settings sheet
The per-series settings aren't quite functional yet, but they're also accessible outside of the sheet.
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
package eu.kanade.tachiyomi.util.preference
|
||||
|
||||
import android.widget.CompoundButton
|
||||
import tachiyomi.core.preference.Preference
|
||||
|
||||
/**
|
||||
* Binds a checkbox or switch view with a boolean preference.
|
||||
*/
|
||||
fun CompoundButton.bindToPreference(pref: Preference<Boolean>) {
|
||||
isChecked = pref.get()
|
||||
setOnCheckedChangeListener { _, isChecked -> pref.set(isChecked) }
|
||||
}
|
||||
|
||||
operator fun <T> Preference<Set<T>>.plusAssign(item: T) {
|
||||
set(get() + item)
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@file:Suppress("PackageDirectoryMismatch")
|
||||
|
||||
package com.google.android.material.bottomsheet
|
||||
|
||||
import android.view.View
|
||||
|
||||
/**
|
||||
* Returns package-private elevation value
|
||||
*/
|
||||
fun <T : View> BottomSheetBehavior<T>.getElevation(): Float {
|
||||
return elevation.takeIf { it >= 0F } ?: 0F
|
||||
}
|
||||
@@ -1,30 +1,7 @@
|
||||
package eu.kanade.tachiyomi.util.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import com.google.android.material.elevation.ElevationOverlayProvider
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.system.isNavigationBarNeedsScrim
|
||||
|
||||
/**
|
||||
* Sets navigation bar color to transparent if system's config_navBarNeedsScrim is false,
|
||||
* otherwise it will use the theme navigationBarColor with 70% opacity.
|
||||
*
|
||||
* @see isNavigationBarNeedsScrim
|
||||
*/
|
||||
fun Window.setNavigationBarTransparentCompat(context: Context, elevation: Float = 0F) {
|
||||
navigationBarColor = if (context.isNavigationBarNeedsScrim()) {
|
||||
// Set navbar scrim 70% of navigationBarColor
|
||||
ElevationOverlayProvider(context).compositeOverlayIfNeeded(
|
||||
context.getResourceColor(android.R.attr.navigationBarColor, 0.7F),
|
||||
elevation,
|
||||
)
|
||||
} else {
|
||||
Color.TRANSPARENT
|
||||
}
|
||||
}
|
||||
|
||||
fun Window.setSecureScreen(enabled: Boolean) {
|
||||
if (enabled) {
|
||||
|
||||
Reference in New Issue
Block a user