diff options
author | Clark Scheff <clark@cyngn.com> | 2014-10-06 17:45:55 -0700 |
---|---|---|
committer | d34d <clark@cyngn.com> | 2014-10-08 08:42:19 -0700 |
commit | cb25c65268f63176b278d37b36bf412aefd2ddd0 (patch) | |
tree | 832226f7f0bb5f0ed6b66fd72c7442f0cec4a866 /src | |
parent | f0ffe395cbd7701dc5a97ed31533b96edde29a8a (diff) | |
download | packages_apps_ThemeChooser-cb25c65268f63176b278d37b36bf412aefd2ddd0.tar.gz packages_apps_ThemeChooser-cb25c65268f63176b278d37b36bf412aefd2ddd0.tar.bz2 packages_apps_ThemeChooser-cb25c65268f63176b278d37b36bf412aefd2ddd0.zip |
Don't update selection if user clicks on currently selected item
When the user clicks on a component that is currently selected,
the listener is called and the card animates the changes even
though nothing really changed. This patch makes sure the listener
is only called when the item clicked on is not the currently
selected item.
Change-Id: I669ce730420b1a83212725c91926242cf2f06fb9
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyngn/theme/chooser/ComponentSelector.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/cyngn/theme/chooser/ComponentSelector.java b/src/com/cyngn/theme/chooser/ComponentSelector.java index 0663dba..881f636 100644 --- a/src/com/cyngn/theme/chooser/ComponentSelector.java +++ b/src/com/cyngn/theme/chooser/ComponentSelector.java @@ -693,7 +693,8 @@ public class ComponentSelector extends LinearLayout public void onClick(View v) { String pkgName = (String) v.getTag(); if (DEBUG_SELECTOR) Toast.makeText(mContext, pkgName, Toast.LENGTH_SHORT).show(); - if (mListener != null) { + if (mListener != null && !pkgName.equals(mSelectedComponentPkgName)) { + mSelectedComponentPkgName = pkgName; mListener.onItemClicked(pkgName); final int count = mContent.getChildCount(); final Resources res = getResources(); |