Skip to content

Commit

Permalink
removed deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesilva committed Apr 25, 2015
1 parent 19ace0e commit 7755e6f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The demo is a showcase of the functionality of the library.

Or

Download the APK file here: [BetterSpinner.Demo-1.0.8.apk](https://github.com/Lesilva/BetterSpinner/releases/download/1.0.8/BetterSpinner.Demo-1.0.8.apk)
Download the APK file here: [BetterSpinner.Demo-1.0.9.apk](https://github.com/Lesilva/BetterSpinner/releases/download/1.0.9/BetterSpinner.Demo-1.0.9.apk)

## Usage
BetterSpinner can be used just like [AutoCompleteTextView](http://developer.android.com/reference/android/widget/AutoCompleteTextView.html).
Expand Down Expand Up @@ -49,27 +49,27 @@ gradle:
For normal look use (BetterSpinner):

```groovy
compile 'com.weiwangcn.betterspinner:library:1.0.8'
compile 'com.weiwangcn.betterspinner:library:1.0.9'
```

If you have appcompat-v7 in your dependencies make sure to exclude it :

```groovy
compile ('com.weiwangcn.betterspinner:library:1.0.8') {
compile ('com.weiwangcn.betterspinner:library:1.0.9') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
```

For material look use (MaterrialBetterSpinner):

```groovy
compile 'com.weiwangcn.betterspinner:library-material:1.0.8'
compile 'com.weiwangcn.betterspinner:library-material:1.0.9'
```

If you have appcompat-v7 and MaterialEditText in your dependencies make sure to exclude them :

```groovy
compile ('com.weiwangcn.betterspinner:library-material:1.0.8') {
compile ('com.weiwangcn.betterspinner:library-material:1.0.9') {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.rengwuxian.materialedittext', module: 'library'
}
Expand All @@ -79,7 +79,7 @@ Note: library-material has included [MaterialEditText 2.0.3](https://github.com/


## Acknowledgements
Thanks my girlfriend Wanrong([email protected]) for the icon :)
Thanks my girlfriend Wanrong([email protected]) for the app icon :)

Thanks [Matt](https://github.com/mattblang) for his inspiration

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=1.0.8
VERSION_CODE=108
VERSION_NAME=1.0.9
VERSION_CODE=109
GROUP=com.weiwangcn.betterspinner

POM_DESCRIPTION=Android Spinner in a Better Design
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
Expand Down Expand Up @@ -88,9 +89,11 @@ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

@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)
Drawable dropdownIcon = ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_more_black_18dp);
if (dropdownIcon != null) {
right = dropdownIcon;
right.setAlpha(66);
}
super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
Expand Down Expand Up @@ -86,9 +87,11 @@ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

@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)
Drawable dropdownIcon = ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_more_black_18dp);
if (dropdownIcon != null) {
right = dropdownIcon;
right.setAlpha(66);
}
super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
}

Expand Down

0 comments on commit 7755e6f

Please sign in to comment.