diff --git a/gradle.properties b/gradle.properties index dd4a23e..17c0c6e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.0.3 -VERSION_CODE=103 +VERSION_NAME=1.0.4 +VERSION_CODE=104 GROUP=com.weiwangcn.betterspinner POM_DESCRIPTION=Android Spinner in a Better Design diff --git a/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java b/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java index e81481e..db30240 100644 --- a/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java +++ b/library-material/src/main/java/com/weiwangcn/betterspinner/library/material/MaterialBetterSpinner.java @@ -40,18 +40,14 @@ protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { + performFiltering("", 0); InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getWindowToken(), 0); setKeyListener(null); + dismissDropDown(); } } - @Override - public void setOnClickListener(OnClickListener listener) { - super.setOnClickListener(listener); - performFiltering("", 0); //show everything in the list - } - @Override public boolean onTouchEvent(MotionEvent event) { diff --git a/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java b/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java index 134db85..f16cd1e 100644 --- a/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java +++ b/library/src/main/java/com/weiwangcn/betterspinner/library/BetterSpinner.java @@ -39,18 +39,14 @@ protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { + performFiltering("", 0); InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getWindowToken(), 0); setKeyListener(null); + dismissDropDown(); } } - @Override - public void setOnClickListener(OnClickListener listener) { - super.setOnClickListener(listener); - performFiltering("", 0); //show everything in the list - } - @Override public boolean onTouchEvent(MotionEvent event) {