├── .gitignore ├── BackgroundLibrary.xml ├── LICENSE ├── README-EN.md ├── README.md ├── androidx ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── noober │ │ └── androidx │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── noober │ │ │ └── androidx │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── rg_select.png │ │ └── rg_unselect.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── noober │ └── androidx │ └── ExampleUnitTest.java ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── noober │ │ └── backgroudlibrary │ │ ├── BlankFragment.java │ │ ├── KTActivity.kt │ │ ├── ListActivity.java │ │ ├── MainActivity.java │ │ └── MyApplication.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ ├── background.png │ ├── circle_like_normal.png │ ├── circle_like_pressed.png │ ├── downbtn_blue.xml │ ├── ic_launcher_background.xml │ ├── img00.png │ ├── img01.png │ ├── img02.png │ ├── img03.png │ ├── img04.png │ ├── img05.png │ ├── img06.png │ ├── img07.png │ ├── img08.png │ ├── img09.png │ ├── img10.png │ ├── img11.png │ ├── img12.png │ ├── img13.png │ ├── img14.png │ ├── sel_text_color.xml │ ├── selector_circle_like.xml │ ├── shape1.xml │ ├── shape_gender_green.xml │ ├── shape_gender_red.xml │ ├── shape_login_button.xml │ ├── test.xml │ ├── test_bg.xml │ ├── test_bg1.xml │ ├── test_bg2.xml │ ├── test_bg3.xml │ ├── test_bg4.xml │ ├── test_bg5.xml │ ├── test_bg6.xml │ ├── test_bg_sel.xml │ ├── test_bg_sel2.xml │ ├── test_ripple1_shape.xml │ ├── test_ripple2_shape.xml │ ├── test_sel.xml │ ├── test_sel1.xml │ ├── test_sel2.xml │ └── test_sel3.xml │ ├── layout │ ├── activity_data_binding.xml │ ├── activity_kt.xml │ ├── activity_list.xml │ ├── activity_main.xml │ ├── activity_main2.xml │ ├── fragment_blank.xml │ ├── fragment_blank2.xml │ ├── item.xml │ └── item2.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── rg_select.png │ └── rg_unselect.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── rg_select.png │ └── rg_unselect.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── fix.png ├── gif.gif ├── gif1.gif ├── gif2.gif ├── mulit_text.gif ├── preview.gif └── textChange.gif ├── library ├── .gitignore ├── background-proguard-rules.pro ├── build.gradle └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── noober │ │ └── background │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── noober │ │ │ └── background │ │ │ ├── BLActivityLifecycleRegister.java │ │ │ ├── BLAutoInjectController.java │ │ │ ├── BackgroundContentProvider.java │ │ │ ├── BackgroundFactory.java │ │ │ ├── BackgroundLibrary.java │ │ │ ├── annotation │ │ │ └── BLUsed.java │ │ │ ├── common │ │ │ ├── MultiSelector.java │ │ │ └── ResourceUtils.java │ │ │ ├── drawable │ │ │ ├── AnimationDrawableCreator.java │ │ │ ├── ButtonDrawableCreator.java │ │ │ ├── ColorStateCreator.java │ │ │ ├── DrawableCreator.java │ │ │ ├── DrawableFactory.java │ │ │ ├── GradientDrawableCreator.java │ │ │ ├── GradientStateDrawableCreator.java │ │ │ ├── ICreateColorState.java │ │ │ ├── ICreateDrawable.java │ │ │ ├── ITextViewOperator.java │ │ │ ├── MultiSelectorDrawableCreator.java │ │ │ ├── MultiTextColorSelectorColorCreator.java │ │ │ ├── PressDrawableCreator.java │ │ │ ├── SelectorDrawableCreator.java │ │ │ ├── SelectorPre21DrawableCreator.java │ │ │ ├── TextViewFactory.java │ │ │ └── TextViewGradientColor.java │ │ │ └── view │ │ │ ├── BLButton.java │ │ │ ├── BLCheckBox.java │ │ │ ├── BLConstraintLayout.java │ │ │ ├── BLEditText.java │ │ │ ├── BLFlow.java │ │ │ ├── BLFrameLayout.java │ │ │ ├── BLGridLayout.java │ │ │ ├── BLGridView.java │ │ │ ├── BLImageButton.java │ │ │ ├── BLImageView.java │ │ │ ├── BLLayer.java │ │ │ ├── BLLinearLayout.java │ │ │ ├── BLListView.java │ │ │ ├── BLRadioButton.java │ │ │ ├── BLRadioGroup.java │ │ │ ├── BLRelativeLayout.java │ │ │ ├── BLScrollView.java │ │ │ ├── BLTextView.java │ │ │ ├── BLView.java │ │ │ └── Const.java │ ├── res │ │ └── values │ │ │ └── attrs.xml │ └── resources │ │ └── META-INF │ │ └── proguard │ │ └── background_library.pro │ └── test │ └── java │ └── com │ └── noober │ └── background │ └── ExampleUnitTest.java ├── libraryx ├── .gitignore ├── background-proguard-rules.pro ├── build.gradle └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── noober │ │ └── background │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── noober │ │ │ └── background │ │ │ ├── BLActivityLifecycleRegister.java │ │ │ ├── BLAutoInjectController.java │ │ │ ├── BackgroundContentProvider.java │ │ │ ├── BackgroundFactory.java │ │ │ ├── BackgroundLibrary.java │ │ │ ├── common │ │ │ ├── MultiSelector.java │ │ │ └── ResourceUtils.java │ │ │ ├── drawable │ │ │ ├── AnimationDrawableCreator.java │ │ │ ├── ButtonDrawableCreator.java │ │ │ ├── ColorStateCreator.java │ │ │ ├── DrawableCreator.java │ │ │ ├── DrawableFactory.java │ │ │ ├── GradientDrawableCreator.java │ │ │ ├── GradientStateDrawableCreator.java │ │ │ ├── ICreateColorState.java │ │ │ ├── ICreateDrawable.java │ │ │ ├── ITextViewOperator.java │ │ │ ├── MultiSelectorDrawableCreator.java │ │ │ ├── MultiTextColorSelectorColorCreator.java │ │ │ ├── PressDrawableCreator.java │ │ │ ├── SelectorDrawableCreator.java │ │ │ ├── SelectorPre21DrawableCreator.java │ │ │ ├── TextViewFactory.java │ │ │ └── TextViewGradientColor.java │ │ │ └── view │ │ │ ├── BLButton.java │ │ │ ├── BLCheckBox.java │ │ │ ├── BLConstraintLayout.java │ │ │ ├── BLEditText.java │ │ │ ├── BLFrameLayout.java │ │ │ ├── BLGridLayout.java │ │ │ ├── BLGridView.java │ │ │ ├── BLImageButton.java │ │ │ ├── BLImageView.java │ │ │ ├── BLLinearLayout.java │ │ │ ├── BLListView.java │ │ │ ├── BLRadioButton.java │ │ │ ├── BLRadioGroup.java │ │ │ ├── BLRelativeLayout.java │ │ │ ├── BLScrollView.java │ │ │ ├── BLTextView.java │ │ │ ├── BLView.java │ │ │ └── Const.java │ ├── res │ │ └── values │ │ │ └── attrs.xml │ └── resources │ │ └── META-INF │ │ └── proguard │ │ └── background_library.pro │ └── test │ └── java │ └── com │ └── noober │ └── background │ └── ExampleUnitTest.java ├── settings.gradle ├── test ├── anim.gif ├── gif.gif ├── pic11.gif ├── show.gif ├── step1.png ├── step2.png ├── step3.png ├── step4.png ├── step5.png ├── step6.png ├── test1.png ├── test111.png ├── test2.png ├── test222.png ├── test3.png ├── test4.png └── 属性提示.gif └── 使用介绍.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | .idea/ -------------------------------------------------------------------------------- /androidx/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /androidx/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | 29 | implementation 'androidx.appcompat:appcompat:1.0.0' 30 | // implementation 'com.android.support:support-v4:28.0.0-rc02' 31 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 35 | 36 | implementation 'com.trello.rxlifecycle3:rxlifecycle:3.0.0' 37 | 38 | // If you want to bind to Android-specific lifecycles 39 | implementation 'com.trello.rxlifecycle3:rxlifecycle-android:3.0.0' 40 | 41 | // If you want pre-written Activities and Fragments you can subclass as providers 42 | implementation 'com.trello.rxlifecycle3:rxlifecycle-components:3.0.0' 43 | implementation project(':libraryx') 44 | // implementation 'com.noober.background:corex:1.5.4-ALPHA' 45 | // implementation 'com.github.JavaNoober.BackgroundLibrary:libraryx:1.6.9' 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /androidx/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 | -------------------------------------------------------------------------------- /androidx/src/androidTest/java/com/noober/androidx/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.noober.androidx; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.noober.androidx.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /androidx/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /androidx/src/main/java/com/noober/androidx/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.noober.androidx; 2 | 3 | import android.app.ListActivity; 4 | import android.content.Intent; 5 | import android.content.res.ColorStateList; 6 | import android.graphics.Color; 7 | import android.graphics.drawable.Drawable; 8 | import android.os.Build; 9 | import android.os.Bundle; 10 | import android.view.View; 11 | import android.widget.Button; 12 | import android.widget.TextView; 13 | 14 | import androidx.annotation.Nullable; 15 | 16 | import com.noober.background.drawable.DrawableCreator; 17 | import com.trello.rxlifecycle3.components.support.RxAppCompatActivity; 18 | 19 | public class MainActivity extends RxAppCompatActivity { 20 | 21 | @Override 22 | protected void onCreate(@Nullable Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | setContentView( R.layout.activity_main); 25 | Button button = findViewById(R.id.btn); 26 | 27 | button.setOnClickListener(new View.OnClickListener() { 28 | @Override 29 | public void onClick(View v) { 30 | startActivity(new Intent(MainActivity.this, ListActivity.class)); 31 | } 32 | }); 33 | 34 | // AnimationDrawable animationDrawable = (AnimationDrawable) vAnim.getBackground(); 35 | // animationDrawable.start(); 36 | 37 | Drawable drawable = new DrawableCreator.Builder().setCornersRadius(30) 38 | .setSolidColor(Color.parseColor("#FFFFFF")) 39 | .setStrokeColor(Color.parseColor("#FFFFFF")) 40 | .setStrokeWidth(10) 41 | .build(); 42 | TextView tvTest1 = findViewById(R.id.tvTest1); 43 | tvTest1.setClickable(true); 44 | ColorStateList colors = new DrawableCreator.Builder().setPressedTextColor(Color.RED).setUnPressedTextColor(Color.BLUE).buildTextColor(); 45 | tvTest1.setTextColor(colors); 46 | 47 | Button btnTest2 = findViewById(R.id.btnTest2); 48 | Drawable drawable2 = new DrawableCreator.Builder().setCornersRadius(dip2px(20)) 49 | .setGradientAngle(0).setGradientColor(Color.parseColor("#63B8FF"), Color.parseColor("#4F94CD")).build(); 50 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){ 51 | btnTest2.setBackground(drawable2); 52 | }else { 53 | btnTest2.setBackgroundDrawable(drawable2); 54 | } 55 | 56 | 57 | Button btnTest3 = findViewById(R.id.btnTest3); 58 | Drawable drawable3 = new DrawableCreator.Builder().setCornersRadius(dip2px(20)) 59 | .setRipple(true, Color.parseColor("#71C671")) 60 | .setSolidColor(Color.parseColor("#7CFC00")) 61 | .setStrokeColor(Color.parseColor("#8c6822")) 62 | .setStrokeWidth(dip2px(2)) 63 | .build(); 64 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){ 65 | btnTest3.setBackground(drawable3); 66 | }else { 67 | btnTest3.setBackgroundDrawable(drawable3); 68 | } 69 | 70 | 71 | // TextView tvTest4 = findViewById(R.id.tvTest4); 72 | // Drawable drawable4 = new DrawableCreator.Builder().setCornersRadius(dip2px(20)) 73 | // .setPressedDrawable(ContextCompat.getDrawable(this, R.drawable.circle_like_pressed)) 74 | // .setUnPressedDrawable(ContextCompat.getDrawable(this, R.drawable.circle_like_normal)) 75 | // .build(); 76 | // tvTest4.setClickable(true); 77 | // if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){ 78 | // tvTest4.setBackground(drawable4); 79 | // }else { 80 | // tvTest4.setBackgroundDrawable(drawable4); 81 | // } 82 | 83 | 84 | final Button btnEnable = findViewById(R.id.btn_setEnable); 85 | final TextView tvMulti = findViewById(R.id.tv_multi); 86 | btnEnable.setOnClickListener(new View.OnClickListener() { 87 | @Override 88 | public void onClick(View v) { 89 | if(tvMulti.isEnabled()){ 90 | tvMulti.setEnabled(false); 91 | tvMulti.setText("textView一条属性多个状态:enable=false"); 92 | }else { 93 | tvMulti.setEnabled(true); 94 | tvMulti.setText("textView一条属性多个状态:enable=true"); 95 | } 96 | } 97 | }); 98 | 99 | } 100 | 101 | 102 | public int dip2px(float dipValue) { 103 | float scale = getResources().getDisplayMetrics().density; 104 | return (int)(dipValue * scale + 0.5F); 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /androidx/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/androidx/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /androidx/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/androidx/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /androidx/src/main/res/mipmap-xhdpi/rg_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/androidx/src/main/res/mipmap-xhdpi/rg_select.png -------------------------------------------------------------------------------- /androidx/src/main/res/mipmap-xhdpi/rg_unselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/androidx/src/main/res/mipmap-xhdpi/rg_unselect.png -------------------------------------------------------------------------------- /androidx/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | 2dp 8 | 9 | -------------------------------------------------------------------------------- /androidx/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | androidx 3 | 4 | -------------------------------------------------------------------------------- /androidx/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 18 | 19 | 20 | 28 | 29 | -------------------------------------------------------------------------------- /androidx/src/test/java/com/noober/androidx/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.noober.androidx; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlin-kapt' 5 | 6 | android { 7 | compileSdkVersion 28 8 | defaultConfig { 9 | applicationId "com.noober.backgroudlibrary" 10 | minSdkVersion 14 11 | targetSdkVersion 31 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled true 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | lintOptions { 24 | abortOnError false 25 | } 26 | // buildToolsVersion '28.0.2' 27 | 28 | // dataBinding { 29 | // enabled = true 30 | // } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(include: ['*.jar'], dir: 'libs') 35 | implementation 'com.android.support:appcompat-v7:28.0.0-rc02' 36 | implementation 'com.android.support.constraint:constraint-layout:2.0.4' 37 | implementation 'com.android.support:support-v4:28.0.0-rc02' 38 | testImplementation 'junit:junit:4.12' 39 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 40 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 41 | // implementation 'com.noober.background:core:1.6.5' 42 | // implementation 'com.github.JavaNoober:BackgroundLibrary:1.6.6' 43 | implementation project(':library') 44 | // implementation 'com.github.JavaNoober.BackgroundLibrary:library:1.7.3' 45 | 46 | // implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 47 | } 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/noober/backgroudlibrary/BlankFragment.java: -------------------------------------------------------------------------------- 1 | package com.noober.backgroudlibrary; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.noober.background.BackgroundLibrary; 12 | 13 | 14 | /** 15 | * A simple {@link Fragment} subclass. 16 | * Activities that contain this fragment must implement the 17 | * {@link BlankFragment.OnFragmentInteractionListener} interface 18 | * to handle interaction events. 19 | * Use the {@link BlankFragment#newInstance} factory method to 20 | * create an instance of this fragment. 21 | */ 22 | public class BlankFragment extends Fragment { 23 | // TODO: Rename parameter arguments, choose names that match 24 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 25 | private static final String ARG_PARAM1 = "param1"; 26 | private static final String ARG_PARAM2 = "param2"; 27 | 28 | // TODO: Rename and change types of parameters 29 | private String mParam1; 30 | private String mParam2; 31 | 32 | private OnFragmentInteractionListener mListener; 33 | 34 | public BlankFragment() { 35 | // Required empty public constructor 36 | } 37 | 38 | /** 39 | * Use this factory method to create a new instance of 40 | * this fragment using the provided parameters. 41 | * 42 | * @param param1 Parameter 1. 43 | * @param param2 Parameter 2. 44 | * @return A new instance of fragment BlankFragment. 45 | */ 46 | // TODO: Rename and change types and number of parameters 47 | public static BlankFragment newInstance(String param1, String param2) { 48 | BlankFragment fragment = new BlankFragment(); 49 | Bundle args = new Bundle(); 50 | args.putString(ARG_PARAM1, param1); 51 | args.putString(ARG_PARAM2, param2); 52 | fragment.setArguments(args); 53 | return fragment; 54 | } 55 | 56 | @Override 57 | public void onCreate(Bundle savedInstanceState) { 58 | super.onCreate(savedInstanceState); 59 | if (getArguments() != null) { 60 | mParam1 = getArguments().getString(ARG_PARAM1); 61 | mParam2 = getArguments().getString(ARG_PARAM2); 62 | } 63 | } 64 | 65 | @Override 66 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 67 | Bundle savedInstanceState) { 68 | // Inflate the layout for this fragment 69 | return inflater.inflate(R.layout.fragment_blank, container, false); 70 | } 71 | 72 | // TODO: Rename method, update argument and hook method into UI event 73 | public void onButtonPressed(Uri uri) { 74 | if (mListener != null) { 75 | mListener.onFragmentInteraction(uri); 76 | } 77 | } 78 | 79 | @Override 80 | public void onAttach(Context context) { 81 | super.onAttach(context); 82 | if (context instanceof OnFragmentInteractionListener) { 83 | mListener = (OnFragmentInteractionListener) context; 84 | } 85 | } 86 | 87 | @Override 88 | public void onDetach() { 89 | super.onDetach(); 90 | mListener = null; 91 | } 92 | 93 | /** 94 | * This interface must be implemented by activities that contain this 95 | * fragment to allow an interaction in this fragment to be communicated 96 | * to the activity and potentially other fragments contained in that 97 | * activity. 98 | *

