Update
This commit is contained in:
@@ -168,7 +168,7 @@ class BookInfoActivity :
|
||||
binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading))
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||
binding.tvIntro.revealOnFocusHint = false
|
||||
binding.tvDetail?.let { it.revealOnFocusHint = false }
|
||||
}
|
||||
|
||||
viewModel.bookData.observe(this) { showBook(it) }
|
||||
@@ -297,16 +297,16 @@ class BookInfoActivity :
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
if (ev.action == MotionEvent.ACTION_DOWN) {
|
||||
currentFocus?.let {
|
||||
if (it === binding.tvIntro && binding.tvIntro.hasSelection()) {
|
||||
it.clearFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.dispatchTouchEvent(ev)
|
||||
}
|
||||
// override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
// if (ev.action == MotionEvent.ACTION_DOWN) {
|
||||
// currentFocus?.let {
|
||||
// if (it === binding.tvIntro && binding.tvIntro.hasSelection()) {
|
||||
// it.clearFocus()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return super.dispatchTouchEvent(ev)
|
||||
// }
|
||||
|
||||
private fun refreshBook() {
|
||||
upLoading(true)
|
||||
@@ -343,7 +343,7 @@ class BookInfoActivity :
|
||||
tvAuthor.text = getString(R.string.author_show, book.getRealAuthor())
|
||||
tvOrigin.text = getString(R.string.origin_show, book.originName)
|
||||
tvLasted.text = getString(R.string.lasted_show, book.latestChapterTitle)
|
||||
tvIntro.text = book.getDisplayIntro()
|
||||
tvDetail?.let { it.text = book.getDisplayIntro() }
|
||||
llToc?.visible(!book.isWebFile)
|
||||
upTvBookshelf()
|
||||
upKinds(book)
|
||||
@@ -366,7 +366,9 @@ class BookInfoActivity :
|
||||
lbKind.gone()
|
||||
} else {
|
||||
lbKind.visible()
|
||||
lbKind.setLabels(kinds)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
lbKind.setLabels(kinds)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.view.animation.Interpolator
|
||||
import android.widget.OverScroller
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.core.view.ViewCompat
|
||||
import com.google.android.material.textview.MaterialTextView
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
@@ -21,7 +22,7 @@ import kotlin.math.min
|
||||
* 嵌套惯性滚动 TextView
|
||||
*/
|
||||
class ScrollTextView(context: Context, attrs: AttributeSet?) :
|
||||
AppCompatTextView(context, attrs) {
|
||||
MaterialTextView(context, attrs) {
|
||||
|
||||
//是否到顶或者到底的标志
|
||||
private var disallowIntercept = true
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -287,7 +288,7 @@
|
||||
android:includeFontPadding="false"
|
||||
android:paddingRight="6dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="13sp"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
||||
tools:text="@string/read_dur_progress" />
|
||||
|
||||
@@ -318,7 +319,7 @@
|
||||
android:includeFontPadding="false"
|
||||
android:paddingRight="6dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="13sp"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
||||
tools:text="@string/group_s" />
|
||||
|
||||
@@ -336,8 +337,8 @@
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<io.legado.app.ui.widget.text.ScrollTextView
|
||||
android:id="@+id/tv_intro"
|
||||
<TextView
|
||||
android:id="@+id/tv_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
@@ -346,9 +347,10 @@
|
||||
android:minHeight="48dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:text="@string/book_intro"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||
|
||||
|
||||
@@ -39,6 +39,19 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -65,15 +78,6 @@
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 加载指示器 -->
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover"
|
||||
android:layout_margin="8dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 书名 -->
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
Reference in New Issue
Block a user