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 0000000..3eee9aa Binary files /dev/null and b/library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png differ diff --git a/library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png b/library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000..c9fdeb7 Binary files /dev/null and b/library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png differ 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 0000000..5a09a50 Binary files /dev/null and b/library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png differ 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 0000000..8700669 Binary files /dev/null and b/library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png differ 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 0000000..3eee9aa Binary files /dev/null and b/library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png differ diff --git a/library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png b/library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png new file mode 100644 index 0000000..c9fdeb7 Binary files /dev/null and b/library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png differ 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 0000000..5a09a50 Binary files /dev/null and b/library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png differ 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 0000000..8700669 Binary files /dev/null and b/library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png differ