From d14d13678e6c01e55a0d8e6d05a1938a7fb00c86 Mon Sep 17 00:00:00 2001
From: skydoves PowerSpinner
+🌀 A lightweight dropdown popup spinner with fully customizable arrow and animations.
+
-🌀 A lightweight dropdown popup spinner with an arrow and animations. -
+ + + + + + +
@@ -35,7 +36,7 @@ allprojects {
And add a dependency code to your **module**'s `build.gradle` file.
```gradle
dependencies {
- implementation "com.github.skydoves:powerspinner:1.0.4"
+ implementation "com.github.skydoves:powerspinner:1.0.5"
}
```
@@ -47,9 +48,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto"
```
### PowerSpinnerView
-Here is a basic example of implementing `PowerSpinnerView`.
-Basically the `PowerSpinnerView` extends `TextView`, so we can use it like a `TextView`.
-You can set the unselected text using `hint` and `textColorHint` attributes.
+Here is a basic example of implementing `PowerSpinnerView` in XML layout.
+Basically We can use `PowerSpinnerView` like a `TextView`.
+We can set the text using the `hint` and `textColorHint` attributes when the item is not selected.
```gradle
-If you select an item, the same position will be selected automatically on the next inflation.
+### Store and restore a selected position
+We can store and restore the selected position in the past automatically.
+If we select an item, the position that we selected will be selected again automatically on the next inflation.
Just use the below method or attribute.
```kotlin
-spinnerView.preferenceName = "country"
+powerSpinnerView.preferenceName = "country"
```
-Or you can set it on xml.
+Or we can set it using attribute in XML layout.
```gradle
app:spinner_preference_name="country"
```
-You can remove the persisted position data on an item or clear all of the data on your application.
+We can remove the stored position data on an item or clear all of the data on your application.
```kotlin
spinnerView.removePersistedData("country")
@@ -167,7 +166,7 @@ SpinnerAnimation.FADE
SpinnerAnimation.BOUNCE
```
-| NORMAL | Dropdown | Fade | Bounce |
+| NORMAL | DROPDOWN | FADE | BOUNCE |
| :---------------: | :---------------: | :---------------: | :---------------: |
| | | | |
@@ -289,7 +288,7 @@ countySpinnerPreference?.setOnSpinnerItemSelectedListener
But Lifecycles are now integrated with the Support Library since Architecture Components 1.0 Stable released.
So we can solve the memory leak issue so easily.
@@ -306,6 +305,7 @@ spinner_arrow_drawable | Drawable | arrow | arrow drawable.
spinner_arrow_show | Boolean | true | sets the visibility of the arrow.
spinner_arrow_gravity | SpinnerGravity | end | the gravity of the arrow.
spinner_arrow_padding | Dimension | 2dp | padding of the arrow.
+spinner_arrow_tint | Color | None | tint color of the arrow.
spinner_arrow_animate | Boolean | true | show arrow rotation animation when showing.
spinner_arrow_animate_duration | integer | 250 | the duration of the arrow animation.
spinner_divider_show | Boolean | true | show the divider of the popup items.
diff --git a/dependencies.gradle b/dependencies.gradle
index 9a28bad..38a098f 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -1,8 +1,8 @@
ext.versions = [
minSdk : 17,
compileSdk : 29,
- versionCode : 5,
- versionName : '1.0.4',
+ versionCode : 6,
+ versionName : '1.0.5',
gradleBuildTool : '3.5.3',
spotlessGradle : '3.27.2',