diff options
author | John Spurlock <jspurlock@google.com> | 2015-06-15 13:49:57 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-06-15 16:33:44 -0400 |
commit | 036e7cbbfab764ea054e55c8d0746389cf6e2fdf (patch) | |
tree | 3d9a74e4dea877ce3d92d8f34302c50e0cabb232 /packages/SystemUI/src/com/android/systemui/qs | |
parent | c97010c08826bce066216dff7ef0ddc86ae42b8c (diff) | |
download | frameworks_base-036e7cbbfab764ea054e55c8d0746389cf6e2fdf.zip frameworks_base-036e7cbbfab764ea054e55c8d0746389cf6e2fdf.tar.gz frameworks_base-036e7cbbfab764ea054e55c8d0746389cf6e2fdf.tar.bz2 |
QS: Add disable animations for the DND tile.
Elide the disabled -> enabled anim, since we launch
the detail panel instead.
Bug: 21118976
Change-Id: I392f848641190f114b7838515acb13f22c96e37d
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/qs')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java index f4d6f04..f97f519 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java @@ -38,6 +38,7 @@ import com.android.systemui.volume.ZenModePanel; /** Quick settings tile: Do not disturb **/ public class DndTile extends QSTile<QSTile.BooleanState> { + private static final Intent ZEN_SETTINGS = new Intent(Settings.ACTION_ZEN_MODE_SETTINGS); @@ -47,6 +48,14 @@ public class DndTile extends QSTile<QSTile.BooleanState> { private static final String ACTION_SET_VISIBLE = "com.android.systemui.dndtile.SET_VISIBLE"; private static final String EXTRA_VISIBLE = "visible"; + private static final QSTile.Icon TOTAL_SILENCE = + ResourceIcon.get(R.drawable.ic_qs_dnd_on_total_silence); + + private final AnimationIcon mDisable = + new AnimationIcon(R.drawable.ic_dnd_disable_animation); + private final AnimationIcon mDisableTotalSilence = + new AnimationIcon(R.drawable.ic_dnd_total_silence_disable_animation); + private final ZenModeController mController; private final DndDetailAdapter mDetailAdapter; @@ -89,6 +98,8 @@ public class DndTile extends QSTile<QSTile.BooleanState> { @Override public void handleClick() { + mDisable.setAllowAnimation(true); + mDisableTotalSilence.setAllowAnimation(true); MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); if (mState.value) { mController.setZen(Global.ZEN_MODE_OFF, null, TAG); @@ -114,7 +125,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> { R.string.accessibility_quick_settings_dnd_priority_on); break; case Global.ZEN_MODE_NO_INTERRUPTIONS: - state.icon = ResourceIcon.get(R.drawable.ic_qs_dnd_on_total_silence); + state.icon = TOTAL_SILENCE; state.label = mContext.getString(R.string.quick_settings_dnd_none_label); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_dnd_none_on); @@ -126,7 +137,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> { R.string.accessibility_quick_settings_dnd_alarms_on); break; default: - state.icon = ResourceIcon.get(R.drawable.ic_qs_dnd_off); + state.icon = TOTAL_SILENCE.equals(state.icon) ? mDisableTotalSilence : mDisable; state.label = mContext.getString(R.string.quick_settings_dnd_label); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_dnd_off); |