Skip to content

Commit 9740c01

Browse files
committed
Release v1.1.1
- Fix arrow up and down not update when touch outside - Improve scroll item for search type
1 parent 7284527 commit 9740c01

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The best Android spinner library for your android application with more customiz
113113

114114
```gradle
115115
dependencies {
116-
implementation 'com.github.chivorns:smartmaterialspinner:1.1.0'
116+
implementation 'com.github.chivorns:smartmaterialspinner:1.1.1'
117117
}
118118
```
119119

demojava/src/main/java/com/chivorn/demojava/RuntimeRenderViewActivity.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
import android.graphics.Color;
44
import android.os.Bundle;
5+
import android.util.Log;
56
import android.util.SparseArray;
7+
import android.view.View;
8+
import android.widget.AdapterView;
69
import android.widget.LinearLayout;
10+
import android.widget.Toast;
711

812
import com.chivorn.resourcemodule.MainApp;
913
import com.chivorn.smartmaterialspinner.SmartMaterialSpinner;
@@ -43,11 +47,10 @@ private void initItemListMap() {
4347

4448
private void renderView() {
4549
for (int i = 0; i < 6; i++) {
46-
SmartMaterialSpinner<String> smsp = new SmartMaterialSpinner<>(this);
50+
final SmartMaterialSpinner<String> smsp = new SmartMaterialSpinner<>(this);
51+
smsp.setReSelectable(true);
4752
smsp.setHintColor(Color.GRAY);
4853
smsp.setUnderlineColor(Color.GRAY);
49-
// smsp.setErrorTextSize(13);
50-
// smsp.setMultilineError(true);
5154
smsp.setErrorText("This is error text. Hello Cambodia Kingdom of Wonder. This is error text. Hello Cambodia Kingdom of Wonder. This is error text. Hello Cambodia Kingdom of Wonder. This is error text. Hello Cambodia Kingdom of Wonder. ");
5255
smsp.setItem(itemListMap.get(i));
5356
smsp.setHint("Spinner " + (i + 1));
@@ -56,6 +59,18 @@ private void renderView() {
5659
smsp.setSearchable(true);
5760
}
5861

62+
smsp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
63+
@Override
64+
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
65+
Toast.makeText(getApplicationContext(), "You selected on " + smsp.getSelectedItem(), Toast.LENGTH_SHORT).show();
66+
}
67+
68+
@Override
69+
public void onNothingSelected(AdapterView<?> parent) {
70+
Log.i("AAA", "onNothingSelected: ");
71+
}
72+
});
73+
5974
layoutContainer.addView(smsp);
6075
}
6176
}

smartmaterialspinner/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ext {
55
LIBRARY_NAME = 'SmartMaterialSpinner'
66
PUBLISH_GROUP_ID = 'com.github.chivorns'
77
PUBLISH_ARTIFACT_ID = LIBRARY_NAME.toLowerCase()
8-
PUBLISH_VERSION = '1.1.0'
8+
PUBLISH_VERSION = '1.1.1'
99

1010
// Bintray
1111
BINTRAY_REPO = 'maven'
@@ -32,7 +32,7 @@ android {
3232
defaultConfig {
3333
minSdkVersion 14
3434
targetSdkVersion 28
35-
versionCode 15
35+
versionCode 16
3636
versionName "$PUBLISH_VERSION"
3737

3838
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

smartmaterialspinner/src/main/java/com/chivorn/smartmaterialspinner/SearchableSpinnerDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ private void setGravity(Dialog dialog) {
326326

327327
private void scrollToSelectedItem() {
328328
if (selectedPosition >= 0 && searchListView.isSmoothScrollbarEnabled()) {
329-
searchListView.smoothScrollToPositionFromTop(selectedPosition, 0, 0);
329+
searchListView.smoothScrollToPositionFromTop(selectedPosition, 0, 10);
330330
}
331331
}
332332
}

smartmaterialspinner/src/main/java/com/chivorn/smartmaterialspinner/SmartMaterialSpinner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ public void dismiss() {
749749
if (spinnerEventsListener != null) {
750750
spinnerEventsListener.onSpinnerClosed(this);
751751
}
752+
invalidate();
752753
}
753754

754755
public boolean isShowing() {

0 commit comments

Comments
 (0)