From ad101ae7d07d70e629ee7195f0adfdf53da7cc3e Mon Sep 17 00:00:00 2001 From: Lesilva Date: Fri, 24 Apr 2015 23:47:57 -0500 Subject: [PATCH] #8 add dropdown arrow icon update libraries version 1.0.8 --- README.md | 8 +++++--- app/build.gradle | 8 ++++---- app/src/main/res/layout/activity_main.xml | 4 ++-- gradle.properties | 10 +++++++--- library-material/build.gradle | 10 +++++----- .../library/material/MaterialBetterSpinner.java | 9 +++++++++ .../drawable-hdpi/ic_expand_more_black_18dp.png | Bin 0 -> 162 bytes .../drawable-mdpi/ic_expand_more_black_18dp.png | Bin 0 -> 129 bytes .../drawable-xhdpi/ic_expand_more_black_18dp.png | Bin 0 -> 178 bytes .../drawable-xxhdpi/ic_expand_more_black_18dp.png | Bin 0 -> 219 bytes library/build.gradle | 8 ++++---- .../betterspinner/library/BetterSpinner.java | 9 +++++++++ .../drawable-hdpi/ic_expand_more_black_18dp.png | Bin 0 -> 162 bytes .../drawable-mdpi/ic_expand_more_black_18dp.png | Bin 0 -> 129 bytes .../drawable-xhdpi/ic_expand_more_black_18dp.png | Bin 0 -> 178 bytes .../drawable-xxhdpi/ic_expand_more_black_18dp.png | Bin 0 -> 219 bytes 16 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png create mode 100644 library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png create mode 100644 library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png create mode 100644 library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png create mode 100644 library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png create mode 100644 library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png create mode 100644 library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png create mode 100644 library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png diff --git a/README.md b/README.md index 940fc73..e663362 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ or you can also store you arrays in arrays.xml and do something like this in you String[] COUNTRIES = getResources().getStringArray(R.array.countries_list); ``` +For usage of MaterialEditText 2.0.3, check it out [here](https://github.com/rengwuxian/MaterialEditText/wiki) + If you want to use material style AutoCompleteTextView, simplely replace BetterSpinner with MaterialBetterSpinner. ## Download @@ -47,14 +49,14 @@ gradle: For normal look use (BetterSpinner): ```groovy -compile 'com.weiwangcn.betterspinner:library:1.0.7' +compile 'com.weiwangcn.betterspinner:library:1.0.8' ``` For material look use (MaterrialBetterSpinner): ```groovy -compile 'com.weiwangcn.betterspinner:library-material:1.0.7' +compile 'com.weiwangcn.betterspinner:library-material:1.0.8' ``` -Note: library-material has included [MaterialEditText](https://github.com/rengwuxian/MaterialEditText). +Note: library-material has included [MaterialEditText 2.0.3](https://github.com/rengwuxian/MaterialEditText). ## Acknowledgements diff --git a/app/build.gradle b/app/build.gradle index a0f5753..47147b1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 - buildToolsVersion "21.1.2" + compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) + buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION defaultConfig { applicationId "com.weiwangcn.betterspinner.sample" minSdkVersion 7 - targetSdkVersion 22 + targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) versionName project.VERSION_NAME versionCode Integer.parseInt(project.VERSION_CODE) } @@ -22,7 +22,7 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:22.0.0' + compile 'com.android.support:appcompat-v7:22.1.0' compile 'com.jakewharton:butterknife:6.1.0' compile project(':library') compile project(':library-material') diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6faeddb..4f4138a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -31,12 +31,12 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="MaterialBetterSpinner" - app:floatingLabel="normal" /> + app:met_floatingLabel="normal" /> + app:met_floatingLabel="normal" /> diff --git a/gradle.properties b/gradle.properties index dcf23b5..b135e8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.0.7 -VERSION_CODE=107 +VERSION_NAME=1.0.8 +VERSION_CODE=108 GROUP=com.weiwangcn.betterspinner POM_DESCRIPTION=Android Spinner in a Better Design @@ -11,4 +11,8 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0 POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=Lesilva -POM_DEVELOPER_NAME=Wei Wang \ No newline at end of file +POM_DEVELOPER_NAME=Wei Wang + +ANDROID_BUILD_TARGET_SDK_VERSION=22 +ANDROID_BUILD_TOOLS_VERSION=22.0.1 +ANDROID_BUILD_SDK_VERSION=22 \ No newline at end of file diff --git a/library-material/build.gradle b/library-material/build.gradle index 045d633..155ebda 100644 --- a/library-material/build.gradle +++ b/library-material/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 22 - buildToolsVersion "22.0.0" + compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) + buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion 7 - targetSdkVersion 22 + targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) versionName project.VERSION_NAME versionCode Integer.parseInt(project.VERSION_CODE) } @@ -20,8 +20,8 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:22.0.0' - compile 'com.rengwuxian.materialedittext:library:1.8.3' + compile 'com.android.support:appcompat-v7:22.1.0' + compile 'com.rengwuxian.materialedittext:library:2.0.3' } apply from: '../maven_push.gradle' diff --git a/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java b/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java index a40a2f4..5d7a098 100644 --- a/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java +++ b/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java @@ -2,6 +2,7 @@ import android.content.Context; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -85,4 +86,12 @@ public void onItemClick(AdapterView adapterView, View view, int i, long l) { isPopup = false; } + @Override + public void setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) { + right = getContext().getResources().getDrawable(R.drawable.ic_expand_more_black_18dp); + if (right != null) + right.setAlpha(66); + super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom); + } + } diff --git a/library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png b/library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..3eee9aaaedb6efaf24b9d127a4d8d03c02801d91 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0dAEsVTZOe&8I8{vLl#74(F^$Jke${;g#)-#9~cDmb(UBJdS2-5>5W{ bx-&2ccMF_JYhE)GXeNWFtDnm{r-UW|!OthM literal 0 HcmV?d00001 diff --git a/library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png b/library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..5a09a50a646575a3bf2146e5040f6b8c60177acf GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBDm`5sLn>~)y%5dSpdiqixNyO= z+$~GyGFjU7^~zs_EjQRY~sx1bn!*Dj8~uh!nRrC7uf?@ag!)(`I-~ c!g(9>y{XRTX(9E(Ku0imy85}Sb4q9e08Oz(r~m)} literal 0 HcmV?d00001 diff --git a/library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png b/library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..870066970b38b4c0305ff9b7a0bfae0836fc6a2a GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e?^MV>B>Ar-gYUdrWiaFB3K^ght_ zrY&{C)1NmkNw|7SHJ{vJwfx=vm$g}wS~?)$Mc~v}sSkVatn2B`dfO8#&SAdz*weFC zVyhzg3>pifr*yVzm$9#To&TsW;C0vb!cv7f+@f!-cNNUkdZqd9@`~LSoL40CZaiEP zu+PGC3csINY1?GC*n=k*))Z{g5ciWSZTZcc)%{zx3u2qcZq9;f({1YHZ|(%Tmci52 K&t;ucLK6T@^IZJ^ literal 0 HcmV?d00001 diff --git a/library/build.gradle b/library/build.gradle index 9fa9a63..e89ff33 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 22 - buildToolsVersion "21.1.2" + compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) + buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion 7 - targetSdkVersion 22 + targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) versionName project.VERSION_NAME versionCode Integer.parseInt(project.VERSION_CODE) } @@ -20,7 +20,7 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:22.0.0' + compile 'com.android.support:appcompat-v7:22.1.0' } apply from: '../maven_push.gradle' diff --git a/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java b/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java index 76290ed..34a293e 100644 --- a/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java +++ b/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java @@ -2,6 +2,7 @@ import android.content.Context; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -83,4 +84,12 @@ public void onItemClick(AdapterView adapterView, View view, int i, long l) { isPopup = false; } + @Override + public void setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) { + right = getContext().getResources().getDrawable(R.drawable.ic_expand_more_black_18dp); + if (right != null) + right.setAlpha(66); + super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom); + } + } diff --git a/library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png b/library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..3eee9aaaedb6efaf24b9d127a4d8d03c02801d91 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0dAEsVTZOe&8I8{vLl#74(F^$Jke${;g#)-#9~cDmb(UBJdS2-5>5W{ bx-&2ccMF_JYhE)GXeNWFtDnm{r-UW|!OthM literal 0 HcmV?d00001 diff --git a/library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png b/library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..5a09a50a646575a3bf2146e5040f6b8c60177acf GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBDm`5sLn>~)y%5dSpdiqixNyO= z+$~GyGFjU7^~zs_EjQRY~sx1bn!*Dj8~uh!nRrC7uf?@ag!)(`I-~ c!g(9>y{XRTX(9E(Ku0imy85}Sb4q9e08Oz(r~m)} literal 0 HcmV?d00001 diff --git a/library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png b/library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..870066970b38b4c0305ff9b7a0bfae0836fc6a2a GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e?^MV>B>Ar-gYUdrWiaFB3K^ght_ zrY&{C)1NmkNw|7SHJ{vJwfx=vm$g}wS~?)$Mc~v}sSkVatn2B`dfO8#&SAdz*weFC zVyhzg3>pifr*yVzm$9#To&TsW;C0vb!cv7f+@f!-cNNUkdZqd9@`~LSoL40CZaiEP zu+PGC3csINY1?GC*n=k*))Z{g5ciWSZTZcc)%{zx3u2qcZq9;f({1YHZ|(%Tmci52 K&t;ucLK6T@^IZJ^ literal 0 HcmV?d00001