├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── attrs.xml │ │ │ └── styles.xml │ │ ├── drawable │ │ │ ├── sample.png │ │ │ ├── sample_1.jpg │ │ │ ├── sample_2.jpg │ │ │ ├── ic_collect.png │ │ │ └── test.xml │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ └── color │ │ │ └── tint.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── duanlu │ │ └── widget │ │ └── sample │ │ ├── MainActivity.java │ │ └── CustomView.java ├── proguard-rules.pro └── build.gradle ├── library_widget ├── .gitignore ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ ├── strings.xml │ │ │ ├── attrs_feature.xml │ │ │ ├── attrs_state_checked.xml │ │ │ ├── attrs_state_focused.xml │ │ │ ├── attrs_state_pressed.xml │ │ │ ├── attrs_state_disabled.xml │ │ │ ├── attrs_state_selected.xml │ │ │ ├── attrs.xml │ │ │ ├── attrs_View.xml │ │ │ ├── attrs_ImageView.xml │ │ │ ├── attrs_ViewGroup.xml │ │ │ ├── attrs_FrameLayout.xml │ │ │ ├── attrs_ImageButton.xml │ │ │ ├── attrs_RadioGroup.xml │ │ │ ├── attrs_SearchView.xml │ │ │ ├── attrs_LinearLayout.xml │ │ │ ├── attrs_RelativeLayout.xml │ │ │ ├── attrs_FeatureImageView.xml │ │ │ ├── attrs_Button.xml │ │ │ ├── attrs_CheckBox.xml │ │ │ ├── attrs_EditText.xml │ │ │ └── attrs_TextView.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── duanlu │ │ └── widget │ │ ├── annotation │ │ └── Status.java │ │ ├── SupportRadioGroup.java │ │ ├── utils │ │ └── WidgetUtils.java │ │ ├── SupportImageView.java │ │ ├── constants │ │ └── WidgetConstants.java │ │ ├── SupportSearchView.java │ │ ├── SupportImageButton.java │ │ ├── SupportButton.java │ │ ├── SupportEditText.java │ │ ├── SupportCheckBox.java │ │ ├── SupportTextView.java │ │ ├── SupportRadioButton.java │ │ ├── SupportAutoCompleteTextView.java │ │ ├── SupportMultiAutoCompleteTextView.java │ │ ├── SupportViewGroup.java │ │ ├── SupportView.java │ │ ├── SupportFrameLayout.java │ │ ├── SupportLinearLayout.java │ │ ├── SupportRelativeLayout.java │ │ ├── SupportFeatureButton.java │ │ ├── SupportFeatureTextView.java │ │ ├── SupportFeatureImageView.java │ │ └── wrapper │ │ ├── WidgetTextWrapper.java │ │ ├── ImageFeature.java │ │ └── ColorStateListWrapper.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea └── vcs.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library_widget/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library_widget' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SupportWidgetSample 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/drawable/sample.png -------------------------------------------------------------------------------- /library_widget/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LibraryWidget 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/sample_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/drawable/sample_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/sample_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/drawable/sample_2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_collect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/drawable/ic_collect.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library_widget/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FengChenSunshine/SupportWidget/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 02 09:48:58 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | #008577 8 | #ffffff 9 | #000000 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/color/tint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8dp 5 | 5dp 6 | 8dp 7 | 180dp 8 | 2dp 9 | 5dp 10 | 5dp 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /library_widget/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /library_widget/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | defaultConfig { 7 | minSdkVersion 14 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0.0" 11 | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | testImplementation 'junit:junit:4.12' 25 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 26 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 27 | 28 | implementation 'com.android.support:appcompat-v7:28.0.0' 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/annotation/Status.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.annotation; 2 | 3 | import android.support.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /******************************** 9 | * @name Status 10 | * @author 段露 11 | * @createDate 2019/07/30 16:44 12 | * @updateDate 2019/07/30 16:44 13 | * @version V1.0.0 14 | * @describe 状态. 15 | ********************************/ 16 | @IntDef({Status.NORMAL, Status.PRESSED, Status.FOCUSED, Status.CHECKED 17 | , Status.CHECKABLE, Status.SELECTED, Status.ENABLED, Status.DISABLED}) 18 | @Retention(RetentionPolicy.CLASS) 19 | public @interface Status { 20 | 21 | int DISABLED = 7; 22 | int ENABLED = 6; 23 | int SELECTED = 5; 24 | int CHECKABLE = 4; 25 | int CHECKED = 3; 26 | int FOCUSED = 2; 27 | int PRESSED = 1; 28 | int NORMAL = 0; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.duanlu.widget.sample" 7 | minSdkVersion 14 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(dir: 'libs', include: ['*.jar']) 23 | implementation 'com.android.support:appcompat-v7:28.0.0' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 25 | testImplementation 'junit:junit:4.12' 26 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 28 | 29 | //google弹性布局:https://github.com/google/flexbox-layout 30 | implementation 'com.google.android:flexbox:1.0.0' 31 | 32 | implementation project(':library_widget') 33 | } 34 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportRadioGroup.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RadioGroup; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | 9 | /******************************** 10 | * @name SupportRadioGroup 11 | * @author 段露 12 | * @createDate 2019/07/30 11:48 13 | * @updateDate 2019/07/30 11:48 14 | * @version V1.0.0 15 | * @describe RadioGroup. 16 | ********************************/ 17 | public class SupportRadioGroup extends RadioGroup { 18 | 19 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 20 | 21 | public SupportRadioGroup(Context context) { 22 | super(context); 23 | this.initView(context, null, 0); 24 | } 25 | 26 | public SupportRadioGroup(Context context, AttributeSet attrs) { 27 | super(context, attrs); 28 | this.initView(context, attrs, 0); 29 | } 30 | 31 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 32 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 33 | } 34 | 35 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 36 | return mWidgetDrawableWrapper; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 21 | 28 | 29 | 30 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/utils/WidgetUtils.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.utils; 2 | 3 | import android.content.res.TypedArray; 4 | import android.support.annotation.NonNull; 5 | import android.util.TypedValue; 6 | 7 | /******************************** 8 | * @name WidgetUtils 9 | * @author 段露 10 | * @createDate 2019/07/30 10:49 11 | * @updateDate 2019/07/30 10:49 12 | * @version V1.0.0 13 | * @describe Utils. 14 | ********************************/ 15 | public final class WidgetUtils { 16 | 17 | public static int getColor(@NonNull TypedArray typedArray, int index, int defaultColor) { 18 | return typedArray.getColor(index, defaultColor); 19 | } 20 | 21 | public static float getFloatOrFraction(TypedArray a, int index, float defaultValue) { 22 | TypedValue tv = a.peekValue(index); 23 | if (tv != null) { 24 | boolean vIsFraction = tv.type == TypedValue.TYPE_FRACTION; 25 | return vIsFraction ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); 26 | } 27 | return defaultValue; 28 | } 29 | 30 | public static boolean addIfExistColorWithState(int color, int[] colors, int states[][], int[] state, int index) { 31 | if (1 != color) { 32 | colors[index] = color; 33 | states[index] = state; 34 | return true; 35 | } 36 | return false; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportImageView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatImageView; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | 9 | /******************************** 10 | * @name SupportImageView 11 | * @author 段露 12 | * @createDate 2019/07/30 11:50 13 | * @updateDate 2019/07/30 11:50 14 | * @version V1.0.0 15 | * @describe AppCompatImageView. 16 | ********************************/ 17 | public class SupportImageView extends AppCompatImageView { 18 | 19 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 20 | 21 | public SupportImageView(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public SupportImageView(Context context, AttributeSet attrs) { 26 | this(context, attrs, 0); 27 | } 28 | 29 | public SupportImageView(Context context, AttributeSet attrs, int defStyleAttr) { 30 | super(context, attrs, defStyleAttr); 31 | this.initView(context, attrs, defStyleAttr); 32 | } 33 | 34 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 35 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 36 | } 37 | 38 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 39 | return mWidgetDrawableWrapper; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/constants/WidgetConstants.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.constants; 2 | 3 | /******************************** 4 | * @name WidgetConstants 5 | * @author 段露 6 | * @createDate 2019/07/30 10:50 7 | * @updateDate 2019/07/30 10:50 8 | * @version V1.0.0 9 | * @describe Constants. 10 | ********************************/ 11 | public final class WidgetConstants { 12 | 13 | public static final int[] DISABLED = new int[]{-android.R.attr.state_enabled}; 14 | public static final int[] ENABLED = new int[]{android.R.attr.state_enabled}; 15 | public static final int[] SELECTED = new int[]{android.R.attr.state_selected}; 16 | public static final int[] CHECKABLE = new int[]{android.R.attr.state_checkable}; 17 | public static final int[] CHECKED = new int[]{android.R.attr.state_checked}; 18 | public static final int[] FOCUSED = new int[]{android.R.attr.state_focused}; 19 | public static final int[] PRESSED = new int[]{android.R.attr.state_pressed, android.R.attr.state_enabled}; 20 | public static final int[] NORMAL = new int[]{}; 21 | 22 | public static final int[][] STATUS = new int[][]{DISABLED, PRESSED, SELECTED, CHECKED, FOCUSED, NORMAL}; 23 | public static final int[][] STATUS_NO_CHECKED = new int[][]{DISABLED, PRESSED, SELECTED, FOCUSED, NORMAL}; 24 | //enabled=false; 25 | //pressed=true、enabled=true. 26 | //selected=true. 27 | //focused=true. 28 | //default. 29 | 30 | } 31 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportSearchView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.SearchView; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | 9 | /******************************** 10 | * @name SupportSearchView 11 | * @author 段露 12 | * @createDate 2019/07/30 11:55 13 | * @updateDate 2019/07/30 11:55 14 | * @version V1.0.0 15 | * @describe SearchView. 16 | ********************************/ 17 | public class SupportSearchView extends SearchView { 18 | 19 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 20 | 21 | public SupportSearchView(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public SupportSearchView(Context context, AttributeSet attrs) { 26 | this(context, attrs, android.support.v7.appcompat.R.attr.searchViewStyle); 27 | } 28 | 29 | public SupportSearchView(Context context, AttributeSet attrs, int defStyleAttr) { 30 | super(context, attrs, defStyleAttr); 31 | this.initView(context, attrs, defStyleAttr); 32 | } 33 | 34 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 35 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 36 | } 37 | 38 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 39 | return mWidgetDrawableWrapper; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportImageButton.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatImageButton; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | 9 | /******************************** 10 | * @name SupportImageButton 11 | * @author 段露 12 | * @createDate 2019/07/30 11:53 13 | * @updateDate 2019/07/30 11:53 14 | * @version V1.0.0 15 | * @describe AppCompatImageButton. 16 | ********************************/ 17 | public class SupportImageButton extends AppCompatImageButton { 18 | 19 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 20 | 21 | public SupportImageButton(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public SupportImageButton(Context context, AttributeSet attrs) { 26 | this(context, attrs, android.support.v7.appcompat.R.attr.imageButtonStyle); 27 | } 28 | 29 | public SupportImageButton(Context context, AttributeSet attrs, int defStyleAttr) { 30 | super(context, attrs, defStyleAttr); 31 | this.initView(context, attrs, defStyleAttr); 32 | } 33 | 34 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 35 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 36 | } 37 | 38 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 39 | return mWidgetDrawableWrapper; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportButton.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatButton; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportButton 12 | * @author 段露 13 | * @createDate 2019/07/29 09:04 14 | * @updateDate 2019/07/29 09:04 15 | * @version V1.0.0 16 | * @describe AppCompatButton. 17 | ********************************/ 18 | public class SupportButton extends AppCompatButton { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportButton(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportButton(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.buttonStyle); 28 | } 29 | 30 | public SupportButton(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportEditText.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatEditText; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportButton 12 | * @author 段露 13 | * @createDate 2019/07/29 18:10 14 | * @updateDate 2019/07/29 18:10 15 | * @version V1.0.0 16 | * @describe AppCompatEditText. 17 | ********************************/ 18 | public class SupportEditText extends AppCompatEditText { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportEditText(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportEditText(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.editTextStyle); 28 | } 29 | 30 | public SupportEditText(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportCheckBox.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatCheckBox; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportCheckBox 12 | * @author 段露 13 | * @createDate 2019/07/30 10:04 14 | * @updateDate 2019/07/30 10:04 15 | * @version V1.0.0 16 | * @describe AppCompatCheckBox. 17 | ********************************/ 18 | public class SupportCheckBox extends AppCompatCheckBox { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportCheckBox(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportCheckBox(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.checkboxStyle); 28 | } 29 | 30 | public SupportCheckBox(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportTextView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatTextView; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportTextView 12 | * @author 段露 13 | * @createDate 2019/07/30 11:19 14 | * @updateDate 2019/07/30 11:19 15 | * @version V1.0.0 16 | * @describe AppCompatTextView. 17 | ********************************/ 18 | public class SupportTextView extends AppCompatTextView { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportTextView(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportTextView(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.R.attr.textViewStyle); 28 | } 29 | 30 | public SupportTextView(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr, 0); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportRadioButton.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatRadioButton; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportRadioButton 12 | * @author 段露 13 | * @createDate 2019/07/30 11:48 14 | * @updateDate 2019/07/30 11:48 15 | * @version V1.0.0 16 | * @describe AppCompatRadioButton. 17 | ********************************/ 18 | public class SupportRadioButton extends AppCompatRadioButton { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportRadioButton(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportRadioButton(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.radioButtonStyle); 28 | } 29 | 30 | public SupportRadioButton(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportAutoCompleteTextView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatAutoCompleteTextView; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportAutoCompleteTextView 12 | * @author 段露 13 | * @createDate 2019/07/30 11:59 14 | * @updateDate 2019/07/30 11:59 15 | * @version V1.0.0 16 | * @describe AutoCompleteTextView. 17 | ********************************/ 18 | public class SupportAutoCompleteTextView extends AppCompatAutoCompleteTextView { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportAutoCompleteTextView(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportAutoCompleteTextView(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.autoCompleteTextViewStyle); 28 | } 29 | 30 | public SupportAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/duanlu/widget/sample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.sample; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.widget.Checkable; 7 | 8 | /******************************** 9 | * @name MainActivity 10 | * @author 段露 11 | * @createDate 2019/7/31 18:33 12 | * @updateDate 2019/7/31 18:33 13 | * @version V1.0.0 14 | * @describe 示例. 15 | ********************************/ 16 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_main); 22 | 23 | findViewById(R.id.sbtn_selected_sample).setSelected(true); 24 | 25 | findViewById(R.id.tint).setOnClickListener(this); 26 | findViewById(R.id.tint).setSelected(true); 27 | } 28 | 29 | @Override 30 | public void onClick(View v) { 31 | int id = v.getId(); 32 | } 33 | 34 | private void enabled(View... views) { 35 | for (View view : views) { 36 | view.setEnabled(!view.isEnabled()); 37 | } 38 | } 39 | 40 | private void selected(View... views) { 41 | for (View view : views) { 42 | view.setSelected(!view.isSelected()); 43 | } 44 | } 45 | 46 | private void checked(View... views) { 47 | Checkable checkable; 48 | for (View view : views) { 49 | if (view instanceof Checkable) { 50 | checkable = (Checkable) view; 51 | checkable.setChecked(!checkable.isChecked()); 52 | } 53 | } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportMultiAutoCompleteTextView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatMultiAutoCompleteTextView; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 8 | import com.duanlu.widget.wrapper.WidgetTextWrapper; 9 | 10 | /******************************** 11 | * @name SupportMultiAutoCompleteTextView 12 | * @author 段露 13 | * @createDate 2019/07/30 12:00 14 | * @updateDate 2019/07/30 12:00 15 | * @version V1.0.0 16 | * @describe MultiAutoCompleteTextView. 17 | ********************************/ 18 | public class SupportMultiAutoCompleteTextView extends AppCompatMultiAutoCompleteTextView { 19 | 20 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 21 | 22 | public SupportMultiAutoCompleteTextView(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportMultiAutoCompleteTextView(Context context, AttributeSet attrs) { 27 | this(context, attrs, android.support.v7.appcompat.R.attr.autoCompleteTextViewStyle); 28 | } 29 | 30 | public SupportMultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, 0); 37 | new WidgetTextWrapper(this, attrs, defStyleAttr, 0); 38 | } 39 | 40 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 41 | return mWidgetDrawableWrapper; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportViewGroup.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.util.AttributeSet; 7 | import android.view.ViewGroup; 8 | 9 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 10 | 11 | /******************************** 12 | * @name SupportViewGroup 13 | * @author 段露 14 | * @createDate 2019/07/30 12:04 15 | * @updateDate 2019/07/30 12:04 16 | * @version V1.0.0 17 | * @describe ViewGroup. 18 | ********************************/ 19 | public abstract class SupportViewGroup extends ViewGroup { 20 | 21 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 22 | 23 | public SupportViewGroup(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public SupportViewGroup(Context context, AttributeSet attrs) { 28 | this(context, attrs, 0); 29 | } 30 | 31 | public SupportViewGroup(Context context, AttributeSet attrs, int defStyleAttr) { 32 | super(context, attrs, defStyleAttr); 33 | this.initView(context, attrs, defStyleAttr, 0); 34 | } 35 | 36 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 37 | public SupportViewGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 38 | super(context, attrs, defStyleAttr, defStyleRes); 39 | this.initView(context, attrs, defStyleAttr, 0); 40 | } 41 | 42 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 43 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 44 | } 45 | 46 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 47 | return mWidgetDrawableWrapper; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.support.annotation.Nullable; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | 10 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 11 | 12 | /******************************** 13 | * @name SupportView 14 | * @author 段露 15 | * @createDate 2019/07/29 18:14 16 | * @updateDate 2019/07/29 18:14 17 | * @version V1.0.0 18 | * @describe View. 19 | ********************************/ 20 | public class SupportView extends View { 21 | 22 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 23 | 24 | public SupportView(Context context) { 25 | this(context, null); 26 | } 27 | 28 | public SupportView(Context context, @Nullable AttributeSet attrs) { 29 | this(context, attrs, 0); 30 | } 31 | 32 | public SupportView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | this.initView(context, attrs, defStyleAttr, 0); 35 | } 36 | 37 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 38 | public SupportView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 39 | super(context, attrs, defStyleAttr, defStyleRes); 40 | this.initView(context, attrs, defStyleAttr, defStyleRes); 41 | } 42 | 43 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 44 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 45 | } 46 | 47 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 48 | return mWidgetDrawableWrapper; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportFrameLayout.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.support.annotation.Nullable; 7 | import android.util.AttributeSet; 8 | import android.widget.FrameLayout; 9 | 10 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 11 | 12 | /******************************** 13 | * @name SupportFrameLayout 14 | * @author 段露 15 | * @createDate 2019/07/30 11:12 16 | * @updateDate 2019/07/30 11:12 17 | * @version V1.0.0 18 | * @describe FrameLayout. 19 | ********************************/ 20 | public class SupportFrameLayout extends FrameLayout { 21 | 22 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 23 | 24 | public SupportFrameLayout(Context context) { 25 | this(context, null); 26 | } 27 | 28 | public SupportFrameLayout(Context context, @Nullable AttributeSet attrs) { 29 | this(context, attrs, 0); 30 | } 31 | 32 | public SupportFrameLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | this.initView(context, attrs, defStyleAttr, 0); 35 | } 36 | 37 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 38 | public SupportFrameLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 39 | super(context, attrs, defStyleAttr, defStyleRes); 40 | this.initView(context, attrs, defStyleAttr, defStyleRes); 41 | } 42 | 43 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 44 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 45 | } 46 | 47 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 48 | return mWidgetDrawableWrapper; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportLinearLayout.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.support.annotation.Nullable; 7 | import android.util.AttributeSet; 8 | import android.widget.LinearLayout; 9 | 10 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 11 | 12 | /******************************** 13 | * @name SupportLinearLayout 14 | * @author 段露 15 | * @createDate 2019/07/30 11:06 16 | * @updateDate 2019/07/30 11:06 17 | * @version V1.0.0 18 | * @describe LinearLayout. 19 | ********************************/ 20 | public class SupportLinearLayout extends LinearLayout { 21 | 22 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 23 | 24 | public SupportLinearLayout(Context context) { 25 | this(context, null); 26 | } 27 | 28 | public SupportLinearLayout(Context context, @Nullable AttributeSet attrs) { 29 | this(context, attrs, 0); 30 | } 31 | 32 | public SupportLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | this.initView(context, attrs, defStyleAttr, 0); 35 | } 36 | 37 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 38 | public SupportLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 39 | super(context, attrs, defStyleAttr, defStyleRes); 40 | this.initView(context, attrs, defStyleAttr, defStyleRes); 41 | } 42 | 43 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 44 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 45 | } 46 | 47 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 48 | return mWidgetDrawableWrapper; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportRelativeLayout.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.support.annotation.Nullable; 7 | import android.util.AttributeSet; 8 | import android.widget.RelativeLayout; 9 | 10 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 11 | 12 | /******************************** 13 | * @name SupportRelativeLayout 14 | * @author 段露 15 | * @createDate 2019/07/30 11:11 16 | * @updateDate 2019/07/30 11:11 17 | * @version V1.0.0 18 | * @describe RelativeLayout. 19 | ********************************/ 20 | public class SupportRelativeLayout extends RelativeLayout { 21 | 22 | private WidgetDrawableWrapper mWidgetDrawableWrapper; 23 | 24 | public SupportRelativeLayout(Context context) { 25 | this(context, null); 26 | } 27 | 28 | public SupportRelativeLayout(Context context, @Nullable AttributeSet attrs) { 29 | this(context, attrs, 0); 30 | } 31 | 32 | public SupportRelativeLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | this.initView(context, attrs, defStyleAttr, 0); 35 | } 36 | 37 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 38 | public SupportRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 39 | super(context, attrs, defStyleAttr, defStyleRes); 40 | this.initView(context, attrs, defStyleAttr, defStyleRes); 41 | } 42 | 43 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 44 | mWidgetDrawableWrapper = new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 45 | } 46 | 47 | public WidgetDrawableWrapper getWidgetDrawableWrapper() { 48 | return mWidgetDrawableWrapper; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportFeatureButton.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.TextFeature; 8 | 9 | /******************************** 10 | * @name SupportTextView 11 | * @author 段露 12 | * @createDate 2019/07/31 12:09 13 | * @updateDate 2019/07/31 12:09 14 | * @version V1.0.0 15 | * @describe 带描边、渐变色等功能的SSupportButton. 16 | ********************************/ 17 | public class SupportFeatureButton extends SupportButton { 18 | 19 | private TextFeature mTextFeature; 20 | 21 | public SupportFeatureButton(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public SupportFeatureButton(Context context, AttributeSet attrs) { 26 | this(context, attrs, android.support.v7.appcompat.R.attr.buttonStyle); 27 | } 28 | 29 | public SupportFeatureButton(Context context, AttributeSet attrs, int defStyleAttr) { 30 | super(context, attrs, defStyleAttr); 31 | this.initView(context, attrs, defStyleAttr, 0); 32 | } 33 | 34 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 35 | mTextFeature = new TextFeature(this, attrs, defStyleAttr, defStyleRes); 36 | } 37 | 38 | @Override 39 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 40 | super.onSizeChanged(w, h, oldw, oldh); 41 | if (null != mTextFeature) mTextFeature.invalidateShader(); 42 | } 43 | 44 | @Override 45 | protected void onDraw(Canvas canvas) { 46 | if (mTextFeature.isContour()) { 47 | mTextFeature.prepareDrawContour(); 48 | super.onDraw(canvas); 49 | mTextFeature.prepareSuperDraw(); 50 | } 51 | super.onDraw(canvas); 52 | } 53 | 54 | public TextFeature getTextFeature() { 55 | return mTextFeature; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportFeatureTextView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.util.AttributeSet; 6 | 7 | import com.duanlu.widget.wrapper.TextFeature; 8 | 9 | /******************************** 10 | * @name SupportTextView 11 | * @author 段露 12 | * @createDate 2019/07/30 14:26 13 | * @updateDate 2019/07/30 14:26 14 | * @version V1.0.0 15 | * @describe 带描边、渐变色等功能的AppCompatTextView. 16 | ********************************/ 17 | public class SupportFeatureTextView extends SupportTextView { 18 | 19 | private TextFeature mTextFeature; 20 | 21 | public SupportFeatureTextView(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public SupportFeatureTextView(Context context, AttributeSet attrs) { 26 | this(context, attrs, android.R.attr.textViewStyle); 27 | } 28 | 29 | public SupportFeatureTextView(Context context, AttributeSet attrs, int defStyleAttr) { 30 | super(context, attrs, defStyleAttr); 31 | this.initView(context, attrs, defStyleAttr, 0); 32 | } 33 | 34 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 35 | mTextFeature = new TextFeature(this, attrs, defStyleAttr, defStyleRes); 36 | } 37 | 38 | @Override 39 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 40 | super.onSizeChanged(w, h, oldw, oldh); 41 | if (null != mTextFeature) mTextFeature.invalidateShader(); 42 | } 43 | 44 | @Override 45 | protected void onDraw(Canvas canvas) { 46 | if (mTextFeature.isContour()) { 47 | mTextFeature.prepareDrawContour(); 48 | super.onDraw(canvas); 49 | mTextFeature.prepareSuperDraw(); 50 | } 51 | super.onDraw(canvas); 52 | } 53 | 54 | public TextFeature getTextFeature() { 55 | return mTextFeature; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/SupportFeatureImageView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.drawable.Drawable; 6 | import android.util.AttributeSet; 7 | 8 | import com.duanlu.widget.wrapper.ImageFeature; 9 | 10 | /******************************** 11 | * @name SupportFeatureImageView 12 | * @author 段露 13 | * @createDate 2019/08/01 10:53 14 | * @updateDate 2019/08/01 10:53 15 | * @version V1.0.0 16 | * @describe 带Tint(着色)等功能的SupportImageView. 17 | ********************************/ 18 | public class SupportFeatureImageView extends SupportImageView { 19 | 20 | private ImageFeature mImageFeature; 21 | 22 | public SupportFeatureImageView(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public SupportFeatureImageView(Context context, AttributeSet attrs) { 27 | this(context, attrs, 0); 28 | } 29 | 30 | public SupportFeatureImageView(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.initView(context, attrs, defStyleAttr, 0); 33 | } 34 | 35 | private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 36 | mImageFeature = new ImageFeature(this, attrs, defStyleAttr, defStyleRes); 37 | } 38 | 39 | @Override 40 | protected void onDraw(Canvas canvas) { 41 | Drawable drawable = getDrawable(); 42 | Float rotateDegrees = mImageFeature.getRotateDegrees(); 43 | if (null != rotateDegrees && null != drawable) { 44 | canvas.save(); 45 | canvas.rotate(rotateDegrees, getWidth() / 2.0f, getHeight() / 2.0f); 46 | super.onDraw(canvas); 47 | canvas.restore(); 48 | } else { 49 | super.onDraw(canvas); 50 | } 51 | } 52 | 53 | public ImageFeature getImageFeature() { 54 | return mImageFeature; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/duanlu/widget/sample/CustomView.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.sample; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.support.annotation.Nullable; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | 10 | import com.duanlu.widget.wrapper.WidgetDrawableWrapper; 11 | 12 | /******************************** 13 | * @name CustomView 14 | * @author 段露 15 | * @company 浙江托普云农科技股份有限公司 16 | * @createDate 2019/08/02 09:00 17 | * @updateDate 2019/08/02 09:00 18 | * @version V1.0.0 19 | * @describe TODO 20 | ********************************/ 21 | public class CustomView extends View { 22 | 23 | public CustomView(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public CustomView(Context context, @Nullable AttributeSet attrs) { 28 | this(context, attrs, 0); 29 | } 30 | 31 | public CustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 32 | super(context, attrs, defStyleAttr); 33 | this.initView(context, attrs, defStyleAttr, 0); 34 | } 35 | 36 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 37 | public CustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { 38 | super(context, attrs, defStyleAttr, defStyleRes); 39 | this.initView(context, attrs, defStyleAttr, defStyleRes); 40 | } 41 | 42 | private void initView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { 43 | //实现背景选择器功能. 44 | new WidgetDrawableWrapper(this, attrs, defStyleAttr, defStyleRes); 45 | //实现文本颜色选择器功能(注意:第一个参数必须是TextView的子类). 46 | //new WidgetTextWrapper(this, attrs, defStyleAttr, defStyleRes); 47 | //实现文本描边、渐变等功能(注意:第一个参数必须是TextView的子类). 48 | //new TextFeature(this, attrs, defStyleAttr, defStyleRes); 49 | //实现图片着色、旋转灯等功能(注意:第一个参数必须是AppCompatImageView的子类). 50 | //new ImageFeature(this, attrs, defStyleAttr, defStyleRes); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/wrapper/WidgetTextWrapper.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.wrapper; 2 | 3 | import android.content.res.ColorStateList; 4 | import android.content.res.TypedArray; 5 | import android.util.AttributeSet; 6 | import android.widget.TextView; 7 | 8 | import com.duanlu.widget.R; 9 | 10 | /******************************** 11 | * @name WidgetTextWrapper 12 | * @author 段露 13 | * @createDate 2019/07/30 15:52 14 | * @updateDate 2019/07/30 15:52 15 | * @version V1.0.0 16 | * @describe WidgetTextWrapper. 17 | ********************************/ 18 | public class WidgetTextWrapper { 19 | 20 | private TextView mTarget; 21 | 22 | public WidgetTextWrapper(TextView target, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 23 | this.mTarget = target; 24 | this.parseTypeArray(target, attrs, defStyleAttr, defStyleRes); 25 | } 26 | 27 | private void parseTypeArray(TextView target, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 28 | TypedArray typedArray = target.getContext().obtainStyledAttributes(attrs, R.styleable.SupportWidgetText, defStyleAttr, defStyleRes); 29 | 30 | if (typedArray.hasValue(R.styleable.SupportWidgetText_widget_text_color)) { 31 | setTextColor(typedArray); 32 | } 33 | if (typedArray.hasValue(R.styleable.SupportWidgetText_widget_hint_text_color)) { 34 | setHintTextColor(typedArray); 35 | } 36 | 37 | typedArray.recycle(); 38 | } 39 | 40 | private void setTextColor(TypedArray typedArray) { 41 | ColorStateList colorStateList = ColorStateListWrapper.create(typedArray, mTarget.getCurrentTextColor() 42 | , R.styleable.SupportWidgetText_widget_text_color 43 | , R.styleable.SupportWidgetText_widget_disabled_text_color 44 | , R.styleable.SupportWidgetText_widget_pressed_text_color 45 | , R.styleable.SupportWidgetText_widget_selected_text_color 46 | , R.styleable.SupportWidgetText_widget_checked_text_color 47 | , R.styleable.SupportWidgetText_widget_focused_text_color); 48 | 49 | mTarget.setTextColor(colorStateList); 50 | } 51 | 52 | private void setHintTextColor(TypedArray typedArray) { 53 | ColorStateList colorStateList = ColorStateListWrapper.create(typedArray, mTarget.getCurrentHintTextColor() 54 | , R.styleable.SupportWidgetText_widget_hint_text_color 55 | , R.styleable.SupportWidgetText_widget_disabled_hint_text_color 56 | , R.styleable.SupportWidgetText_widget_pressed_hint_text_color 57 | , R.styleable.SupportWidgetText_widget_selected_hint_text_color 58 | , R.styleable.SupportWidgetText_widget_checked_hint_text_color 59 | , R.styleable.SupportWidgetText_widget_focused_hint_text_color); 60 | 61 | mTarget.setHintTextColor(colorStateList); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/wrapper/ImageFeature.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.wrapper; 2 | 3 | import android.content.res.TypedArray; 4 | import android.os.Build; 5 | import android.support.annotation.Nullable; 6 | import android.support.v7.widget.AppCompatImageView; 7 | import android.util.AttributeSet; 8 | 9 | import com.duanlu.widget.R; 10 | import com.duanlu.widget.utils.WidgetUtils; 11 | 12 | /******************************** 13 | * @name ImageFeature 14 | * @author 段露 15 | * @createDate 2019/08/01 10:55 16 | * @updateDate 2019/08/01 10:55 17 | * @version V1.0.0 18 | * @describe Tint(着色)等功能实现. 19 | ********************************/ 20 | public final class ImageFeature { 21 | 22 | private AppCompatImageView mTarget; 23 | private Float mRotateDegrees; 24 | 25 | public ImageFeature(AppCompatImageView target, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 26 | this.mTarget = target; 27 | this.parseTypeArray(target, attrs, defStyleAttr, defStyleRes); 28 | } 29 | 30 | private void parseTypeArray(AppCompatImageView target, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 31 | TypedArray typedArray = target.getContext().obtainStyledAttributes(attrs, R.styleable.SupportWidgetImageFeature, defStyleAttr, defStyleRes); 32 | 33 | parseTintColor(typedArray); 34 | parseRotateDegrees(typedArray); 35 | 36 | typedArray.recycle(); 37 | } 38 | 39 | /** 40 | * 解析Tint参数. 41 | */ 42 | private void parseTintColor(TypedArray typedArray) { 43 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 44 | ColorStateListWrapper tintColor = ColorStateListWrapper.parseCreate(typedArray 45 | , R.styleable.SupportWidgetImageFeature_widget_src_tint 46 | , R.styleable.SupportWidgetImageFeature_widget_disabled_src_tint 47 | , R.styleable.SupportWidgetImageFeature_widget_pressed_src_tint 48 | , R.styleable.SupportWidgetImageFeature_widget_selected_src_tint 49 | , R.styleable.SupportWidgetImageFeature_widget_checked_src_tint 50 | , R.styleable.SupportWidgetImageFeature_widget_focused_src_tint); 51 | if (null != tintColor) mTarget.setImageTintList(tintColor); 52 | } 53 | } 54 | 55 | /** 56 | * 解析RotateDegrees参数. 57 | */ 58 | private void parseRotateDegrees(TypedArray typedArray) { 59 | if (typedArray.hasValue(R.styleable.SupportWidgetImageFeature_widget_src_rotate_degrees)) { 60 | this.mRotateDegrees = WidgetUtils.getFloatOrFraction(typedArray, R.styleable.SupportWidgetImageFeature_widget_src_rotate_degrees, 0); 61 | } 62 | } 63 | 64 | @Nullable 65 | public Float getRotateDegrees() { 66 | return mRotateDegrees; 67 | } 68 | 69 | public void setRotateDegrees(float rotateDegrees) { 70 | this.mRotateDegrees = rotateDegrees; 71 | mTarget.invalidate(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | //////////////////////////////////////////////////////////////////// 5 | /////---------------------------Text---------------------------///// 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 | /////---------------------------Image--------------------------///// 45 | //////////////////////////////////////////////////////////////////// 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_state_checked.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_state_focused.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_state_pressed.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_state_disabled.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_state_selected.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /library_widget/src/main/java/com/duanlu/widget/wrapper/ColorStateListWrapper.java: -------------------------------------------------------------------------------- 1 | package com.duanlu.widget.wrapper; 2 | 3 | import android.content.res.ColorStateList; 4 | import android.content.res.TypedArray; 5 | import android.support.annotation.Nullable; 6 | 7 | import com.duanlu.widget.constants.WidgetConstants; 8 | import com.duanlu.widget.utils.WidgetUtils; 9 | 10 | /******************************** 11 | * @name ColorStateListWrapper 12 | * @author 段露 13 | * @createDate 2019/07/30 10:48 14 | * @updateDate 2019/07/30 10:48 15 | * @version V1.0.0 16 | * @describe ColorStateList. 17 | ********************************/ 18 | public class ColorStateListWrapper extends ColorStateList { 19 | 20 | static ColorStateListWrapper create(TypedArray typedArray, int defaultColor 21 | , int colorIndex 22 | , int disabledColorIndex 23 | , int pressedColorIndex 24 | , int selectedColorIndex 25 | , int checkedColorIndex 26 | , int focusedColorIndex) { 27 | 28 | int[][] states; 29 | int[] colors; 30 | if (typedArray.hasValue(checkedColorIndex)) { 31 | states = WidgetConstants.STATUS; 32 | 33 | colors = new int[6]; 34 | colors[5] = WidgetUtils.getColor(typedArray, colorIndex, defaultColor); 35 | colors[0] = WidgetUtils.getColor(typedArray, disabledColorIndex, colors[5]); 36 | colors[1] = WidgetUtils.getColor(typedArray, pressedColorIndex, colors[5]); 37 | colors[2] = WidgetUtils.getColor(typedArray, selectedColorIndex, colors[5]); 38 | colors[3] = WidgetUtils.getColor(typedArray, checkedColorIndex, colors[5]); 39 | colors[4] = WidgetUtils.getColor(typedArray, focusedColorIndex, colors[5]); 40 | } else { 41 | states = WidgetConstants.STATUS_NO_CHECKED; 42 | 43 | colors = new int[5]; 44 | colors[4] = WidgetUtils.getColor(typedArray, colorIndex, defaultColor); 45 | colors[0] = WidgetUtils.getColor(typedArray, disabledColorIndex, colors[4]); 46 | colors[1] = WidgetUtils.getColor(typedArray, pressedColorIndex, colors[4]); 47 | colors[2] = WidgetUtils.getColor(typedArray, selectedColorIndex, colors[4]); 48 | colors[3] = WidgetUtils.getColor(typedArray, focusedColorIndex, colors[4]); 49 | } 50 | return new ColorStateListWrapper(states, colors); 51 | } 52 | 53 | @Nullable 54 | static ColorStateListWrapper parseCreate(TypedArray typedArray 55 | , int colorIndex 56 | , int disabledColorIndex 57 | , int pressedColorIndex 58 | , int selectedColorIndex 59 | , int checkedColorIndex 60 | , int focusedColorIndex) { 61 | int color = WidgetUtils.getColor(typedArray, colorIndex, 1); 62 | int disabledColor = WidgetUtils.getColor(typedArray, disabledColorIndex, 1); 63 | int pressedColor = WidgetUtils.getColor(typedArray, pressedColorIndex, 1); 64 | int selectedColor = WidgetUtils.getColor(typedArray, selectedColorIndex, 1); 65 | int checkedColor = WidgetUtils.getColor(typedArray, checkedColorIndex, 1); 66 | int focusedColor = WidgetUtils.getColor(typedArray, focusedColorIndex, 1); 67 | 68 | int N = 6 - (1 == color ? 1 : 0) 69 | - (1 == disabledColor ? 1 : 0) 70 | - (1 == pressedColor ? 1 : 0) 71 | - (1 == selectedColor ? 1 : 0) 72 | - (1 == checkedColor ? 1 : 0) 73 | - (1 == focusedColor ? 1 : 0); 74 | if (N > 0) { 75 | int[] colors = new int[N]; 76 | int[][] states = new int[N][]; 77 | int index = 0; 78 | 79 | if (WidgetUtils.addIfExistColorWithState(disabledColor, colors, states, WidgetConstants.DISABLED, index)) { 80 | index++; 81 | } 82 | if (WidgetUtils.addIfExistColorWithState(pressedColor, colors, states, WidgetConstants.PRESSED, index)) { 83 | index++; 84 | } 85 | if (WidgetUtils.addIfExistColorWithState(selectedColor, colors, states, WidgetConstants.SELECTED, index)) { 86 | index++; 87 | } 88 | if (WidgetUtils.addIfExistColorWithState(checkedColor, colors, states, WidgetConstants.CHECKED, index)) { 89 | index++; 90 | } 91 | if (WidgetUtils.addIfExistColorWithState(focusedColor, colors, states, WidgetConstants.FOCUSED, index)) { 92 | index++; 93 | } 94 | WidgetUtils.addIfExistColorWithState(color, colors, states, WidgetConstants.NORMAL, index); 95 | 96 | return new ColorStateListWrapper(states, colors); 97 | } 98 | return null; 99 | } 100 | 101 | private ColorStateListWrapper(int[][] states, int[] colors) { 102 | super(states, colors); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 16 | 17 | 25 | 26 | 32 | 33 | 36 | 37 | 43 | 44 | 47 | 48 | 53 | 54 | 57 | 58 | 64 | 65 | 68 | 69 | 75 | 76 | 83 | 84 | 87 | 88 | 94 | 95 | 101 | 102 | 107 | 108 | 111 | 112 | 118 | 119 | 125 | 126 | 142 | 143 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_View.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_ImageView.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_ViewGroup.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_FrameLayout.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_ImageButton.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_RadioGroup.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_SearchView.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_LinearLayout.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_RelativeLayout.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_FeatureImageView.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_Button.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_CheckBox.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_EditText.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /library_widget/src/main/res/values/attrs_TextView.xml: -------------------------------------------------------------------------------- 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 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | --------------------------------------------------------------------------------