-
Notifications
You must be signed in to change notification settings - Fork 2
/
SupportTextView.java
44 lines (34 loc) · 1.35 KB
/
SupportTextView.java
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
package com.duanlu.widget;
import android.content.Context;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import com.duanlu.widget.wrapper.WidgetDrawableWrapper;
import com.duanlu.widget.wrapper.WidgetTextWrapper;
/********************************
* @name SupportTextView
* @author 段露
* @createDate 2019/07/30 11:19
* @updateDate 2019/07/30 11:19
* @version V1.0.0
* @describe AppCompatTextView.
********************************/
public class SupportTextView extends AppCompatTextView {
private WidgetDrawableWrapper mWidgetDrawableWrapper;
public SupportTextView(Context context) {
this(context, null);
}
public SupportTextView(Context context, AttributeSet attrs) {
this(context, attrs, android.R.attr.textViewStyle);
}
public SupportTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.initView(context, attrs, defStyleAttr, 0);
}
private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes);
new WidgetTextWrapper(this, attrs, defStyleAttr, 0);
}
public WidgetDrawableWrapper getWidgetDrawableWrapper() {
return mWidgetDrawableWrapper;
}
}