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