mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
94559472dc
commit
a3ceeb82c3
@ -13,7 +13,7 @@ import android.text.style.ForegroundColorSpan
|
|||||||
import android.text.style.ReplacementSpan
|
import android.text.style.ReplacementSpan
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import androidx.annotation.ColorInt
|
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.*
|
||||||
import java.util.regex.Matcher
|
import java.util.regex.Matcher
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
@ -21,7 +21,7 @@ import kotlin.math.roundToInt
|
|||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
class CodeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
class CodeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||||
ScrollMultiAutoCompleteTextView(context, attrs) {
|
NestScrollMultiAutoCompleteTextView(context, attrs) {
|
||||||
|
|
||||||
private var tabWidth = 0
|
private var tabWidth = 0
|
||||||
private var tabWidthInCharacters = 0
|
private var tabWidthInCharacters = 0
|
||||||
|
@ -15,7 +15,9 @@ import kotlin.math.abs
|
|||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惯性滚动 TextView
|
||||||
|
*/
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
open class InertiaScrollTextView @JvmOverloads constructor(
|
open class InertiaScrollTextView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
|
@ -6,7 +6,10 @@ import android.util.AttributeSet
|
|||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
|
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
|
||||||
|
|
||||||
open class ScrollMultiAutoCompleteTextView @JvmOverloads constructor(
|
/**
|
||||||
|
* 嵌套滚动 MultiAutoCompleteTextView
|
||||||
|
*/
|
||||||
|
open class NestScrollMultiAutoCompleteTextView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null
|
attrs: AttributeSet? = null
|
||||||
) : AppCompatMultiAutoCompleteTextView(context, attrs) {
|
) : AppCompatMultiAutoCompleteTextView(context, attrs) {
|
@ -6,7 +6,12 @@ import android.util.AttributeSet
|
|||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import androidx.appcompat.widget.AppCompatTextView
|
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
|
private var mOffsetHeight = 0
|
||||||
|
|
@ -355,7 +355,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.ScrollTextView
|
<io.legado.app.ui.widget.text.NestScrollTextView
|
||||||
android:id="@+id/tv_intro"
|
android:id="@+id/tv_intro"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -331,7 +331,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.ScrollTextView
|
<io.legado.app.ui.widget.text.NestScrollTextView
|
||||||
android:id="@+id/tv_intro"
|
android:id="@+id/tv_intro"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
Reference in New Issue
Block a user