pull/2351/head
kunfei 2 years ago
parent 94559472dc
commit a3ceeb82c3
  1. 4
      app/src/main/java/io/legado/app/ui/widget/code/CodeView.kt
  2. 4
      app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt
  3. 5
      app/src/main/java/io/legado/app/ui/widget/text/NestScrollMultiAutoCompleteTextView.kt
  4. 7
      app/src/main/java/io/legado/app/ui/widget/text/NestScrollTextView.kt
  5. 2
      app/src/main/res/layout-land/activity_book_info.xml
  6. 2
      app/src/main/res/layout/activity_book_info.xml

@ -13,7 +13,7 @@ import android.text.style.ForegroundColorSpan
import android.text.style.ReplacementSpan
import android.util.AttributeSet
import androidx.annotation.ColorInt
import io.legado.app.ui.widget.text.ScrollMultiAutoCompleteTextView
import io.legado.app.ui.widget.text.NestScrollMultiAutoCompleteTextView
import java.util.*
import java.util.regex.Matcher
import java.util.regex.Pattern
@ -21,7 +21,7 @@ import kotlin.math.roundToInt
@Suppress("unused")
class CodeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
ScrollMultiAutoCompleteTextView(context, attrs) {
NestScrollMultiAutoCompleteTextView(context, attrs) {
private var tabWidth = 0
private var tabWidthInCharacters = 0

@ -15,7 +15,9 @@ import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
/**
* 惯性滚动 TextView
*/
@Suppress("unused")
open class InertiaScrollTextView @JvmOverloads constructor(
context: Context,

@ -6,7 +6,10 @@ import android.util.AttributeSet
import android.view.MotionEvent
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
open class ScrollMultiAutoCompleteTextView @JvmOverloads constructor(
/**
* 嵌套滚动 MultiAutoCompleteTextView
*/
open class NestScrollMultiAutoCompleteTextView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : AppCompatMultiAutoCompleteTextView(context, attrs) {

@ -6,7 +6,12 @@ import android.util.AttributeSet
import android.view.MotionEvent
import androidx.appcompat.widget.AppCompatTextView
class ScrollTextView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) {
/**
* 嵌套滚动 TextView
*/
class NestScrollTextView(context: Context, attrs: AttributeSet?) :
AppCompatTextView(context, attrs) {
//滑动距离的最大边界
private var mOffsetHeight = 0

@ -355,7 +355,7 @@
</LinearLayout>
<io.legado.app.ui.widget.text.ScrollTextView
<io.legado.app.ui.widget.text.NestScrollTextView
android:id="@+id/tv_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"

@ -331,7 +331,7 @@
</LinearLayout>
<io.legado.app.ui.widget.text.ScrollTextView
<io.legado.app.ui.widget.text.NestScrollTextView
android:id="@+id/tv_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"

Loading…
Cancel
Save