This commit is contained in:
Horis
2023-03-26 14:53:26 +08:00
parent 2797a7f657
commit a33e6ed3bc
3 changed files with 331 additions and 330 deletions
@@ -85,8 +85,7 @@ class ImportBookActivity : BaseImportBookActivity<ImportBookViewModel>(),
override fun onMenuItemClick(item: MenuItem?): Boolean { override fun onMenuItemClick(item: MenuItem?): Boolean {
when (item?.itemId) { when (item?.itemId) {
R.id.menu_del_selection -> R.id.menu_del_selection -> viewModel.deleteDoc(adapter.selectedUris) {
viewModel.deleteDoc(adapter.selectedUris) {
adapter.removeSelection() adapter.removeSelection()
} }
} }
@@ -115,7 +115,6 @@ class BookInfoActivity :
binding.refreshLayout?.setColorSchemeColors(accentColor) binding.refreshLayout?.setColorSchemeColors(accentColor)
binding.arcView.setBgColor(backgroundColor) binding.arcView.setBgColor(backgroundColor)
binding.llInfo.setBackgroundColor(backgroundColor) binding.llInfo.setBackgroundColor(backgroundColor)
binding.scrollView.setBackgroundColor(backgroundColor)
binding.flAction.setBackgroundColor(bottomBackground) binding.flAction.setBackgroundColor(bottomBackground)
binding.tvShelf.setTextColor(getPrimaryTextColor(ColorUtils.isColorLight(bottomBackground))) binding.tvShelf.setTextColor(getPrimaryTextColor(ColorUtils.isColorLight(bottomBackground)))
binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading)) binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading))
@@ -423,9 +422,6 @@ class BookInfoActivity :
} }
} }
} }
scrollView.setOnScrollChangeListener { _, _, scrollY, _, _ ->
refreshLayout?.isEnabled = (scrollY <= 0)
}
refreshLayout?.setOnRefreshListener { refreshLayout?.setOnRefreshListener {
refreshLayout.isRefreshing = false refreshLayout.isRefreshing = false
refreshBook() refreshBook()
+44 -38
View File
@@ -10,16 +10,10 @@
android:id="@+id/bg_book" android:id="@+id/bg_book"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="@string/bg_image" android:contentDescription="@string/bg_image"
android:scaleType="centerCrop"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" >
<LinearLayout <LinearLayout
android:id="@+id/vw_bg" android:id="@+id/vw_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -32,8 +26,31 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:title="@string/book_info" app:themeMode="dark"
app:themeMode="dark" /> app:title="@string/book_info" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:fillViewport="true"
android:fitsSystemWindows="false"
android:focusable="true"
android:padding="0dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -42,18 +59,18 @@
<io.legado.app.ui.widget.image.ArcView <io.legado.app.ui.widget.image.ArcView
android:id="@+id/arc_view" android:id="@+id/arc_view"
android:layout_marginTop="90dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="78dp" android:layout_height="78dp"
android:layout_marginTop="90dp"
app:arcDirectionTop="true" app:arcDirectionTop="true"
app:arcHeight="36dp" app:arcHeight="36dp"
app:bgColor="@color/background" /> app:bgColor="@color/background" />
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_margin="3dp"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="3dp"
app:cardCornerRadius="5dp" app:cardCornerRadius="5dp"
app:cardElevation="8dp"> app:cardElevation="8dp">
@@ -69,28 +86,15 @@
</RelativeLayout> </RelativeLayout>
<ScrollView
android:id="@+id/scroll_view"
android:background="@color/background"
android:layout_weight="1.0"
android:padding="0dp"
android:layout_height="0dp"
android:layout_width="match_parent"
android:scrollbarStyle="outsideInset"
android:scrollbars="vertical"
android:fillViewport="true"
android:fitsSystemWindows="false"
android:focusable="true">
<LinearLayout <LinearLayout
android:id="@+id/ll_info" android:id="@+id/ll_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:paddingBottom="8dp" android:paddingBottom="8dp">
android:background="@color/background"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -118,20 +122,20 @@
android:id="@+id/lb_kind" android:id="@+id/lb_kind"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginBottom="6dp"
android:gravity="center" android:gravity="center"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:paddingBottom="8dp" android:paddingBottom="8dp">
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -206,8 +210,8 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:textSize="13sp"
android:text="@string/change_origin" android:text="@string/change_origin"
android:textSize="13sp"
app:radius="2dp" /> app:radius="2dp" />
</LinearLayout> </LinearLayout>
@@ -225,10 +229,10 @@
android:id="@+id/ic_book_last" android:id="@+id/ic_book_last"
android:layout_width="18sp" android:layout_width="18sp"
android:layout_height="18sp" android:layout_height="18sp"
android:contentDescription="@string/read_dur_progress"
android:paddingRight="2dp" android:paddingRight="2dp"
android:src="@drawable/ic_book_last" android:src="@drawable/ic_book_last"
app:tint="@color/tv_text_summary" app:tint="@color/tv_text_summary"
android:contentDescription="@string/read_dur_progress"
tools:ignore="RtlHardcoded,RtlSymmetry" /> tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView <TextView
@@ -258,10 +262,10 @@
<ImageView <ImageView
android:layout_width="18sp" android:layout_width="18sp"
android:layout_height="18sp" android:layout_height="18sp"
android:contentDescription="@string/read_dur_progress"
android:paddingRight="2dp" android:paddingRight="2dp"
android:src="@drawable/ic_groups" android:src="@drawable/ic_groups"
app:tint="@color/tv_text_summary" app:tint="@color/tv_text_summary"
android:contentDescription="@string/read_dur_progress"
tools:ignore="RtlHardcoded,RtlSymmetry" /> tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView <TextView
@@ -356,8 +360,12 @@
</LinearLayout> </LinearLayout>
</LinearLayout>
</ScrollView> </ScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1px" android:layout_height="1px"
@@ -399,6 +407,4 @@
</LinearLayout> </LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>