-
Notifications
You must be signed in to change notification settings - Fork 2
/
SupportView.java
51 lines (40 loc) · 1.54 KB
/
SupportView.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
45
46
47
48
49
50
51
package com.duanlu.widget;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import com.duanlu.widget.wrapper.WidgetDrawableWrapper;
/********************************
* @name SupportView
* @author 段露
* @createDate 2019/07/29 18:14
* @updateDate 2019/07/29 18:14
* @version V1.0.0
* @describe View.
********************************/
public class SupportView extends View {
private WidgetDrawableWrapper mWidgetDrawableWrapper;
public SupportView(Context context) {
this(context, null);
}
public SupportView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public SupportView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.initView(context, attrs, defStyleAttr, 0);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public SupportView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
this.initView(context, attrs, defStyleAttr, defStyleRes);
}
private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes);
}
public WidgetDrawableWrapper getWidgetDrawableWrapper() {
return mWidgetDrawableWrapper;
}
}