99 | * See the Android Training lesson Communicating with Other Fragments for more information. 102 | */ 103 | public interface OnFragmentInteractionListener { 104 | // TODO: Update argument type and name 105 | void onFragmentInteraction(Uri uri); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/noober/backgroudlibrary/KTActivity.kt: -------------------------------------------------------------------------------- 1 | package com.noober.backgroudlibrary 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.util.Log 6 | import com.noober.background.BackgroundLibrary 7 | import kotlinx.android.synthetic.main.activity_main.* 8 | 9 | class KTActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.activity_main) 14 | ttt.setOnClickListener { 15 | Log.e("sss", "sdadssada") 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/noober/backgroudlibrary/ListActivity.java: -------------------------------------------------------------------------------- 1 | package com.noober.backgroudlibrary; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.widget.ListView; 6 | import android.widget.SimpleAdapter; 7 | 8 | import com.noober.background.BackgroundLibrary; 9 | 10 | import java.util.ArrayList; 11 | import java.util.HashMap; 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | public class ListActivity extends AppCompatActivity { 16 | private List> data = new ArrayList<>(); 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_list); 22 | 23 | //不需要任何特殊处理 24 | ListView listView = findViewById(R.id.listView); 25 | for (int i = 0; i < 20; i++) { 26 | data.add(new HashMap()); 27 | } 28 | SimpleAdapter simAdapt = new SimpleAdapter( 29 | this, 30 | data, 31 | R.layout.item, 32 | new String[]{},// 与下面数组元素要一一对应 33 | new int[]{}); 34 | listView.setAdapter(simAdapt); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/noober/backgroudlibrary/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.noober.backgroudlibrary; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.util.Log; 6 | 7 | import com.noober.background.BLAutoInjectController; 8 | 9 | /** 10 | * Created by xiaoqi on 2018/9/13 11 | */ 12 | public class MyApplication extends Application { 13 | 14 | 15 | 16 | // 控制是否需要自动进行inject 17 | 18 | // { 19 | // BLAutoInjectController.setEnableAutoInject(false); 20 | // } 21 | // //或者 22 | // static { 23 | // BLAutoInjectController.setEnableAutoInject(false); 24 | // } 25 | // //或者 26 | // @Override 27 | // protected void attachBaseContext(Context base) { 28 | // super.attachBaseContext(base); 29 | // BLAutoInjectController.setEnableAutoInject(false); 30 | // } 31 | 32 | @Override 33 | public void onCreate() { 34 | super.onCreate(); 35 | Log.e("BL", "onCreate"); 36 | 37 | // registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { 38 | // @Override 39 | // public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 40 | // BackgroundLibrary.inject(activity); 41 | // } 42 | // 43 | // @Override 44 | // public void onActivityStarted(Activity activity) { 45 | // 46 | // } 47 | // 48 | // @Override 49 | // public void onActivityResumed(Activity activity) { 50 | // 51 | // } 52 | // 53 | // @Override 54 | // public void onActivityPaused(Activity activity) { 55 | // 56 | // } 57 | // 58 | // @Override 59 | // public void onActivityStopped(Activity activity) { 60 | // 61 | // } 62 | // 63 | // @Override 64 | // public void onActivitySaveInstanceState(Activity activity, Bundle outState) { 65 | // 66 | // } 67 | // 68 | // @Override 69 | // public void onActivityDestroyed(Activity activity) { 70 | // 71 | // } 72 | // }); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_like_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/circle_like_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_like_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/circle_like_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/downbtn_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 13 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 37 | 40 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 54 | 57 | 60 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/img00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img00.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img02.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img03.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img04.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img05.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img06.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img07.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img08.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img09.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img10.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img11.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img12.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img13.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaNoober/BackgroundLibrary/add5d38e64af896bd8ab0bc4ad7f7100fe7acfda/app/src/main/res/drawable/img14.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/sel_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_circle_like.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_gender_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_gender_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_login_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg_sel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_bg_sel2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_ripple1_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_ripple2_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_sel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_sel1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_sel2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_sel3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_data_binding.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 16 | 17 | 29 | 30 |