diff options
author | 2013-04-24 11:49:33 +0000 | |
---|---|---|
committer | 2013-04-24 11:49:33 +0000 | |
commit | 776edcfe46c59c77fc5ab2b54b9a3dbdc334b6f1 (patch) | |
tree | 5ed1f0c27e32e8fe414d0da94dc27d48112a3342 /java/src | |
parent | 911f326857ee083c8ee5f278f71531f182bfe0d2 (diff) | |
parent | d98f406dd31c9f72ba3273b10b521a1a77136ac3 (diff) | |
download | latinime-776edcfe46c59c77fc5ab2b54b9a3dbdc334b6f1.tar.gz latinime-776edcfe46c59c77fc5ab2b54b9a3dbdc334b6f1.tar.xz latinime-776edcfe46c59c77fc5ab2b54b9a3dbdc334b6f1.zip |
Merge "[PB2] Small bugfix"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/WordListPreference.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java index f042795dd..a9301e254 100644 --- a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java +++ b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java @@ -203,17 +203,27 @@ public final class WordListPreference extends Preference { @Override public void onClick(final View v) { final Button button = (Button)v.findViewById(R.id.wordlist_button); - animateButton(button, ANIMATION_IN); final ViewParent parent = v.getParent(); // Just in case something changed in the framework, test for the concrete class if (!(parent instanceof ListView)) return; final ListView listView = (ListView)parent; final int myIndex = listView.indexOfChild(v) + listView.getFirstVisiblePosition(); if (NOT_AN_INDEX != sLastClickedIndex) { + // If another button is showing, hide it animateButton(getButtonForIndex(listView, sLastClickedIndex), ANIMATION_OUT); } - sLastClickedIndex = myIndex; - sLastClickedWordlistId = mWordlistId; + if (sLastClickedWordlistId == mWordlistId) { + // This button was being shown. Clear last state to record that there isn't a + // displayed button any more. + sLastClickedIndex = NOT_AN_INDEX; + sLastClickedWordlistId = null; + } else { + // This button was not being shown. Show it and mark it as the latest selected + // button. + animateButton(button, ANIMATION_IN); + sLastClickedIndex = myIndex; + sLastClickedWordlistId = mWordlistId; + } } } |