mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
Fix missing navigation bar padding in page view
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
This commit is contained in:
@@ -25,7 +25,18 @@ import io.legado.app.lib.theme.ThemeStore
|
||||
import io.legado.app.lib.theme.backgroundColor
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.ui.widget.TitleBar
|
||||
import io.legado.app.utils.*
|
||||
import io.legado.app.utils.ColorUtils
|
||||
import io.legado.app.utils.applyBackgroundTint
|
||||
import io.legado.app.utils.applyOpenTint
|
||||
import io.legado.app.utils.applyTint
|
||||
import io.legado.app.utils.disableAutoFill
|
||||
import io.legado.app.utils.fullScreen
|
||||
import io.legado.app.utils.hideSoftInput
|
||||
import io.legado.app.utils.setLightStatusBar
|
||||
import io.legado.app.utils.setNavigationBarColorAuto
|
||||
import io.legado.app.utils.setStatusBarColorAuto
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.windowSize
|
||||
|
||||
|
||||
abstract class BaseActivity<VB : ViewBinding>(
|
||||
|
||||
@@ -128,7 +128,6 @@ import io.legado.app.utils.visible
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.Dispatchers.Main
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.Runnable
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -117,7 +117,7 @@ class MoreConfigDialog : BasePrefDialogFragment() {
|
||||
|
||||
PreferKey.hideNavigationBar -> {
|
||||
ReadBookConfig.hideNavigationBar = getPrefBoolean(PreferKey.hideNavigationBar)
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(0))
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(0, 2))
|
||||
}
|
||||
|
||||
PreferKey.keepLight -> postEvent(key, true)
|
||||
|
||||
@@ -21,6 +21,7 @@ import io.legado.app.ui.book.read.page.entities.TextPos
|
||||
import io.legado.app.ui.book.read.page.provider.ChapterProvider
|
||||
import io.legado.app.ui.widget.BatteryView
|
||||
import io.legado.app.utils.activity
|
||||
import io.legado.app.utils.applyNavigationBarPadding
|
||||
import io.legado.app.utils.applyStatusBarPadding
|
||||
import io.legado.app.utils.dpToPx
|
||||
import io.legado.app.utils.gone
|
||||
@@ -61,6 +62,7 @@ class PageView(context: Context) : FrameLayout(context) {
|
||||
if (!isInEditMode) {
|
||||
upStyle()
|
||||
binding.vwStatusBar.applyStatusBarPadding()
|
||||
binding.vwNavigationBar.applyNavigationBarPadding()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +94,7 @@ class PageView(context: Context) : FrameLayout(context) {
|
||||
vwTopDivider.backgroundColor = tipDividerColor
|
||||
vwBottomDivider.backgroundColor = tipDividerColor
|
||||
upStatusBar()
|
||||
upNavigationBar()
|
||||
llHeader.setPadding(
|
||||
it.headerPaddingLeft.dpToPx(),
|
||||
it.headerPaddingTop.dpToPx(),
|
||||
@@ -119,6 +122,10 @@ class PageView(context: Context) : FrameLayout(context) {
|
||||
isGone = ReadBookConfig.hideStatusBar || readBookActivity?.isInMultiWindow == true
|
||||
}
|
||||
|
||||
fun upNavigationBar() {
|
||||
binding.vwNavigationBar.isGone = ReadBookConfig.hideNavigationBar
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新阅读信息
|
||||
*/
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
app:layout_constraintBottom_toTopOf="@id/vw_navigation_bar">
|
||||
|
||||
<io.legado.app.ui.widget.BatteryView
|
||||
android:id="@+id/tv_footer_left"
|
||||
@@ -139,4 +139,10 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/vw_navigation_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user