Using frame instead of appbar in reader

Not sure if will fix the disappearing page bug but appbars are weird enough to cause it
This commit is contained in:
Jay 2020-05-22 21:28:47 -04:00
parent 26081fae64
commit 42e299366a
2 changed files with 19 additions and 20 deletions

View File

@ -389,7 +389,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
if (visible) {
snackbar?.dismiss()
systemUi?.show()
appbar.visible()
reader_menu.visible()
if (chapters_bottom_sheet.sheetBehavior.isExpanded()) {
chapters_bottom_sheet.sheetBehavior?.isHideable = false
@ -416,14 +416,14 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.exit_to_top)
toolbarAnimation.setAnimationListener(object : SimpleAnimationListener() {
override fun onAnimationEnd(animation: Animation) {
appbar.gone()
reader_menu.gone()
}
})
appbar.startAnimation(toolbarAnimation)
BottomSheetBehavior.from(chapters_bottom_sheet).isHideable = true
chapters_bottom_sheet.sheetBehavior?.hide()
} else {
appbar.gone()
reader_menu.gone()
}
}
menuStickyVisible = false
@ -713,7 +713,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
}
}
if (sheetManageNavColor) window.navigationBarColor = getResourceColor(R.attr.colorSecondary)
appbar.visible()
reader_menu.visible()
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)
toolbarAnimation.setAnimationListener(object : SimpleAnimationListener() {
override fun onAnimationStart(animation: Animation) {

View File

@ -1,5 +1,4 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/reader_layout"
android:layout_width="match_parent"
@ -35,25 +34,25 @@
android:layout_height="match_parent"
android:visibility="gone" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
<FrameLayout
android:id="@+id/reader_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSecondary"
android:stateListAnimator="@null"
android:theme="?attr/actionBarTheme"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
<FrameLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent" />
android:layout_height="wrap_content"
android:background="?attr/colorSecondary">
</com.google.android.material.appbar.AppBarLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent" />
</FrameLayout>
</FrameLayout>
<include layout="@layout/reader_chapters_sheet" />