Cleanup BaseScene
This commit is contained in:
1 parent
2da8cfde01
commit
bb3a88813b
2 files changed
+3
-13
No files matched your search
@@ -16,7 +16,6 @@
|
||||
package com.hippo.ehviewer.ui.scene
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.res.Resources
|
||||
import android.content.res.Resources.Theme
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
@@ -105,9 +104,7 @@ abstract class BaseScene : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
open fun needShowLeftDrawer(): Boolean {
|
||||
return true
|
||||
}
|
||||
open val showLeftDrawer = true
|
||||
|
||||
fun recreateDrawerView() {
|
||||
val activity = mainActivity
|
||||
@@ -157,7 +154,7 @@ abstract class BaseScene : Fragment() {
|
||||
view.background = requireActivity().theme.resolveDrawable(android.R.attr.windowBackground)
|
||||
|
||||
// Update left drawer locked state
|
||||
if (needShowLeftDrawer()) {
|
||||
if (showLeftDrawer) {
|
||||
setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, GravityCompat.START)
|
||||
} else {
|
||||
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, GravityCompat.START)
|
||||
@@ -171,11 +168,6 @@ abstract class BaseScene : Fragment() {
|
||||
destroyDrawerView()
|
||||
}
|
||||
|
||||
val resourcesOrNull: Resources?
|
||||
get() {
|
||||
val context = context
|
||||
return context?.resources
|
||||
}
|
||||
val mainActivity: MainActivity?
|
||||
get() {
|
||||
val activity = activity
|
||||
|
||||
@@ -33,9 +33,7 @@ import eu.kanade.tachiyomi.util.lang.withUIContext
|
||||
import moe.tarsin.coroutines.runSuspendCatching
|
||||
|
||||
class ProgressScene : BaseScene() {
|
||||
override fun needShowLeftDrawer(): Boolean {
|
||||
return false
|
||||
}
|
||||
override val showLeftDrawer = false
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
return ComposeView(inflater.context).apply {
|
||||
|
||||
Reference in new issue
Block a user