admin
2021-07-06 abce02c7a61820f5d580f87364d542e817be429c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.wpc.library.widget;
 
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
 
/**
 * 一个页面实现多个跑马灯效果
 * Created by weikou2015 on 2018/10/18.
 */
 
public class MarqueeText extends TextView {
    public MarqueeText(Context context) {
        super(context);
    }
 
    public MarqueeText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
 
    public MarqueeText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }
 
    //TextView默认设置是第一个获取到的光标,
    //如果想让所有的TextView都有跑马灯效果,则让所有的TextView都获取到光标就行了
    //这里return true 就是让所有的TextView都获取到光标
    @Override
    public boolean isFocused() {
        return true;
    }
}