diff options
author | Daniel Sandler <dsandler@google.com> | 2011-02-24 13:36:52 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-02-24 13:36:52 -0800 |
commit | 551df778f9f25a4763bff06be75106fa8ce2a78a (patch) | |
tree | e974e23a5507beac621a316b03a86ad0aadd58a5 /packages | |
parent | 7e8a69ed5cbeb2bad630877a526ff0c06880d2c2 (diff) | |
parent | 3a2fdedf693cca9146af8fd463e20cca5a2d1e20 (diff) | |
download | frameworks_base-551df778f9f25a4763bff06be75106fa8ce2a78a.zip frameworks_base-551df778f9f25a4763bff06be75106fa8ce2a78a.tar.gz frameworks_base-551df778f9f25a4763bff06be75106fa8ce2a78a.tar.bz2 |
Merge "Remove commented cruft, TODOs, and dead code."
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 169 |
1 files changed, 7 insertions, 162 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 60fb61d..fac2fcd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -93,7 +93,7 @@ public class TabletStatusBar extends StatusBar implements public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041; public static final int MSG_STOP_TICKER = 2000; - // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach + // Fitts' Law assistance for LatinIME; see policy.EventHole private static final boolean FAKE_SPACE_BAR = true; // The height of the bar, as definied by the build. It may be taller if we're plugged @@ -159,7 +159,6 @@ public class TabletStatusBar extends StatusBar implements // for disabling the status bar int mDisabled = 0; - boolean mNotificationsOn = true; private RecentAppsPanel mRecentsPanel; private InputMethodsPanel mInputMethodsPanel; @@ -767,7 +766,7 @@ public class TabletStatusBar extends StatusBar implements } public void removeNotification(IBinder key) { - if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ") // TODO"); + if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ")"); removeNotificationViews(key); mTicker.remove(key); setAreThereNotifications(); @@ -1015,16 +1014,11 @@ public class TabletStatusBar extends StatusBar implements public void onClickNotificationTrigger() { if (DEBUG) Slog.d(TAG, "clicked notification icons; disabled=" + mDisabled); if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) { - if (!mNotificationsOn) { - mNotificationsOn = true; - mIconLayout.setVisibility(View.VISIBLE); // TODO: animation - } else { - int msg = !mNotificationPanel.isShowing() - ? MSG_OPEN_NOTIFICATION_PANEL - : MSG_CLOSE_NOTIFICATION_PANEL; - mHandler.removeMessages(msg); - mHandler.sendEmptyMessage(msg); - } + int msg = !mNotificationPanel.isShowing() + ? MSG_OPEN_NOTIFICATION_PANEL + : MSG_CLOSE_NOTIFICATION_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); } } @@ -1435,155 +1429,6 @@ public class TabletStatusBar extends StatusBar implements return true; } -/* - public class ShadowController { - boolean mShowShadows; - Map<View, View> mShadowsForElements = new IdentityHashMap<View, View>(7); - Map<View, View> mElementsForShadows = new IdentityHashMap<View, View>(7); - LayoutTransition mElementTransition, mShadowTransition; - - View mTouchTarget; - - ShadowController(boolean showShadows) { - mShowShadows = showShadows; - mTouchTarget = null; - - mElementTransition = new LayoutTransition(); -// AnimatorSet s = new AnimatorSet(); -// s.play(ObjectAnimator.ofInt(null, "top", 48, 0)) -// .with(ObjectAnimator.ofFloat(null, "scaleY", 0.5f, 1f)) -// .with(ObjectAnimator.ofFloat(null, "alpha", 0.5f, 1f)) -// ; - mElementTransition.setAnimator(LayoutTransition.APPEARING, //s); - ObjectAnimator.ofInt(null, "top", 48, 0)); - mElementTransition.setDuration(LayoutTransition.APPEARING, 100); - mElementTransition.setStartDelay(LayoutTransition.APPEARING, 0); - -// s = new AnimatorSet(); -// s.play(ObjectAnimator.ofInt(null, "top", 0, 48)) -// .with(ObjectAnimator.ofFloat(null, "scaleY", 1f, 0.5f)) -// .with(ObjectAnimator.ofFloat(null, "alpha", 1f, 0.5f)) -// ; - mElementTransition.setAnimator(LayoutTransition.DISAPPEARING, //s); - ObjectAnimator.ofInt(null, "top", 0, 48)); - mElementTransition.setDuration(LayoutTransition.DISAPPEARING, 400); - - mShadowTransition = new LayoutTransition(); - mShadowTransition.setAnimator(LayoutTransition.APPEARING, - ObjectAnimator.ofFloat(null, "alpha", 0f, 1f)); - mShadowTransition.setDuration(LayoutTransition.APPEARING, 200); - mShadowTransition.setStartDelay(LayoutTransition.APPEARING, 100); - mShadowTransition.setAnimator(LayoutTransition.DISAPPEARING, - ObjectAnimator.ofFloat(null, "alpha", 1f, 0f)); - mShadowTransition.setDuration(LayoutTransition.DISAPPEARING, 100); - - ViewGroup bar = (ViewGroup) TabletStatusBar.this.mBarContents; - bar.setLayoutTransition(mElementTransition); - ViewGroup nav = (ViewGroup) TabletStatusBar.this.mNavigationArea; - nav.setLayoutTransition(mElementTransition); - ViewGroup shadowGroup = (ViewGroup) bar.findViewById(R.id.shadows); - shadowGroup.setLayoutTransition(mShadowTransition); - } - - public void add(View element, View shadow) { - shadow.setOnTouchListener(makeTouchListener()); - mShadowsForElements.put(element, shadow); - mElementsForShadows.put(shadow, element); - } - - public boolean getShadowState() { - return mShowShadows; - } - - public View.OnTouchListener makeTouchListener() { - return new View.OnTouchListener() { - public boolean onTouch(View v, MotionEvent ev) { - final int action = ev.getAction(); - - if (DEBUG) Slog.d(TAG, "ShadowController: v=" + v + ", ev=" + ev); - - // currently redirecting events? - if (mTouchTarget == null) { - mTouchTarget = mElementsForShadows.get(v); - } - - if (mTouchTarget != null && mTouchTarget.getVisibility() != View.GONE) { - boolean last = false; - switch (action) { - case MotionEvent.ACTION_CANCEL: - case MotionEvent.ACTION_UP: - mHandler.removeMessages(MSG_RESTORE_SHADOWS); - if (mShowShadows) { - mHandler.sendEmptyMessageDelayed(MSG_RESTORE_SHADOWS, - v == mNotificationShadow ? 5000 : 500); - } - last = true; - break; - case MotionEvent.ACTION_DOWN: - mHandler.removeMessages(MSG_RESTORE_SHADOWS); - setElementShadow(mTouchTarget, false); - break; - } - mTouchTarget.dispatchTouchEvent(ev); - if (last) mTouchTarget = null; - return true; - } - - return false; - } - }; - } - - public void refresh() { - for (View element : mShadowsForElements.keySet()) { - setElementShadow(element, mShowShadows); - } - } - - public void showAllShadows() { - mShowShadows = true; - refresh(); - } - - public void hideAllShadows() { - mShowShadows = false; - refresh(); - } - - // Use View.INVISIBLE for things hidden due to shadowing, and View.GONE for things that are - // disabled (and should not be shadowed or re-shown) - public void setElementShadow(View button, boolean shade) { - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - if (button.getVisibility() != View.GONE) { - shadow.setVisibility(shade ? View.VISIBLE : View.INVISIBLE); - button.setVisibility(shade ? View.INVISIBLE : View.VISIBLE); - } - } - } - - // Hide both element and shadow, using default layout animations. - public void hideElement(View button) { - Slog.d(TAG, "hiding: " + button); - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - shadow.setVisibility(View.GONE); - } - button.setVisibility(View.GONE); - } - - // Honoring the current shadow state. - public void showElement(View button) { - Slog.d(TAG, "showing: " + button); - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - shadow.setVisibility(mShowShadows ? View.VISIBLE : View.INVISIBLE); - } - button.setVisibility(mShowShadows ? View.INVISIBLE : View.VISIBLE); - } - } - */ - public class TouchOutsideListener implements View.OnTouchListener { private int mMsg; private StatusBarPanel mPanel; |