├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── sample │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── sample │ │ └── MainActivity.java │ └── res │ ├── layout │ └── activity_main.xml │ ├── menu │ └── menu_main.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 │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ ├── styles.xml │ └── themes.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library-material ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── library │ │ └── material │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── library │ │ └── material │ │ └── MaterialBetterSpinner.java │ └── res │ ├── drawable-hdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-mdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-xhdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-xxhdpi │ └── ic_expand_more_black_18dp.png │ └── values │ └── strings.xml ├── library ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── library │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── weiwangcn │ │ └── betterspinner │ │ └── library │ │ └── BetterSpinner.java │ └── res │ ├── drawable-hdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-mdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-xhdpi │ └── ic_expand_more_black_18dp.png │ ├── drawable-xxhdpi │ └── ic_expand_more_black_18dp.png │ └── values │ └── strings.xml ├── maven_push.gradle ├── screenshot ├── BetterSpinner Banner.jpg └── screenshot.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/ 4 | .DS_Store 5 | /build 6 | *.iml 7 | *.ap_ 8 | *.dex 9 | *.class 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Banner](./screenshot/BetterSpinner Banner.jpg) 2 | 3 | # BetterSpinner 4 | 5 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-BetterSpinner-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1707) 6 | 7 | If you like developing Android, you must "hate" Spinners. I had countless issues with Spinners and I decided to make a new one. BetterSpinner is using AutoCompleteTextView to do what a Spinner really should do. 8 | 9 | ## Screenshots 10 | ![BetterSpinner](./screenshot/screenshot.gif) 11 | 12 | ## Examples 13 | The demo is a showcase of the functionality of the library. 14 | 15 | [![Get it on Google Play](https://developer.android.com/images/brand/en_generic_rgb_wo_60.png)](https://play.google.com/store/apps/details?id=com.weiwangcn.betterspinner.sample) 16 | 17 | Or 18 | 19 | Download the APK file here: [BetterSpinner.Demo-1.1.0.apk](https://github.com/Lesilva/BetterSpinner/releases/download/1.1.0/BetterSpinner.Demo-1.1.0.apk) 20 | 21 | ## Usage 22 | BetterSpinner can be used just like [AutoCompleteTextView](http://developer.android.com/reference/android/widget/AutoCompleteTextView.html). 23 | 24 | ```java 25 | ArrayAdapter adapter = new ArrayAdapter(this, 26 | android.R.layout.simple_dropdown_item_1line, COUNTRIES); 27 | BetterSpinner textView = (BetterSpinner) 28 | findViewById(R.id.countries_list); 29 | textView.setAdapter(adapter); 30 | } 31 | 32 | private static final String[] COUNTRIES = new String[] { 33 | "Belgium", "France", "Italy", "Germany", "Spain" 34 | }; 35 | ``` 36 | 37 | or you can also store you arrays in arrays.xml and do something like this in your code 38 | 39 | ```java 40 | String[] COUNTRIES = getResources().getStringArray(R.array.countries_list); 41 | ``` 42 | 43 | For usage of MaterialEditText 2.0.3, check it out [here](https://github.com/rengwuxian/MaterialEditText/wiki) 44 | 45 | If you want to use material style AutoCompleteTextView, simply replace BetterSpinner with MaterialBetterSpinner. 46 | 47 | ## Download 48 | BetterSpinner is now pushed to Maven Central as an AAR, so you just need to add the following dependency to your `build.gradle`. 49 | gradle: 50 | 51 | For normal look use (BetterSpinner): 52 | 53 | ```groovy 54 | compile 'com.weiwangcn.betterspinner:library:1.1.0' 55 | ``` 56 | 57 | If you have appcompat-v7 in your dependencies make sure to exclude it : 58 | 59 | ```groovy 60 | compile ('com.weiwangcn.betterspinner:library:1.1.0') { 61 | exclude group: 'com.android.support', module: 'appcompat-v7' 62 | } 63 | ``` 64 | 65 | For material look use (MaterrialBetterSpinner): 66 | 67 | ```groovy 68 | compile 'com.weiwangcn.betterspinner:library-material:1.1.0' 69 | ``` 70 | 71 | If you have appcompat-v7 and MaterialEditText in your dependencies make sure to exclude them : 72 | 73 | ```groovy 74 | compile ('com.weiwangcn.betterspinner:library-material:1.1.0') { 75 | exclude group: 'com.android.support', module: 'appcompat-v7' 76 | exclude group: 'com.rengwuxian.materialedittext', module: 'library' 77 | } 78 | ``` 79 | 80 | Note: library-material has included [MaterialEditText 2.0.3](https://github.com/rengwuxian/MaterialEditText). 81 | 82 | 83 | ## Acknowledgements 84 | Thanks my girlfriend Wanrong(wt263@msstate.edu) for the app icon :) 85 | 86 | Thanks [Matt](https://github.com/mattblang) for his inspiration 87 | 88 | [MaterialEditText](https://github.com/rengwuxian/MaterialEditText) 89 | 90 | 91 | ## License 92 | 93 | Copyright 2015 Wei Wang 94 | 95 | Licensed under the Apache License, Version 2.0 (the "License"); 96 | you may not use this file except in compliance with the License. 97 | You may obtain a copy of the License at 98 | 99 | http://www.apache.org/licenses/LICENSE-2.0 100 | 101 | Unless required by applicable law or agreed to in writing, software 102 | distributed under the License is distributed on an "AS IS" BASIS, 103 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 104 | See the License for the specific language governing permissions and 105 | limitations under the License. 106 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) 5 | buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | applicationId "com.weiwangcn.betterspinner.sample" 9 | minSdkVersion 7 10 | targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) 11 | versionName project.VERSION_NAME 12 | versionCode Integer.parseInt(project.VERSION_CODE) 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile 'com.android.support:appcompat-v7:23.1.1' 26 | compile 'com.jakewharton:butterknife:7.0.1' 27 | compile project(':library') 28 | compile project(':library-material') 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Dev\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/weiwangcn/betterspinner/sample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.sample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/weiwangcn/betterspinner/sample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.sample; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.v7.app.ActionBarActivity; 7 | import android.view.Menu; 8 | import android.view.MenuItem; 9 | import android.widget.ArrayAdapter; 10 | 11 | import com.weiwangcn.betterspinner.R; 12 | import com.weiwangcn.betterspinner.library.BetterSpinner; 13 | import com.weiwangcn.betterspinner.library.material.MaterialBetterSpinner; 14 | 15 | import butterknife.Bind; 16 | import butterknife.ButterKnife; 17 | 18 | 19 | public class MainActivity extends ActionBarActivity { 20 | 21 | @Bind(R.id.spinner1) 22 | BetterSpinner spinner1; 23 | 24 | @Bind(R.id.spinner2) 25 | MaterialBetterSpinner spinner2; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_main); 31 | ButterKnife.bind(this); 32 | 33 | String[] list = getResources().getStringArray(R.array.month); 34 | 35 | ArrayAdapter adapter = new ArrayAdapter(this, 36 | android.R.layout.simple_dropdown_item_1line, list); 37 | 38 | spinner1.setAdapter(adapter); 39 | spinner2.setAdapter(adapter); 40 | 41 | } 42 | 43 | 44 | @Override 45 | public boolean onCreateOptionsMenu(Menu menu) { 46 | // Inflate the menu; this adds items to the action bar if it is present. 47 | getMenuInflater().inflate(R.menu.menu_main, menu); 48 | return true; 49 | } 50 | 51 | @Override 52 | public boolean onOptionsItemSelected(MenuItem item) { 53 | // Handle action bar item clicks here. The action bar will 54 | // automatically handle clicks on the Home/Up button, so long 55 | // as you specify a parent activity in AndroidManifest.xml. 56 | int id = item.getItemId(); 57 | 58 | //noinspection SimplifiableIfStatement 59 | if (id == R.id.action_visit_repo) { 60 | Uri uri = Uri.parse("https://github.com/Lesilva/BetterSpinner"); 61 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 62 | startActivity(intent); 63 | 64 | 65 | return true; 66 | } 67 | 68 | return super.onOptionsItemSelected(item); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 20 | 21 | 26 | 27 | 33 | 34 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | January 5 | February 6 | March 7 | April 8 | May 9 | June 10 | July 11 | August 12 | September 13 | October 14 | November 15 | December 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2196F3 4 | #1976D2 5 | #BBDEFB 6 | #FFFFFF 7 | #212121 8 | #727272 9 | #FFFFFF 10 | #B6B6B6 11 | 12 | #FFFFFF 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BetterSpinner Demo 3 | 4 | Hello world! 5 | Settings 6 | Visit Repo 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.1.2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | def isReleaseBuild() { 16 | return version.contains("SNAPSHOT") == false 17 | } 18 | 19 | allprojects { 20 | version = VERSION_NAME 21 | group = GROUP 22 | 23 | repositories { 24 | jcenter() 25 | } 26 | } 27 | 28 | apply plugin: 'android-reporting' 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=1.1.0 2 | VERSION_CODE=110 3 | GROUP=com.weiwangcn.betterspinner 4 | 5 | POM_DESCRIPTION=Android Spinner in a Better Design 6 | POM_URL=https://github.com/Lesilva/BetterSpinner 7 | POM_SCM_URL=https://github.com/Lesilva/BetterSpinner 8 | POM_SCM_CONNECTION=scm:git@github.com:Lesilva/BetterSpinner.git 9 | POM_SCM_DEV_CONNECTION=scm:git@github.com:Lesilva/BetterSpinner.git 10 | POM_LICENCE_NAME=The Apache Software License, Version 2.0 11 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 12 | POM_LICENCE_DIST=repo 13 | POM_DEVELOPER_ID=Lesilva 14 | POM_DEVELOPER_NAME=Wei Wang 15 | 16 | ANDROID_BUILD_TARGET_SDK_VERSION=23 17 | ANDROID_BUILD_TOOLS_VERSION=23.0.2 18 | ANDROID_BUILD_SDK_VERSION=23 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jul 21 08:20:52 BST 2016 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-2.10-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 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 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /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 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 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 Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /library-material/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library-material/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) 5 | buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | minSdkVersion 7 9 | targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) 10 | versionName project.VERSION_NAME 11 | versionCode Integer.parseInt(project.VERSION_CODE) 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:23.1.1' 24 | compile 'com.rengwuxian.materialedittext:library:2.1.4' 25 | } 26 | 27 | apply from: '../maven_push.gradle' 28 | -------------------------------------------------------------------------------- /library-material/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=BetterSpinner Library 2 | POM_ARTIFACT_ID=library-material 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /library-material/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/weiwang/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library-material/src/androidTest/java/com/weiwangcn/betterspinner/library/material/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.library.material; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /library-material/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.library.material; 2 | 3 | import com.rengwuxian.materialedittext.MaterialAutoCompleteTextView; 4 | 5 | import android.content.Context; 6 | import android.graphics.Rect; 7 | import android.graphics.drawable.Drawable; 8 | import android.support.v4.content.ContextCompat; 9 | import android.util.AttributeSet; 10 | import android.view.MotionEvent; 11 | import android.view.View; 12 | import android.view.inputmethod.InputMethodManager; 13 | import android.widget.AdapterView; 14 | import android.widget.ListView; 15 | 16 | import java.util.Calendar; 17 | 18 | 19 | public class MaterialBetterSpinner extends MaterialAutoCompleteTextView implements AdapterView.OnItemClickListener { 20 | 21 | private static final int MAX_CLICK_DURATION = 200; 22 | private long startClickTime; 23 | private boolean isPopup; 24 | private int mPosition = ListView.INVALID_POSITION; 25 | 26 | public MaterialBetterSpinner(Context context) { 27 | super(context); 28 | setOnItemClickListener(this); 29 | } 30 | 31 | public MaterialBetterSpinner(Context arg0, AttributeSet arg1) { 32 | super(arg0, arg1); 33 | setOnItemClickListener(this); 34 | } 35 | 36 | public MaterialBetterSpinner(Context arg0, AttributeSet arg1, int arg2) { 37 | super(arg0, arg1, arg2); 38 | setOnItemClickListener(this); 39 | } 40 | 41 | @Override 42 | public boolean enoughToFilter() { 43 | return true; 44 | } 45 | 46 | @Override 47 | protected void onFocusChanged(boolean focused, int direction, 48 | Rect previouslyFocusedRect) { 49 | super.onFocusChanged(focused, direction, previouslyFocusedRect); 50 | if (focused) { 51 | performFiltering("", 0); 52 | InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); 53 | imm.hideSoftInputFromWindow(getWindowToken(), 0); 54 | setKeyListener(null); 55 | dismissDropDown(); 56 | } else { 57 | isPopup = false; 58 | } 59 | } 60 | 61 | @Override 62 | public boolean onTouchEvent(MotionEvent event) { 63 | if (!isEnabled()) 64 | return false; 65 | 66 | switch (event.getAction()) { 67 | case MotionEvent.ACTION_DOWN: { 68 | startClickTime = Calendar.getInstance().getTimeInMillis(); 69 | break; 70 | } 71 | case MotionEvent.ACTION_UP: { 72 | long clickDuration = Calendar.getInstance().getTimeInMillis() - startClickTime; 73 | if (clickDuration < MAX_CLICK_DURATION) { 74 | if (isPopup) { 75 | dismissDropDown(); 76 | isPopup = false; 77 | } else { 78 | requestFocus(); 79 | showDropDown(); 80 | isPopup = true; 81 | } 82 | } 83 | } 84 | } 85 | 86 | return super.onTouchEvent(event); 87 | } 88 | 89 | @Override 90 | public void onItemClick(AdapterView adapterView, View view, int position, long id) { 91 | mPosition = position; 92 | isPopup = false; 93 | } 94 | 95 | @Override 96 | public void setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) { 97 | Drawable dropdownIcon = ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_more_black_18dp); 98 | if (dropdownIcon != null) { 99 | right = dropdownIcon; 100 | right.mutate().setAlpha(66); 101 | } 102 | super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom); 103 | } 104 | 105 | public int getPosition() { 106 | return mPosition; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library-material/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library-material/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library-material/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library-material/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library-material/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BetterSpinner 3 | 4 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) 5 | buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION 6 | 7 | defaultConfig { 8 | minSdkVersion 7 9 | targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) 10 | versionName project.VERSION_NAME 11 | versionCode Integer.parseInt(project.VERSION_CODE) 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:23.1.1' 24 | } 25 | 26 | apply from: '../maven_push.gradle' 27 | -------------------------------------------------------------------------------- /library/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=BetterSpinner Library 2 | POM_ARTIFACT_ID=library 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:/Dev/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/weiwangcn/betterspinner/library/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.library; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java: -------------------------------------------------------------------------------- 1 | package com.weiwangcn.betterspinner.library; 2 | 3 | import android.content.Context; 4 | import android.graphics.Rect; 5 | import android.graphics.drawable.Drawable; 6 | import android.support.v4.content.ContextCompat; 7 | import android.util.AttributeSet; 8 | import android.view.MotionEvent; 9 | import android.view.View; 10 | import android.view.inputmethod.InputMethodManager; 11 | import android.widget.AdapterView; 12 | import android.widget.AutoCompleteTextView; 13 | import android.widget.ListView; 14 | 15 | import java.util.Calendar; 16 | 17 | public class BetterSpinner extends AutoCompleteTextView implements AdapterView.OnItemClickListener { 18 | 19 | private static final int MAX_CLICK_DURATION = 200; 20 | private long startClickTime; 21 | private boolean isPopup; 22 | private int mPosition = ListView.INVALID_POSITION; 23 | 24 | public BetterSpinner(Context context) { 25 | super(context); 26 | setOnItemClickListener(this); 27 | } 28 | 29 | public BetterSpinner(Context arg0, AttributeSet arg1) { 30 | super(arg0, arg1); 31 | setOnItemClickListener(this); 32 | } 33 | 34 | public BetterSpinner(Context arg0, AttributeSet arg1, int arg2) { 35 | super(arg0, arg1, arg2); 36 | setOnItemClickListener(this); 37 | } 38 | 39 | @Override 40 | public boolean enoughToFilter() { 41 | return true; 42 | } 43 | 44 | @Override 45 | protected void onFocusChanged(boolean focused, int direction, 46 | Rect previouslyFocusedRect) { 47 | super.onFocusChanged(focused, direction, previouslyFocusedRect); 48 | if (focused) { 49 | performFiltering("", 0); 50 | InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); 51 | imm.hideSoftInputFromWindow(getWindowToken(), 0); 52 | setKeyListener(null); 53 | dismissDropDown(); 54 | } else { 55 | isPopup = false; 56 | } 57 | } 58 | 59 | @Override 60 | public boolean onTouchEvent(MotionEvent event) { 61 | if (!isEnabled()) 62 | return false; 63 | 64 | switch (event.getAction()) { 65 | case MotionEvent.ACTION_DOWN: { 66 | startClickTime = Calendar.getInstance().getTimeInMillis(); 67 | break; 68 | } 69 | case MotionEvent.ACTION_UP: { 70 | long clickDuration = Calendar.getInstance().getTimeInMillis() - startClickTime; 71 | if (clickDuration < MAX_CLICK_DURATION) { 72 | if (isPopup) { 73 | dismissDropDown(); 74 | isPopup = false; 75 | } else { 76 | requestFocus(); 77 | showDropDown(); 78 | isPopup = true; 79 | } 80 | } 81 | } 82 | } 83 | 84 | return super.onTouchEvent(event); 85 | } 86 | 87 | @Override 88 | public void onItemClick(AdapterView adapterView, View view, int position, long id) { 89 | mPosition = position; 90 | isPopup = false; 91 | } 92 | 93 | @Override 94 | public void setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) { 95 | Drawable dropdownIcon = ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_more_black_18dp); 96 | if (dropdownIcon != null) { 97 | right = dropdownIcon; 98 | right.mutate().setAlpha(128); 99 | } 100 | super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom); 101 | } 102 | 103 | public int getPosition() { 104 | return mPosition; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library/src/main/res/drawable-hdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library/src/main/res/drawable-mdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library/src/main/res/drawable-xhdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/library/src/main/res/drawable-xxhdpi/ic_expand_more_black_18dp.png -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BetterSpinner 3 | 4 | -------------------------------------------------------------------------------- /maven_push.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | apply plugin: 'signing' 3 | 4 | def sonatypeRepositoryUrl 5 | if (isReleaseBuild()) { 6 | println 'RELEASE BUILD' 7 | //sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 8 | sonatypeRepositoryUrl = hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL 9 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 10 | } else { 11 | println 'SNAPSHOT BUILD' 12 | sonatypeRepositoryUrl = hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL 13 | : "https://oss.sonatype.org/content/repositories/snapshots/" 14 | //sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" 15 | } 16 | 17 | def getRepositoryUsername() { 18 | return hasProperty('nexusUsername') ? nexusUsername : "" 19 | } 20 | 21 | def getRepositoryPassword() { 22 | return hasProperty('nexusPassword') ? nexusPassword : "" 23 | } 24 | 25 | afterEvaluate { project -> 26 | uploadArchives { 27 | repositories { 28 | mavenDeployer { 29 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 30 | 31 | pom.artifactId = POM_ARTIFACT_ID 32 | 33 | repository(url: sonatypeRepositoryUrl) { 34 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 35 | } 36 | 37 | pom.project { 38 | name POM_NAME 39 | packaging POM_PACKAGING 40 | description POM_DESCRIPTION 41 | url POM_URL 42 | 43 | scm { 44 | url POM_SCM_URL 45 | connection POM_SCM_CONNECTION 46 | developerConnection POM_SCM_DEV_CONNECTION 47 | } 48 | 49 | licenses { 50 | license { 51 | name POM_LICENCE_NAME 52 | url POM_LICENCE_URL 53 | distribution POM_LICENCE_DIST 54 | } 55 | } 56 | 57 | developers { 58 | developer { 59 | id POM_DEVELOPER_ID 60 | name POM_DEVELOPER_NAME 61 | } 62 | } 63 | } 64 | } 65 | } 66 | } 67 | 68 | signing { 69 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } 70 | sign configurations.archives 71 | } 72 | 73 | task androidJavadocs(type: Javadoc) { 74 | options { 75 | linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" 76 | } 77 | exclude '**/BuildConfig.java' 78 | exclude '**/R.java' 79 | source = android.sourceSets.main.java.sourceFiles 80 | classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator)) 81 | } 82 | 83 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { 84 | classifier = 'javadoc' 85 | //basename = artifact_id 86 | from androidJavadocs.destinationDir 87 | } 88 | 89 | task androidSourcesJar(type: Jar) { 90 | classifier = 'sources' 91 | //basename = artifact_id 92 | from android.sourceSets.main.java.sourceFiles 93 | } 94 | 95 | artifacts { 96 | //archives packageReleaseJar 97 | archives androidSourcesJar 98 | archives androidJavadocsJar 99 | } 100 | } -------------------------------------------------------------------------------- /screenshot/BetterSpinner Banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/screenshot/BetterSpinner Banner.jpg -------------------------------------------------------------------------------- /screenshot/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lesilva/BetterSpinner/37be650cffda327419ad64e10f308feedacf426f/screenshot/screenshot.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library', ':library-material' 2 | --------------------------------------------------------------------------------