单章换源界面错误 #387
This commit is contained in:
@@ -123,6 +123,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
|
||||
activity?.onBackPressedDispatcher?.addCallback(this) {
|
||||
if (binding.clToc.isVisible) {
|
||||
binding.clToc.gone()
|
||||
binding.recyclerView.visible()
|
||||
return@addCallback
|
||||
}
|
||||
dismissAllowingStateLoss()
|
||||
@@ -155,6 +156,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
|
||||
private fun initView() {
|
||||
binding.ivHideToc.setOnClickListener {
|
||||
binding.clToc.gone()
|
||||
binding.recyclerView.visible()
|
||||
}
|
||||
//binding.flHideToc.elevation = requireContext().elevation
|
||||
}
|
||||
@@ -307,6 +309,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
|
||||
override fun openToc(searchBook: SearchBook) {
|
||||
this.searchBook = searchBook
|
||||
tocAdapter.setItems(null)
|
||||
binding.recyclerView.gone()
|
||||
binding.clToc.visible()
|
||||
binding.loadingToc.visible()
|
||||
val book = searchBook.toBook()
|
||||
|
||||
@@ -31,7 +31,8 @@ class ChangeChapterTocAdapter(context: Context, val callback: Callback) :
|
||||
) {
|
||||
binding.run {
|
||||
val isDur = durChapterIndex == item.index
|
||||
|
||||
ivVolume.gone()
|
||||
ivLocked.gone()
|
||||
if (isDur) {
|
||||
tvChapterName.setTextColor(context.themeColor(androidx.appcompat.R.attr.colorPrimary))
|
||||
} else {
|
||||
|
||||
@@ -1,45 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="5dp"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:displayHomeAsUp="false"
|
||||
app:fitStatusBar="false"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:fitStatusBar="false" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/refresh_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tool_bar" />
|
||||
android:indeterminate="true" />
|
||||
|
||||
<io.legado.app.ui.widget.recycler.scroller.FastScrollRecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ll_bottom_bar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/refresh_progress_bar" />
|
||||
android:layout_weight="1"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/cl_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_hide_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:elevation="4dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/iv_hide_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_arrow_down" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.loadingindicator.LoadingIndicator
|
||||
android:id="@+id/loading_toc"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintRight_toRightOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintTop_toTopOf="@+id/recycler_view_toc" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_hide_toc" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_dur"
|
||||
@@ -75,48 +116,4 @@
|
||||
tools:ignore="UnusedAttribute" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tool_bar">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_hide_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="4dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/iv_hide_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_arrow_down" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_toc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_hide_toc" />
|
||||
|
||||
<com.google.android.material.loadingindicator.LoadingIndicator
|
||||
android:id="@+id/loading_toc"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintRight_toRightOf="@+id/recycler_view_toc"
|
||||
app:layout_constraintTop_toTopOf="@+id/recycler_view_toc" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user