-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMarqueeTextView.java
More file actions
54 lines (38 loc) · 1.03 KB
/
MarqueeTextView.java
File metadata and controls
54 lines (38 loc) · 1.03 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.momo.utils;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
import android.text.TextUtils;
/**
* @author RealMo
* @date 创建时间:2017-5-16 上午10:43:44
* @version 1.0
* @parameter
* @since
* @return
* 走马灯的TextView
*/
public class MarqueeTextView extends TextView{
public MarqueeTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initView(context);
}
public MarqueeTextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public MarqueeTextView(Context context) {
this(context, null);
}
private void initView(Context context) {
this.setSingleLine(true);
this.setEllipsize(TextUtils.TruncateAt.MARQUEE);
this.setMarqueeRepeatLimit(-1);
}
@Override
public boolean isFocused() {
//realmo must be return true ,have marquee effection.
return true;
}
}