]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/AutoCompleteTextViewWithClear.java
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / AutoCompleteTextViewWithClear.java
index 8b714dac29de31de0f7edbb4ed6d666cfe1f5e2f..78e62d4cf2d7813842af6a1a7980b0ac0d414097 100644 (file)
@@ -57,14 +57,16 @@ public final class AutoCompleteTextViewWithClear extends AppCompatAutoCompleteTe
         setCompoundDrawablesRelative(null, null, null, null);
     }
     private void showClearDrawable() {
-        setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.ic_clear_black_24dp, 0);
+        setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.ic_clear_accent_24dp, 0);
     }
     @Override
     protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
         final boolean hasText = text.length() > 0;
 
-        if (hadText && !hasText) hideClearDrawable();
-        if (!hadText && hasText) showClearDrawable();
+        if (hasFocus()) {
+            if (hadText && !hasText) hideClearDrawable();
+            if (!hadText && hasText) showClearDrawable();
+        }
 
         hadText = hasText;