add marquee text view
This commit is contained in:
2 files changed
+22
-2
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package com.github.kr328.clash.view
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
import android.widget.TextView
|
||||
|
||||
class MarqueeTextView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attributeSet: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
defStyleRes: Int = 0
|
||||
): TextView(context, attributeSet, defStyleAttr, defStyleRes) {
|
||||
init {
|
||||
ellipsize = TextUtils.TruncateAt.MARQUEE
|
||||
}
|
||||
|
||||
override fun isFocused(): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
<com.github.kr328.clash.view.MarqueeTextView
|
||||
android:id="@+id/adapter_proxy_item_name"
|
||||
android:ellipsize="middle"
|
||||
android:textColor="@android:color/black"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in new issue
Block a user