mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Targeting SDK 34 (Android 14)
Its a much easier target than 13, first time ive gotten to change compile and target at the same time Also updating a bunch of libraries while i'm at it One of them is material and using it have back button progress on bottom sheet for now
This commit is contained in:
parent
211068d79a
commit
19db2ebee5
16 changed files with 242 additions and 79 deletions
|
@ -127,18 +127,18 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Compose
|
// Compose
|
||||||
implementation("androidx.activity:activity-compose:1.6.1")
|
implementation("androidx.activity:activity-compose:1.7.2")
|
||||||
implementation("androidx.compose.foundation:foundation:1.3.1")
|
implementation("androidx.compose.foundation:foundation:1.4.3")
|
||||||
implementation("androidx.compose.animation:animation:1.3.3")
|
implementation("androidx.compose.animation:animation:1.4.3")
|
||||||
implementation("androidx.compose.ui:ui:1.3.3")
|
implementation("androidx.compose.ui:ui:1.4.3")
|
||||||
implementation("androidx.compose.material:material:1.3.1")
|
implementation("androidx.compose.material:material:1.4.3")
|
||||||
implementation("androidx.compose.material3:material3:1.0.1")
|
implementation("androidx.compose.material3:material3:1.1.1")
|
||||||
implementation("com.google.android.material:compose-theme-adapter-3:1.1.1")
|
implementation("com.google.android.material:compose-theme-adapter-3:1.1.1")
|
||||||
implementation("androidx.compose.material:material-icons-extended:1.3.1")
|
implementation("androidx.compose.material:material-icons-extended:1.4.3")
|
||||||
implementation("androidx.compose.ui:ui-tooling-preview:1.3.3")
|
implementation("androidx.compose.ui:ui-tooling-preview:1.4.3")
|
||||||
debugImplementation("androidx.compose.ui:ui-tooling:1.3.3")
|
debugImplementation("androidx.compose.ui:ui-tooling:1.4.3")
|
||||||
implementation("com.google.accompanist:accompanist-webview:0.28.0")
|
implementation("com.google.accompanist:accompanist-webview:0.28.0")
|
||||||
implementation("androidx.glance:glance-appwidget:1.0.0-alpha03")
|
implementation("androidx.glance:glance-appwidget:1.0.0-rc01")
|
||||||
|
|
||||||
// Modified dependencies
|
// Modified dependencies
|
||||||
implementation("com.github.jays2kings:subsampling-scale-image-view:756849e") {
|
implementation("com.github.jays2kings:subsampling-scale-image-view:756849e") {
|
||||||
|
@ -149,18 +149,18 @@ dependencies {
|
||||||
// Android X libraries
|
// Android X libraries
|
||||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||||
implementation("androidx.cardview:cardview:1.0.0")
|
implementation("androidx.cardview:cardview:1.0.0")
|
||||||
implementation("com.google.android.material:material:1.8.0")
|
implementation("com.google.android.material:material:1.10.0-alpha05")
|
||||||
implementation("androidx.webkit:webkit:1.6.1")
|
implementation("androidx.webkit:webkit:1.7.0")
|
||||||
implementation("androidx.recyclerview:recyclerview:1.3.0")
|
implementation("androidx.recyclerview:recyclerview:1.3.1")
|
||||||
implementation("androidx.preference:preference:1.2.0")
|
implementation("androidx.preference:preference:1.2.1")
|
||||||
implementation("androidx.annotation:annotation:1.6.0")
|
implementation("androidx.annotation:annotation:1.6.0")
|
||||||
implementation("androidx.browser:browser:1.5.0")
|
implementation("androidx.browser:browser:1.5.0")
|
||||||
implementation("androidx.biometric:biometric:1.1.0")
|
implementation("androidx.biometric:biometric:1.1.0")
|
||||||
implementation("androidx.palette:palette:1.0.0")
|
implementation("androidx.palette:palette:1.0.0")
|
||||||
implementation("androidx.activity:activity-ktx:1.7.0")
|
implementation("androidx.activity:activity-ktx:1.8.0-alpha06")
|
||||||
implementation("androidx.core:core-ktx:1.10.0")
|
implementation("androidx.core:core-ktx:1.10.1")
|
||||||
implementation("com.google.android.flexbox:flexbox:3.0.0")
|
implementation("com.google.android.flexbox:flexbox:3.0.0")
|
||||||
implementation("androidx.window:window:1.0.0")
|
implementation("androidx.window:window:1.1.0")
|
||||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
||||||
|
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package eu.kanade.tachiyomi.appwidget
|
package eu.kanade.tachiyomi.appwidget
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.core.graphics.drawable.toBitmap
|
import androidx.core.graphics.drawable.toBitmap
|
||||||
|
import androidx.glance.GlanceId
|
||||||
import androidx.glance.GlanceModifier
|
import androidx.glance.GlanceModifier
|
||||||
import androidx.glance.ImageProvider
|
import androidx.glance.ImageProvider
|
||||||
import androidx.glance.appwidget.GlanceAppWidget
|
import androidx.glance.appwidget.GlanceAppWidget
|
||||||
import androidx.glance.appwidget.GlanceAppWidgetManager
|
import androidx.glance.appwidget.GlanceAppWidgetManager
|
||||||
import androidx.glance.appwidget.SizeMode
|
import androidx.glance.appwidget.SizeMode
|
||||||
import androidx.glance.appwidget.appWidgetBackground
|
import androidx.glance.appwidget.appWidgetBackground
|
||||||
|
import androidx.glance.appwidget.provideContent
|
||||||
import androidx.glance.appwidget.updateAll
|
import androidx.glance.appwidget.updateAll
|
||||||
import androidx.glance.background
|
import androidx.glance.background
|
||||||
import androidx.glance.layout.fillMaxSize
|
import androidx.glance.layout.fillMaxSize
|
||||||
|
@ -47,16 +49,16 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() {
|
||||||
private var data: List<Pair<Long, Bitmap?>>? = null
|
private var data: List<Pair<Long, Bitmap?>>? = null
|
||||||
|
|
||||||
override val sizeMode = SizeMode.Exact
|
override val sizeMode = SizeMode.Exact
|
||||||
|
override suspend fun provideGlance(context: Context, id: GlanceId) {
|
||||||
@Composable
|
provideContent {
|
||||||
override fun Content() {
|
|
||||||
// If app lock enabled, don't do anything
|
// If app lock enabled, don't do anything
|
||||||
if (preferences.useBiometrics().get()) {
|
if (preferences.useBiometrics().get()) {
|
||||||
LockedWidget()
|
LockedWidget()
|
||||||
return
|
} else {
|
||||||
}
|
|
||||||
UpdatesWidget(data)
|
UpdatesWidget(data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun loadData(list: List<Pair<Manga, Long>>? = null) {
|
fun loadData(list: List<Pair<Manga, Long>>? = null) {
|
||||||
coroutineScope.launchIO {
|
coroutineScope.launchIO {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.activity.BackEventCompat
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.forEach
|
import androidx.core.view.forEach
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
|
@ -94,6 +95,12 @@ abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) :
|
||||||
|
|
||||||
open fun canStillGoBack(): Boolean { return false }
|
open fun canStillGoBack(): Boolean { return false }
|
||||||
|
|
||||||
|
open fun handleOnBackStarted(backEvent: BackEventCompat) {}
|
||||||
|
|
||||||
|
open fun handleOnBackProgressed(backEvent: BackEventCompat) {}
|
||||||
|
|
||||||
|
open fun handleOnBackCancelled() {}
|
||||||
|
|
||||||
open val mainRecycler: RecyclerView?
|
open val mainRecycler: RecyclerView?
|
||||||
get() = null
|
get() = null
|
||||||
|
|
||||||
|
|
|
@ -371,16 +371,21 @@ class ExtensionBottomSheet @JvmOverloads constructor(context: Context, attrs: At
|
||||||
updateExtUpdateAllButton()
|
updateExtUpdateAllButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun canStillGoBack(): Boolean {
|
||||||
|
return (binding.tabs.selectedTabPosition == 1 && migAdapter is MangaAdapter) ||
|
||||||
|
(binding.tabs.selectedTabPosition == 0 && binding.sheetToolbar.hasExpandedActionView())
|
||||||
|
}
|
||||||
|
|
||||||
fun canGoBack(): Boolean {
|
fun canGoBack(): Boolean {
|
||||||
if (binding.tabs.selectedTabPosition == 1 && migAdapter is MangaAdapter) {
|
return if (binding.tabs.selectedTabPosition == 1 && migAdapter is MangaAdapter) {
|
||||||
presenter.deselectSource()
|
presenter.deselectSource()
|
||||||
return false
|
false
|
||||||
}
|
} else if (binding.sheetToolbar.hasExpandedActionView()) {
|
||||||
if (binding.sheetToolbar.hasExpandedActionView()) {
|
|
||||||
binding.sheetToolbar.collapseActionView()
|
binding.sheetToolbar.collapseActionView()
|
||||||
return false
|
false
|
||||||
|
} else {
|
||||||
|
true
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun downloadUpdate(item: ExtensionItem) {
|
fun downloadUpdate(item: ExtensionItem) {
|
||||||
|
|
|
@ -14,9 +14,13 @@ class LibraryCategoryGestureDetector(private val controller: LibraryController?)
|
||||||
var locked = false
|
var locked = false
|
||||||
var cancelled = false
|
var cancelled = false
|
||||||
private val poa = 1.7f
|
private val poa = 1.7f
|
||||||
|
private var startingX = 0f
|
||||||
|
private var startingY = 0f
|
||||||
|
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
locked = false
|
locked = false
|
||||||
|
startingX = e.x
|
||||||
|
startingY = e.y
|
||||||
controller ?: return false
|
controller ?: return false
|
||||||
val startingOnLibraryView = listOf(
|
val startingOnLibraryView = listOf(
|
||||||
controller.activityBinding?.bottomNav,
|
controller.activityBinding?.bottomNav,
|
||||||
|
@ -35,14 +39,14 @@ class LibraryCategoryGestureDetector(private val controller: LibraryController?)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onScroll(
|
override fun onScroll(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
distanceX: Float,
|
distanceX: Float,
|
||||||
distanceY: Float,
|
distanceY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val controller = controller ?: return false
|
val controller = controller ?: return false
|
||||||
val distance = e1.rawX - e2.rawX
|
val distance = startingX - e2.x
|
||||||
val totalDistanceY = e1.rawY - e2.rawY
|
val totalDistanceY = startingY - e2.y
|
||||||
controller.binding.libraryGridRecycler.recycler.translationX =
|
controller.binding.libraryGridRecycler.recycler.translationX =
|
||||||
if (!cancelled) abs(distance / 50).pow(poa) * -sign(distance / 50) else 0f
|
if (!cancelled) abs(distance / 50).pow(poa) * -sign(distance / 50) else 0f
|
||||||
if (!locked && abs(distance) > 50 && !cancelled) {
|
if (!locked && abs(distance) > 50 && !cancelled) {
|
||||||
|
@ -59,7 +63,7 @@ class LibraryCategoryGestureDetector(private val controller: LibraryController?)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
|
@ -72,8 +76,8 @@ class LibraryCategoryGestureDetector(private val controller: LibraryController?)
|
||||||
cancelled = false
|
cancelled = false
|
||||||
val controller = controller ?: return false
|
val controller = controller ?: return false
|
||||||
var result = false
|
var result = false
|
||||||
val diffY = e2.y - e1.y
|
val diffY = e2.y - startingY
|
||||||
val diffX = e2.x - e1.x
|
val diffX = e2.x - startingX
|
||||||
val recycler = controller.binding.libraryGridRecycler.recycler
|
val recycler = controller.binding.libraryGridRecycler.recycler
|
||||||
var moved = false
|
var moved = false
|
||||||
if (abs(diffX) >= abs(diffY) &&
|
if (abs(diffX) >= abs(diffY) &&
|
||||||
|
|
|
@ -13,17 +13,22 @@ import kotlin.math.sign
|
||||||
|
|
||||||
class LibraryGestureDetector(private val controller: LibraryController) : GestureDetector
|
class LibraryGestureDetector(private val controller: LibraryController) : GestureDetector
|
||||||
.SimpleOnGestureListener() {
|
.SimpleOnGestureListener() {
|
||||||
|
|
||||||
|
private var startingX = 0f
|
||||||
|
private var startingY = 0f
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
|
startingX = e.x
|
||||||
|
startingY = e.y
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onScroll(
|
override fun onScroll(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
distanceX: Float,
|
distanceX: Float,
|
||||||
distanceY: Float,
|
distanceY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val distance = (e1.rawX - e2.rawX) / 50
|
val distance = (startingX - e2.x) / 50
|
||||||
val poa = 1.7f
|
val poa = 1.7f
|
||||||
controller.binding.categoryHopperFrame.translationX = abs(distance).pow(poa) * -sign(distance)
|
controller.binding.categoryHopperFrame.translationX = abs(distance).pow(poa) * -sign(distance)
|
||||||
return super.onScroll(e1, e2, distanceX, distanceY)
|
return super.onScroll(e1, e2, distanceX, distanceY)
|
||||||
|
@ -31,14 +36,14 @@ class LibraryGestureDetector(private val controller: LibraryController) : Gestur
|
||||||
|
|
||||||
@SuppressLint("RtlHardcoded")
|
@SuppressLint("RtlHardcoded")
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
val diffY = e2.y - e1.y
|
val diffY = e2.y - startingY
|
||||||
val diffX = e2.x - e1.x
|
val diffX = e2.x - startingX
|
||||||
val hopperFrame = controller.binding.categoryHopperFrame
|
val hopperFrame = controller.binding.categoryHopperFrame
|
||||||
val animator = controller.binding.categoryHopperFrame.animate().setDuration(150L)
|
val animator = controller.binding.categoryHopperFrame.animate().setDuration(150L)
|
||||||
animator.translationX(0f)
|
animator.translationX(0f)
|
||||||
|
|
|
@ -17,20 +17,24 @@ class LibraryHeaderGestureDetector(
|
||||||
private val binding: LibraryCategoryHeaderItemBinding?,
|
private val binding: LibraryCategoryHeaderItemBinding?,
|
||||||
) : GestureDetector.SimpleOnGestureListener() {
|
) : GestureDetector.SimpleOnGestureListener() {
|
||||||
|
|
||||||
|
private var startingX = 0f
|
||||||
|
private var startingY = 0f
|
||||||
var vibrated = false
|
var vibrated = false
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
vibrated = false
|
vibrated = false
|
||||||
|
startingX = e.x
|
||||||
|
startingY = e.y
|
||||||
return super.onDown(e)
|
return super.onDown(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onScroll(
|
override fun onScroll(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
distanceX: Float,
|
distanceX: Float,
|
||||||
distanceY: Float,
|
distanceY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
if (binding == null || header == null) return false
|
if (binding == null || header == null) return false
|
||||||
val distance = (e1.rawX - e2.rawX)
|
val distance = (startingX - e2.x)
|
||||||
val poa = 0.75f
|
val poa = 0.75f
|
||||||
binding.categoryHeaderLayout.translationX = abs(distance).pow(poa) * -sign(distance)
|
binding.categoryHeaderLayout.translationX = abs(distance).pow(poa) * -sign(distance)
|
||||||
binding.rearView.isVisible = distance != 0f
|
binding.rearView.isVisible = distance != 0f
|
||||||
|
@ -58,14 +62,14 @@ class LibraryHeaderGestureDetector(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
val diffY = e2.y - e1.y
|
val diffY = e2.y - startingY
|
||||||
val diffX = e2.x - e1.x
|
val diffX = e2.x - startingX
|
||||||
val mainLayout = binding?.categoryHeaderLayout ?: return false
|
val mainLayout = binding?.categoryHeaderLayout ?: return false
|
||||||
val animator = binding.categoryHeaderLayout.animate().setDuration(200L)
|
val animator = binding.categoryHeaderLayout.animate().setDuration(200L)
|
||||||
header?.itemView?.parent?.requestDisallowInterceptTouchEvent(false)
|
header?.itemView?.parent?.requestDisallowInterceptTouchEvent(false)
|
||||||
|
|
|
@ -25,6 +25,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import androidx.activity.BackEventCompat
|
||||||
import androidx.activity.OnBackPressedCallback
|
import androidx.activity.OnBackPressedCallback
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
@ -249,8 +250,27 @@ open class MainActivity : BaseActivity<MainActivityBinding>() {
|
||||||
window.sharedElementsUseOverlay = false
|
window.sharedElementsUseOverlay = false
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
backPressedCallback = onBackPressedDispatcher.addCallback { backCallback() }
|
backPressedCallback = object : OnBackPressedCallback(enabled = true) {
|
||||||
|
override fun handleOnBackPressed() {
|
||||||
|
backCallback()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackStarted(backEvent: BackEventCompat) {
|
||||||
|
val controller = router.backstack.lastOrNull()?.controller as? BaseController<*>
|
||||||
|
controller?.handleOnBackStarted(backEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackProgressed(backEvent: BackEventCompat) {
|
||||||
|
val controller = router.backstack.lastOrNull()?.controller as? BaseController<*>
|
||||||
|
controller?.handleOnBackProgressed(backEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackCancelled() {
|
||||||
|
val controller = router.backstack.lastOrNull()?.controller as? BaseController<*>
|
||||||
|
controller?.handleOnBackCancelled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onBackPressedDispatcher.addCallback(backPressedCallback!!)
|
||||||
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
|
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
|
||||||
if (!isTaskRoot && this !is SearchActivity) {
|
if (!isTaskRoot && this !is SearchActivity) {
|
||||||
finish()
|
finish()
|
||||||
|
@ -1378,23 +1398,27 @@ open class MainActivity : BaseActivity<MainActivityBinding>() {
|
||||||
)
|
)
|
||||||
|
|
||||||
private inner class GestureListener : GestureDetector.SimpleOnGestureListener() {
|
private inner class GestureListener : GestureDetector.SimpleOnGestureListener() {
|
||||||
|
private var startingX = 0f
|
||||||
|
private var startingY = 0f
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
|
startingX = e.x
|
||||||
|
startingY = e.y
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
val diffY = e2.y - e1.y
|
val diffY = e2.y - startingY
|
||||||
val diffX = e2.x - e1.x
|
val diffX = e2.x - startingX
|
||||||
if (abs(diffX) <= abs(diffY)) {
|
if (abs(diffX) <= abs(diffY)) {
|
||||||
val sheetRect = Rect()
|
val sheetRect = Rect()
|
||||||
nav.getGlobalVisibleRect(sheetRect)
|
nav.getGlobalVisibleRect(sheetRect)
|
||||||
if (sheetRect.contains(e1.x.toInt(), e1.y.toInt()) &&
|
if (sheetRect.contains(startingX.toInt(), startingY.toInt()) &&
|
||||||
abs(diffY) > Companion.SWIPE_THRESHOLD &&
|
abs(diffY) > Companion.SWIPE_THRESHOLD &&
|
||||||
abs(velocityY) > Companion.SWIPE_VELOCITY_THRESHOLD &&
|
abs(velocityY) > Companion.SWIPE_VELOCITY_THRESHOLD &&
|
||||||
diffY <= 0
|
diffY <= 0
|
||||||
|
@ -1403,7 +1427,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>() {
|
||||||
router.backstack.lastOrNull()?.controller as? BottomSheetController
|
router.backstack.lastOrNull()?.controller as? BottomSheetController
|
||||||
bottomSheetController?.showSheet()
|
bottomSheetController?.showSheet()
|
||||||
} else if (nav == binding.sideNav &&
|
} else if (nav == binding.sideNav &&
|
||||||
sheetRect.contains(e1.x.toInt(), e1.y.toInt()) &&
|
sheetRect.contains(startingX.toInt(), startingY.toInt()) &&
|
||||||
abs(diffY) > Companion.SWIPE_THRESHOLD &&
|
abs(diffY) > Companion.SWIPE_THRESHOLD &&
|
||||||
abs(velocityY) > Companion.SWIPE_VELOCITY_THRESHOLD &&
|
abs(velocityY) > Companion.SWIPE_VELOCITY_THRESHOLD &&
|
||||||
diffY > 0
|
diffY > 0
|
||||||
|
|
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.reader
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.app.ActivityOptions
|
||||||
import android.app.assist.AssistContent
|
import android.app.assist.AssistContent
|
||||||
import android.content.ClipData
|
import android.content.ClipData
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
@ -38,7 +39,6 @@ import androidx.activity.OnBackPressedCallback
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
import androidx.core.app.ActivityOptionsCompat
|
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.text.buildSpannedString
|
import androidx.core.text.buildSpannedString
|
||||||
|
@ -260,7 +260,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
|
||||||
MainActivity.chapterIdToExitTo = 0L
|
MainActivity.chapterIdToExitTo = 0L
|
||||||
val intent = newIntent(activity, manga, chapter)
|
val intent = newIntent(activity, manga, chapter)
|
||||||
intent.putExtra(TRANSITION_NAME, sharedElement.transitionName)
|
intent.putExtra(TRANSITION_NAME, sharedElement.transitionName)
|
||||||
val activityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(
|
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||||
activity,
|
activity,
|
||||||
sharedElement,
|
sharedElement,
|
||||||
sharedElement.transitionName,
|
sharedElement.transitionName,
|
||||||
|
@ -933,7 +933,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
|
||||||
firstPass = false
|
firstPass = false
|
||||||
lastVis = vis
|
lastVis = vis
|
||||||
}
|
}
|
||||||
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
|
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
|
||||||
if (!fullscreen && sheetManageNavColor) {
|
if (!fullscreen && sheetManageNavColor) {
|
||||||
window.navigationBarColor = getResourceColor(R.attr.colorSurface)
|
window.navigationBarColor = getResourceColor(R.attr.colorSurface)
|
||||||
}
|
}
|
||||||
|
@ -1132,7 +1132,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
|
||||||
} else {
|
} else {
|
||||||
if (preferences.fullscreen().get()) {
|
if (preferences.fullscreen().get()) {
|
||||||
wic.hide(systemBars())
|
wic.hide(systemBars())
|
||||||
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
|
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
if (animate && binding.appBar.isVisible) {
|
if (animate && binding.appBar.isVisible) {
|
||||||
|
@ -1929,7 +1929,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
|
||||||
*/
|
*/
|
||||||
private fun setFullscreen(enabled: Boolean) {
|
private fun setFullscreen(enabled: Boolean) {
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, !enabled || isSplitScreen)
|
WindowCompat.setDecorFitsSystemWindows(window, !enabled || isSplitScreen)
|
||||||
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
|
wic.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
|
||||||
binding.root.rootWindowInsetsCompat?.let { setNavColor(it) }
|
binding.root.rootWindowInsetsCompat?.let { setNavColor(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,21 +11,25 @@ class ReaderNavGestureDetector(private val activity: ReaderActivity) : GestureDe
|
||||||
|
|
||||||
var hasScrollHorizontal = false
|
var hasScrollHorizontal = false
|
||||||
var lockVertical = false
|
var lockVertical = false
|
||||||
|
private var startingX = 0f
|
||||||
|
private var startingY = 0f
|
||||||
|
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
lockVertical = false
|
lockVertical = false
|
||||||
hasScrollHorizontal = false
|
hasScrollHorizontal = false
|
||||||
|
startingX = e.x
|
||||||
|
startingY = e.y
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onScroll(
|
override fun onScroll(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
distanceX: Float,
|
distanceX: Float,
|
||||||
distanceY: Float,
|
distanceY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val newDistanceX = e1.rawX - e2.rawX
|
val newDistanceX = startingX - e2.x
|
||||||
val newDistanceY = e1.rawY - e2.rawY
|
val newDistanceY = startingY - e2.y
|
||||||
if ((!hasScrollHorizontal || lockVertical)) {
|
if ((!hasScrollHorizontal || lockVertical)) {
|
||||||
hasScrollHorizontal = abs(newDistanceX) > abs(newDistanceY) && abs(newDistanceX) > 40
|
hasScrollHorizontal = abs(newDistanceX) > abs(newDistanceY) && abs(newDistanceX) > 40
|
||||||
if (!lockVertical) {
|
if (!lockVertical) {
|
||||||
|
@ -36,14 +40,14 @@ class ReaderNavGestureDetector(private val activity: ReaderActivity) : GestureDe
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
val diffY = e2.y - e1.y
|
val diffY = e2.y - startingY
|
||||||
val diffX = e2.x - e1.x
|
val diffX = e2.x - startingX
|
||||||
val sheetBehavior = activity.binding.chaptersSheet.root.sheetBehavior
|
val sheetBehavior = activity.binding.chaptersSheet.root.sheetBehavior
|
||||||
if (!hasScrollHorizontal && abs(diffX) < abs(diffY) &&
|
if (!hasScrollHorizontal && abs(diffX) < abs(diffY) &&
|
||||||
(abs(diffY) > SWIPE_THRESHOLD || abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) &&
|
(abs(diffY) > SWIPE_THRESHOLD || abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) &&
|
||||||
|
|
|
@ -68,27 +68,27 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
|
||||||
strokeWidth = 8f
|
strokeWidth = 8f
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDraw(canvas: Canvas?) {
|
override fun onDraw(canvas: Canvas) {
|
||||||
if (navigation == null) return
|
if (navigation == null) return
|
||||||
|
|
||||||
navigation?.regions?.forEach {
|
navigation?.regions?.forEach {
|
||||||
val region = it.invert(navigation!!.invertMode)
|
val region = it.invert(navigation!!.invertMode)
|
||||||
val rect = region.rectF
|
val rect = region.rectF
|
||||||
|
|
||||||
canvas?.save()
|
canvas.save()
|
||||||
|
|
||||||
// Scale rect from 1f,1f to screen width and height
|
// Scale rect from 1f,1f to screen width and height
|
||||||
canvas?.scale(width.toFloat(), height.toFloat())
|
canvas.scale(width.toFloat(), height.toFloat())
|
||||||
val directionalRegion = region.type.directionalRegion(isLTR)
|
val directionalRegion = region.type.directionalRegion(isLTR)
|
||||||
regionPaint.color = ContextCompat.getColor(context, directionalRegion.colorRes)
|
regionPaint.color = ContextCompat.getColor(context, directionalRegion.colorRes)
|
||||||
canvas?.drawRect(rect, regionPaint)
|
canvas.drawRect(rect, regionPaint)
|
||||||
|
|
||||||
canvas?.restore()
|
canvas.restore()
|
||||||
// Don't want scale anymore because it messes with drawText
|
// Don't want scale anymore because it messes with drawText
|
||||||
canvas?.save()
|
canvas.save()
|
||||||
|
|
||||||
// Translate origin to rect start (left, top)
|
// Translate origin to rect start (left, top)
|
||||||
canvas?.translate((width * rect.left), (height * rect.top))
|
canvas.translate((width * rect.left), (height * rect.top))
|
||||||
|
|
||||||
// Calculate center of rect width on screen
|
// Calculate center of rect width on screen
|
||||||
val x = width * (abs(rect.left - rect.right) / 2)
|
val x = width * (abs(rect.left - rect.right) / 2)
|
||||||
|
@ -96,10 +96,10 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
|
||||||
// Calculate center of rect height on screen
|
// Calculate center of rect height on screen
|
||||||
val y = height * (abs(rect.top - rect.bottom) / 2)
|
val y = height * (abs(rect.top - rect.bottom) / 2)
|
||||||
|
|
||||||
canvas?.drawText(context.getString(directionalRegion.nameRes), x, y, textBorderPaint)
|
canvas.drawText(context.getString(directionalRegion.nameRes), x, y, textBorderPaint)
|
||||||
canvas?.drawText(context.getString(directionalRegion.nameRes), x, y, textPaint)
|
canvas.drawText(context.getString(directionalRegion.nameRes), x, y, textPaint)
|
||||||
|
|
||||||
canvas?.restore()
|
canvas.restore()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class WebtoonFrame(context: Context) : FrameLayout(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFling(
|
override fun onFling(
|
||||||
e1: MotionEvent,
|
e1: MotionEvent?,
|
||||||
e2: MotionEvent,
|
e2: MotionEvent,
|
||||||
velocityX: Float,
|
velocityX: Float,
|
||||||
velocityY: Float,
|
velocityY: Float,
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.view.MenuItem
|
||||||
import android.view.RoundedCorner
|
import android.view.RoundedCorner
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.activity.BackEventCompat
|
||||||
import androidx.core.view.WindowInsetsCompat.Type.systemBars
|
import androidx.core.view.WindowInsetsCompat.Type.systemBars
|
||||||
import androidx.core.view.isInvisible
|
import androidx.core.view.isInvisible
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
|
@ -120,6 +121,7 @@ class RecentsController(bundle: Bundle? = null) :
|
||||||
private var headerHeight = 0
|
private var headerHeight = 0
|
||||||
private var ogRadius = 0f
|
private var ogRadius = 0f
|
||||||
private var deviceRadius = 0f to 0f
|
private var deviceRadius = 0f to 0f
|
||||||
|
private var lastScale = 1f
|
||||||
|
|
||||||
private var query = ""
|
private var query = ""
|
||||||
set(value) {
|
set(value) {
|
||||||
|
@ -278,6 +280,17 @@ class RecentsController(bundle: Bundle? = null) :
|
||||||
if (!isControllerVisible) {
|
if (!isControllerVisible) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
binding.downloadBottomSheet.root.apply {
|
||||||
|
if (lastScale != 1f && scaleY != 1f) {
|
||||||
|
val scaleProgress = ((1f - progress) * (1f - lastScale)) + lastScale
|
||||||
|
scaleX = scaleProgress
|
||||||
|
scaleY = scaleProgress
|
||||||
|
for (i in 0 until childCount) {
|
||||||
|
val childView = getChildAt(i)
|
||||||
|
childView.scaleY = scaleProgress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isControllerVisible) {
|
if (isControllerVisible) {
|
||||||
activityBinding?.appBar?.alpha = (1 - progress * 3) + 0.5f
|
activityBinding?.appBar?.alpha = (1 - progress * 3) + 0.5f
|
||||||
}
|
}
|
||||||
|
@ -304,6 +317,25 @@ class RecentsController(bundle: Bundle? = null) :
|
||||||
activityBinding?.tabsFrameLayout?.isVisible =
|
activityBinding?.tabsFrameLayout?.isVisible =
|
||||||
state != BottomSheetBehavior.STATE_EXPANDED
|
state != BottomSheetBehavior.STATE_EXPANDED
|
||||||
}
|
}
|
||||||
|
binding.downloadBottomSheet.dlBottomSheet.apply {
|
||||||
|
if ((
|
||||||
|
state == BottomSheetBehavior.STATE_COLLAPSED ||
|
||||||
|
state == BottomSheetBehavior.STATE_EXPANDED ||
|
||||||
|
state == BottomSheetBehavior.STATE_HIDDEN
|
||||||
|
) &&
|
||||||
|
scaleY != 1f
|
||||||
|
) {
|
||||||
|
scaleX = 1f
|
||||||
|
scaleY = 1f
|
||||||
|
pivotY = 0f
|
||||||
|
translationX = 0f
|
||||||
|
for (i in 0 until childCount) {
|
||||||
|
val childView = getChildAt(i)
|
||||||
|
childView.scaleY = 1f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (state == BottomSheetBehavior.STATE_COLLAPSED) {
|
if (state == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||||
if (hasQueue()) {
|
if (hasQueue()) {
|
||||||
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.isHideable =
|
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.isHideable =
|
||||||
|
@ -454,6 +486,24 @@ class RecentsController(bundle: Bundle? = null) :
|
||||||
presenter.preferences.recentsViewType().get() != presenter.viewType.mainValue
|
presenter.preferences.recentsViewType().get() != presenter.viewType.mainValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackStarted(backEvent: BackEventCompat) {
|
||||||
|
if (showingDownloads) {
|
||||||
|
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.startBackProgress(backEvent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackProgressed(backEvent: BackEventCompat) {
|
||||||
|
if (showingDownloads) {
|
||||||
|
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.updateBackProgress(backEvent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackCancelled() {
|
||||||
|
if (showingDownloads) {
|
||||||
|
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.cancelBackProgress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun handleBack(): Boolean {
|
override fun handleBack(): Boolean {
|
||||||
if (showingDownloads) {
|
if (showingDownloads) {
|
||||||
binding.downloadBottomSheet.dlBottomSheet.dismiss()
|
binding.downloadBottomSheet.dlBottomSheet.dismiss()
|
||||||
|
|
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.security
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.os.Build
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.biometric.BiometricManager
|
import androidx.biometric.BiometricManager
|
||||||
|
@ -44,8 +45,12 @@ object SecureActivityDelegate {
|
||||||
val intent = Intent(activity, BiometricActivity::class.java)
|
val intent = Intent(activity, BiometricActivity::class.java)
|
||||||
intent.putExtra("fromSearch", (activity is SearchActivity) && !requireSuccess)
|
intent.putExtra("fromSearch", (activity is SearchActivity) && !requireSuccess)
|
||||||
activity.startActivity(intent)
|
activity.startActivity(intent)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||||
|
activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
|
||||||
|
} else {
|
||||||
activity.overridePendingTransition(0, 0)
|
activity.overridePendingTransition(0, 0)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (lockApp) {
|
} else if (lockApp) {
|
||||||
preferences.useBiometrics().set(false)
|
preferences.useBiometrics().set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.view.MenuItem
|
||||||
import android.view.RoundedCorner
|
import android.view.RoundedCorner
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.activity.BackEventCompat
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.view.doOnNextLayout
|
import androidx.core.view.doOnNextLayout
|
||||||
|
@ -104,6 +105,7 @@ class BrowseController :
|
||||||
|
|
||||||
private var ogRadius = 0f
|
private var ogRadius = 0f
|
||||||
private var deviceRadius = 0f to 0f
|
private var deviceRadius = 0f to 0f
|
||||||
|
private var lastScale = 1f
|
||||||
|
|
||||||
override val mainRecycler: RecyclerView
|
override val mainRecycler: RecyclerView
|
||||||
get() = binding.sourceRecycler
|
get() = binding.sourceRecycler
|
||||||
|
@ -184,6 +186,17 @@ class BrowseController :
|
||||||
updateTitleAndMenu()
|
updateTitleAndMenu()
|
||||||
(activity as? MainActivity)?.reEnableBackPressedCallBack()
|
(activity as? MainActivity)?.reEnableBackPressedCallBack()
|
||||||
}
|
}
|
||||||
|
binding.bottomSheet.root.apply {
|
||||||
|
if (lastScale != 1f && scaleY != 1f) {
|
||||||
|
val scaleProgress = ((1f - progress) * (1f - lastScale)) + lastScale
|
||||||
|
scaleX = scaleProgress
|
||||||
|
scaleY = scaleProgress
|
||||||
|
for (i in 0 until childCount) {
|
||||||
|
val childView = getChildAt(i)
|
||||||
|
childView.scaleY = scaleProgress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
binding.bottomSheet.sheetToolbar.isVisible = true
|
binding.bottomSheet.sheetToolbar.isVisible = true
|
||||||
setBottomSheetTabs(max(0f, progress))
|
setBottomSheetTabs(max(0f, progress))
|
||||||
}
|
}
|
||||||
|
@ -195,6 +208,27 @@ class BrowseController :
|
||||||
binding.bottomSheet.root.updatedNestedRecyclers()
|
binding.bottomSheet.root.updatedNestedRecyclers()
|
||||||
binding.bottomSheet.root.isExpanding = false
|
binding.bottomSheet.root.isExpanding = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.bottomSheet.root.apply {
|
||||||
|
if ((
|
||||||
|
state == BottomSheetBehavior.STATE_COLLAPSED ||
|
||||||
|
state == BottomSheetBehavior.STATE_EXPANDED ||
|
||||||
|
state == BottomSheetBehavior.STATE_HIDDEN
|
||||||
|
) &&
|
||||||
|
scaleY != 1f
|
||||||
|
) {
|
||||||
|
scaleX = 1f
|
||||||
|
scaleY = 1f
|
||||||
|
pivotY = 0f
|
||||||
|
translationX = 0f
|
||||||
|
for (i in 0 until childCount) {
|
||||||
|
val childView = getChildAt(i)
|
||||||
|
childView.scaleY = 1f
|
||||||
|
}
|
||||||
|
lastScale = 1f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val extBottomSheet = binding.bottomSheet.root
|
val extBottomSheet = binding.bottomSheet.root
|
||||||
if (state == BottomSheetBehavior.STATE_EXPANDED ||
|
if (state == BottomSheetBehavior.STATE_EXPANDED ||
|
||||||
state == BottomSheetBehavior.STATE_COLLAPSED
|
state == BottomSheetBehavior.STATE_COLLAPSED
|
||||||
|
@ -440,9 +474,28 @@ class BrowseController :
|
||||||
|
|
||||||
override fun canStillGoBack(): Boolean = showingExtensions
|
override fun canStillGoBack(): Boolean = showingExtensions
|
||||||
|
|
||||||
|
override fun handleOnBackStarted(backEvent: BackEventCompat) {
|
||||||
|
if (showingExtensions && !binding.bottomSheet.root.canStillGoBack()) {
|
||||||
|
binding.bottomSheet.root.sheetBehavior?.startBackProgress(backEvent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackProgressed(backEvent: BackEventCompat) {
|
||||||
|
if (showingExtensions && !binding.bottomSheet.root.canStillGoBack()) {
|
||||||
|
binding.bottomSheet.root.sheetBehavior?.updateBackProgress(backEvent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleOnBackCancelled() {
|
||||||
|
if (showingExtensions && !binding.bottomSheet.root.canStillGoBack()) {
|
||||||
|
binding.bottomSheet.root.sheetBehavior?.cancelBackProgress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun handleBack(): Boolean {
|
override fun handleBack(): Boolean {
|
||||||
if (showingExtensions) {
|
if (showingExtensions) {
|
||||||
if (binding.bottomSheet.root.canGoBack()) {
|
if (binding.bottomSheet.root.canGoBack()) {
|
||||||
|
lastScale = binding.bottomSheet.root.scaleX
|
||||||
binding.bottomSheet.root.sheetBehavior?.collapse()
|
binding.bottomSheet.root.sheetBehavior?.collapse()
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
object AndroidVersions {
|
object AndroidVersions {
|
||||||
const val compileSdk = 33
|
const val compileSdk = 34
|
||||||
const val minSdk = 23
|
const val minSdk = 23
|
||||||
const val targetSdk = 33
|
const val targetSdk = 34
|
||||||
const val versionCode = 105
|
const val versionCode = 105
|
||||||
const val versionName = "1.7.0"
|
const val versionName = "1.7.0"
|
||||||
const val ndk = "23.1.7779620"
|
const val ndk = "23.1.7779620"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue