summaryrefslogtreecommitdiffstats
path: root/src/com/cyngn
diff options
context:
space:
mode:
authorAndy Mast <andy@cyngn.com>2014-11-14 11:30:43 -0800
committerGerrit Code Review <gerrit@cyngn.com>2014-11-17 18:44:09 +0000
commitddacf99ab6929371474b2618a940ebc7b015e623 (patch)
tree1a06bc84fb4c7cb57f54119d5394f03c81a423bb /src/com/cyngn
parenta87d00b5b7ba3a8eaa48ba15e63d3ae5dd241889 (diff)
downloadpackages_apps_ThemeChooser-ddacf99ab6929371474b2618a940ebc7b015e623.zip
packages_apps_ThemeChooser-ddacf99ab6929371474b2618a940ebc7b015e623.tar.gz
packages_apps_ThemeChooser-ddacf99ab6929371474b2618a940ebc7b015e623.tar.bz2
Do not play "click" sound when apply/reset dialog is shown
Clicking around the apply/reset dialog was causing the click sound to be played even though nothing was happening. The solution was to disable ComponentCards when not expanded and to have the ThemePager only play click events when the clickview's sounds are enabled. Change-Id: I6a7ae2afd33e3fc72aa53052233c8e4117d089c2 REF: THEMES-423
Diffstat (limited to 'src/com/cyngn')
-rw-r--r--src/com/cyngn/theme/chooser/ComponentCardView.java3
-rw-r--r--src/com/cyngn/theme/chooser/ThemeFragment.java7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/chooser/ComponentCardView.java b/src/com/cyngn/theme/chooser/ComponentCardView.java
index 8bd1aaf..24eb58c 100644
--- a/src/com/cyngn/theme/chooser/ComponentCardView.java
+++ b/src/com/cyngn/theme/chooser/ComponentCardView.java
@@ -48,6 +48,7 @@ public class ComponentCardView extends LinearLayout {
public ComponentCardView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ setEnabled(false);
}
@Override
@@ -68,6 +69,7 @@ public class ComponentCardView extends LinearLayout {
}
public void expand(boolean showLabel) {
+ setEnabled(true);
TransitionDrawable bg = null;
if (getBackground() instanceof TransitionDrawable) {
bg = (TransitionDrawable) getBackground();
@@ -98,6 +100,7 @@ public class ComponentCardView extends LinearLayout {
}
public void collapse() {
+ setEnabled(false);
if (mLabel != null) {
mLabel.setVisibility(View.GONE);
}
diff --git a/src/com/cyngn/theme/chooser/ThemeFragment.java b/src/com/cyngn/theme/chooser/ThemeFragment.java
index a2181d9..c866215 100644
--- a/src/com/cyngn/theme/chooser/ThemeFragment.java
+++ b/src/com/cyngn/theme/chooser/ThemeFragment.java
@@ -2287,6 +2287,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
anim.alpha(1f).start();
disableActionButtons();
+ mClickableView.setSoundEffectsEnabled(false);
}
public void showDeleteThemeOverlay() {
@@ -2304,6 +2305,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
anim.alpha(1f).start();
disableActionButtons();
+ mClickableView.setSoundEffectsEnabled(false);
}
public void showResetThemeOverlay() {
@@ -2321,6 +2323,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
anim.alpha(1f).start();
disableActionButtons();
+ mClickableView.setSoundEffectsEnabled(false);
}
public void hideConfirmCancelOverlay() {
@@ -2359,6 +2362,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
});
enableActionButtons();
+ mClickableView.setSoundEffectsEnabled(true);
}
public boolean isShowingCustomizeResetLayout() {
@@ -2381,6 +2385,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
anim.alpha(1f).start();
disableActionButtons();
+ mClickableView.setSoundEffectsEnabled(false);
}
public void hideCustomizeResetLayout() {
@@ -2421,6 +2426,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
});
enableActionButtons();
+ mClickableView.setSoundEffectsEnabled(true);
}
public void showThemeTagLayout() {
@@ -2450,6 +2456,7 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb
}
enableActionButtons();
+ mClickableView.setSoundEffectsEnabled(true);
}
public void fadeInCards() {