diff options
author | John Spurlock <jspurlock@google.com> | 2014-05-15 16:14:33 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-05-15 16:15:55 -0400 |
commit | 8baa8b3c0125140b12c0008c84597b908c9fec6a (patch) | |
tree | 3ee7a8b27705e5868722ce3103d4e2d68c54014d /packages/SystemUI/src | |
parent | a3d5d3ca1140304e26c41cc29b029dc9c5330b1b (diff) | |
download | frameworks_base-8baa8b3c0125140b12c0008c84597b908c9fec6a.zip frameworks_base-8baa8b3c0125140b12c0008c84597b908c9fec6a.tar.gz frameworks_base-8baa8b3c0125140b12c0008c84597b908c9fec6a.tar.bz2 |
Add QS location tile animation
Change-Id: I1b4bdd474b44201fdedc6a099bb41e9c054c1ed0
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java index d32f98f..176e05c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java @@ -16,6 +16,8 @@ package com.android.systemui.qs.tiles; +import android.graphics.drawable.AnimationDrawable; + import com.android.systemui.R; import com.android.systemui.qs.QSTile; import com.android.systemui.statusbar.policy.LocationController; @@ -56,16 +58,28 @@ public class LocationTile extends QSTile<QSTile.BooleanState> { protected void handleUpdateState(BooleanState state, Object arg) { final boolean locationEnabled = mController.isLocationEnabled(); state.visible = true; - state.value = locationEnabled; - state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_location); + if (state.value != locationEnabled) { + state.value = locationEnabled; + final AnimationDrawable d = (AnimationDrawable) mContext.getDrawable(locationEnabled + ? R.drawable.ic_location_on_anim + : R.drawable.ic_location_off_anim); + state.icon = d; + mUiHandler.post(new Runnable() { + @Override + public void run() { + d.start(); + } + }); + } + //state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_location); if (locationEnabled) { - state.iconId = R.drawable.ic_qs_location_on; + if (state.icon == null) state.iconId = R.drawable.ic_location_24_01; state.label = mContext.getString(R.string.quick_settings_location_label); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_location, mContext.getString(R.string.accessibility_desc_on)); } else { - state.iconId = R.drawable.ic_qs_location_off; + if (state.icon == null) state.iconId = R.drawable.ic_location_24_11; state.label = mContext.getString(R.string.quick_settings_location_off_label); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_location, |