From d14d13678e6c01e55a0d8e6d05a1938a7fb00c86 Mon Sep 17 00:00:00 2001 From: skydoves Date: Sun, 22 Mar 2020 03:34:20 +0900 Subject: [PATCH] Release version 1.0.5 --- .github/CODEOWNERS | 16 +++++++++++++ README.md | 58 ++++++++++++++++++++++----------------------- dependencies.gradle | 4 ++-- 3 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1f757e6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,16 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. + +# More details are here: https://help.github.com/articles/about-codeowners/ + +# The '*' pattern is global owners. +# Not adding in this PR, but I'd like to try adding a global owner set with the entire team. +# One interpretation of their docs is that global owners are added only if not removed +# by a more local rule. + +# Order is important. The last matching pattern has the most precedence. +# The folders are ordered as follows: + +# In each subsection folders are ordered first by depth, then alphabetically. +# This should make it easy to add new rules without breaking existing ones. +* @skydoves \ No newline at end of file diff --git a/README.md b/README.md index 041117c..3e812ce 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ -# PowerSpinner License +

PowerSpinner


- License - API - Build Status - Android Weekly - Javadoc -

+🌀 A lightweight dropdown popup spinner with fully customizable arrow and animations. +


-🌀 A lightweight dropdown popup spinner with an arrow and animations. -

+ License + API + Build Status + Android Weekly + Profile + Javadoc +


@@ -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 -when an item is selected, the spinner popup will be dismissed.
-But you can show and dismiss manually using methods. +If the `PowerSpinnerView` is clicked, the spinner popup will be shown and when an item is selected,
the spinner popup will be dismissed. We can also show and dismiss manually using below methods. ```kotlin powerSpinnerView.show() // show the spinner popup @@ -106,7 +105,7 @@ powerSpinnerView.dismiss() // dismiss the spinner popup powerSpinnerView.showOrDismiss() ``` -And you can set the show and dismiss actions using some listener and attributes. +And we can customize the basic actions of the spinner popup using the following ways. ```kotlin // the spinner popup will not be shown when clicked. powerSpinnerView.setOnClickListener { } @@ -122,36 +121,36 @@ setOnSpinnerItemSelectedListener { index, text -> toast("$text selected!") } ``` -Here is the java way. +Here is the Java way. ```java powerSpinnerView.setOnSpinnerItemSelectedListener(new OnSpinnerItemSelectedListener() { @Override public void onItemSelected(int position, String item) { - toast(item + " selected!") + toast(item + " selected!"); } }); ``` -### selectItemByIndex +### Select an item by an index We can select an item manually or initially using the below method. ```kotlin -spinnerView.selectItemByIndex(4) +powerSpinnerView.selectItemByIndex(4) ``` -### Persist a selected position -We can save and restore the selected postion automatically.
-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 { ind } ``` -### Avoid Memory leak +### Avoid Memory Leak Dialog, PopupWindow and etc.. have memory leak issue if not dismissed before activity or fragment are destroyed.
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',