diff options
Diffstat (limited to 'packages')
17 files changed, 129 insertions, 118 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/notify_panel_bg.9.png b/packages/SystemUI/res/drawable-hdpi/notify_panel_bg.9.png Binary files differdeleted file mode 100644 index d5503f7..0000000 --- a/packages/SystemUI/res/drawable-hdpi/notify_panel_bg.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/notify_panel_bg_protect.png b/packages/SystemUI/res/drawable-hdpi/notify_panel_bg_protect.png Binary files differdeleted file mode 100644 index a8f2236..0000000 --- a/packages/SystemUI/res/drawable-hdpi/notify_panel_bg_protect.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png Binary files differdeleted file mode 100644 index 8725e58..0000000 --- a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png Binary files differdeleted file mode 100644 index f7225ed..0000000 --- a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-nodpi/notify_panel_bg.png b/packages/SystemUI/res/drawable-nodpi/notify_panel_bg.png Binary files differdeleted file mode 100644 index 1ea924f..0000000 --- a/packages/SystemUI/res/drawable-nodpi/notify_panel_bg.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml b/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml deleted file mode 100644 index 0371322..0000000 --- a/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2011 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<bitmap - xmlns:android="http://schemas.android.com/apk/res/android" - android:src="@drawable/notify_panel_bg_protect" - android:tileMode="repeat" - /> - diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index dbbaf96..b63afbe 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -86,6 +86,16 @@ android:layout_height="wrap_content" android:layout_weight="1" > + <TextView android:id="@+id/noNotificationsTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@android:style/TextAppearance.Large" + android:padding="8dp" + android:layout_gravity="top" + android:gravity="center" + android:text="@string/status_bar_no_notifications_title" + /> + <ScrollView android:id="@+id/scroll" android:layout_width="match_parent" @@ -93,29 +103,12 @@ android:fadingEdge="none" android:overScrollMode="ifContentScrolls" > - <LinearLayout - android:id="@+id/notificationLinearLayout" + <com.android.systemui.statusbar.policy.NotificationRowLayout + android:id="@+id/latestItems" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - > - - <TextView android:id="@+id/noNotificationsTitle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textAppearance="@android:style/TextAppearance.Large" - android:padding="8dp" - android:gravity="center" - android:text="@string/status_bar_no_notifications_title" - /> - - <com.android.systemui.statusbar.policy.NotificationRowLayout - android:id="@+id/latestItems" - android:layout_width="match_parent" - android:layout_height="wrap_content" - systemui:rowHeight="@dimen/notification_height" - /> - </LinearLayout> + systemui:rowHeight="@dimen/notification_height" + /> </ScrollView> <ImageView diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index 0219a77..3919685 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -17,7 +17,7 @@ --> <resources> <!-- thickness (width) of the navigation bar on phones that require it --> - <dimen name="navigation_bar_size">42dp</dimen> + <dimen name="navigation_bar_size">@*android:dimen/navigation_bar_width</dimen> <!-- Recent Applications parameters --> <!-- Width of a recent app view, including all content --> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index ba1aea3..ef9b8dd 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -40,7 +40,7 @@ <dimen name="peek_window_y_offset">-12dp</dimen> <!-- thickness (height) of the navigation bar on phones that require it --> - <dimen name="navigation_bar_size">48dp</dimen> + <dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen> <!-- thickness (height) of the dead zone at the top of the navigation bar, reducing false presses on navbar buttons; approx 2mm --> diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 6ecfd94..2818f87 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -43,6 +43,7 @@ public class SwipeHelper { private float SWIPE_ESCAPE_VELOCITY = 100f; // dp/sec private int MAX_ESCAPE_ANIMATION_DURATION = 500; // ms + private int MAX_DISMISS_VELOCITY = 1000; // dp/sec private static final int SNAP_ANIM_LEN = SLOW_ANIMATIONS ? 1000 : 250; // ms public static float ALPHA_FADE_START = 0.8f; // fraction of thumbnail width @@ -281,7 +282,7 @@ public class SwipeHelper { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: if (mCurrView != null) { - float maxVelocity = 1000; // px/sec + float maxVelocity = MAX_DISMISS_VELOCITY * mDensityScale; mVelocityTracker.computeCurrentVelocity(1000 /* px/sec */, maxVelocity); float escapeVelocity = SWIPE_ESCAPE_VELOCITY * mDensityScale; float velocity = getVelocity(mVelocityTracker); diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java index 14efdd0..36f1659 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java @@ -165,6 +165,13 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); + + // Skip this work if a transition is running; it sets the scroll values independently + // and should not have those animated values clobbered by this logic + LayoutTransition transition = mLinearLayout.getLayoutTransition(); + if (transition != null && transition.isRunning()) { + return; + } // Keep track of the last visible item in the list so we can restore it // to the bottom when the orientation changes. mLastScrollPosition = scrollPositionOfMostRecent(); @@ -172,7 +179,12 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView // This has to happen post-layout, so run it "in the future" post(new Runnable() { public void run() { - scrollTo(mLastScrollPosition, 0); + // Make sure we're still not clobbering the transition-set values, since this + // runnable launches asynchronously + LayoutTransition transition = mLinearLayout.getLayoutTransition(); + if (transition == null || !transition.isRunning()) { + scrollTo(mLastScrollPosition, 0); + } } }); } diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index 1bcc413..89900a1 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -166,6 +166,13 @@ public class RecentsVerticalScrollView extends ScrollView implements SwipeHelper @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); + + // Skip this work if a transition is running; it sets the scroll values independently + // and should not have those animated values clobbered by this logic + LayoutTransition transition = mLinearLayout.getLayoutTransition(); + if (transition != null && transition.isRunning()) { + return; + } // Keep track of the last visible item in the list so we can restore it // to the bottom when the orientation changes. mLastScrollPosition = scrollPositionOfMostRecent(); @@ -173,7 +180,12 @@ public class RecentsVerticalScrollView extends ScrollView implements SwipeHelper // This has to happen post-layout, so run it "in the future" post(new Runnable() { public void run() { - scrollTo(0, mLastScrollPosition); + // Make sure we're still not clobbering the transition-set values, since this + // runnable launches asynchronously + LayoutTransition transition = mLinearLayout.getLayoutTransition(); + if (transition == null || !transition.isRunning()) { + scrollTo(0, mLastScrollPosition); + } } }); } diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index fc21929..86dc9a6 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -91,7 +91,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi try { long currentTime = System.currentTimeMillis(); - String date = new SimpleDateFormat("yyyy-MM-dd-kk-mm-ss").format(new Date(currentTime)); + String date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date(currentTime)); String imageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES).getAbsolutePath(); String imageFileName = String.format(SCREENSHOT_FILE_NAME_TEMPLATE, date); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 2740898..abf505c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -112,7 +112,7 @@ public class NavigationBarView extends LinearLayout { public void onAnimationEnd(Animator _a) { mLastAnimator = null; if (hide) { - setVisibility(View.INVISIBLE); + setVisibility(View.GONE); } } }); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index e14317b..a54c5c2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.animation.ObjectAnimator; import android.app.ActivityManagerNative; import android.app.Dialog; import android.app.Notification; @@ -42,6 +43,7 @@ import android.os.ServiceManager; import android.os.SystemClock; import android.provider.Settings; import android.text.TextUtils; +import android.util.DisplayMetrics; import android.util.Slog; import android.util.Log; import android.view.Display; @@ -85,8 +87,8 @@ import com.android.systemui.statusbar.policy.NetworkController; public class PhoneStatusBar extends StatusBar { static final String TAG = "PhoneStatusBar"; - static final boolean SPEW = false; public static final boolean DEBUG = false; + public static final boolean SPEW = false; // additional instrumentation for testing purposes; intended to be left on during development public static final boolean CHATTY = DEBUG || true; @@ -136,7 +138,6 @@ public class PhoneStatusBar extends StatusBar { ExpandedView mExpandedView; WindowManager.LayoutParams mExpandedParams; ScrollView mScrollView; - View mNotificationLinearLayout; View mExpandedContents; // top bar TextView mNoNotificationsTitle; @@ -201,11 +202,11 @@ public class PhoneStatusBar extends StatusBar { // tracking calls to View.setSystemUiVisibility() int mSystemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE; - final Point mDisplaySize = new Point(); + DisplayMetrics mDisplayMetrics = new DisplayMetrics(); private class ExpandedDialog extends Dialog { ExpandedDialog(Context context) { - super(context, com.android.internal.R.style.Theme_Light_NoTitleBar); + super(context, com.android.internal.R.style.Theme_Translucent_NoTitleBar); } @Override @@ -248,7 +249,12 @@ public class PhoneStatusBar extends StatusBar { Resources res = context.getResources(); - mDisplay.getSize(mDisplaySize); + mDisplay.getMetrics(mDisplayMetrics); + if (DEBUG) { + Slog.d(TAG, "makeStatusBarView: mDisplayMetrics=" + mDisplayMetrics); + mDisplayMetrics = res.getDisplayMetrics(); + Slog.d(TAG, "makeStatusBarView: mDisplayMetrics2=" + mDisplayMetrics); + } loadDimens(); mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size); @@ -305,16 +311,18 @@ public class PhoneStatusBar extends StatusBar { mExpandedDialog = new ExpandedDialog(context); mExpandedView = expanded; - mExpandedContents = expanded.findViewById(R.id.notificationLinearLayout); mPile = (ViewGroup)expanded.findViewById(R.id.latestItems); + mExpandedContents = mPile; // was: expanded.findViewById(R.id.notificationLinearLayout); mNoNotificationsTitle = (TextView)expanded.findViewById(R.id.noNotificationsTitle); + mNoNotificationsTitle.setAlpha(0f); + mNoNotificationsTitle.setVisibility(View.VISIBLE); mClearButton = expanded.findViewById(R.id.clear_all_button); mClearButton.setOnClickListener(mClearButtonListener); + mClearButton.setAlpha(0f); mDateView = (DateView)expanded.findViewById(R.id.date); mSettingsButton = expanded.findViewById(R.id.settings_button); mSettingsButton.setOnClickListener(mSettingsButtonListener); mScrollView = (ScrollView)expanded.findViewById(R.id.scroll); - mNotificationLinearLayout = expanded.findViewById(R.id.notificationLinearLayout); mTicker = new MyTicker(context, sb); @@ -549,7 +557,9 @@ public class PhoneStatusBar extends StatusBar { boolean immersive = false; try { immersive = ActivityManagerNative.getDefault().isTopActivityImmersive(); - Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive")); + if (DEBUG) { + Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive")); + } } catch (RemoteException ex) { } if (immersive) { @@ -579,8 +589,7 @@ public class PhoneStatusBar extends StatusBar { } } else if (notification.notification.fullScreenIntent != null) { // not immersive & a full-screen alert should be shown - Slog.d(TAG, "Notification has fullScreenIntent and activity is not immersive;" - + " sending fullScreenIntent"); + Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent"); try { notification.notification.fullScreenIntent.send(); } catch (PendingIntent.CanceledException e) { @@ -701,9 +710,10 @@ public class PhoneStatusBar extends StatusBar { mTicker.removeEntry(old); // Recalculate the position of the sliding windows and the titles. - setAreThereNotifications(); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); } + + setAreThereNotifications(); } @Override @@ -1008,13 +1018,37 @@ public class PhoneStatusBar extends StatusBar { } private void setAreThereNotifications() { - mClearButton.setVisibility(mNotificationData.hasClearableItems() - ? View.VISIBLE - : View.INVISIBLE); + final boolean any = mNotificationData.size() > 0; + + final boolean clearable = any && mNotificationData.hasClearableItems(); + + if (DEBUG) { + Slog.d(TAG, "setAreThereNotifications: N=" + mNotificationData.size() + + " any=" + any + " clearable=" + clearable); + } + + if (mClearButton.isShown()) { + if (clearable != (mClearButton.getAlpha() == 1.0f)) { + ObjectAnimator.ofFloat(mClearButton, "alpha", + clearable ? 1.0f : 0.0f) + .setDuration(250) + .start(); + } + } else { + mClearButton.setAlpha(clearable ? 1.0f : 0.0f); + } - mNoNotificationsTitle.setVisibility(mNotificationData.size() > 0 - ? View.GONE - : View.VISIBLE); + if (mNoNotificationsTitle.isShown()) { + if (any != (mNoNotificationsTitle.getAlpha() == 0.0f)) { + ObjectAnimator a = ObjectAnimator.ofFloat(mNoNotificationsTitle, "alpha", + (any ? 0.0f : 0.75f)); + a.setDuration(any ? 0 : 500); + a.setStartDelay(any ? 250 : 1000); + a.start(); + } + } else { + mNoNotificationsTitle.setAlpha(any ? 0.0f : 0.75f); + } } @@ -1110,6 +1144,9 @@ public class PhoneStatusBar extends StatusBar { updateExpandedViewPos(EXPANDED_LEAVE_ALONE); mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + if (DEBUG) { + Slog.d(TAG, "makeExpandedVisible: expanded params = " + mExpandedParams); + } mExpandedDialog.getWindow().setAttributes(mExpandedParams); mExpandedView.requestFocus(View.FOCUS_FORWARD); mTrackingView.setVisibility(View.VISIBLE); @@ -1155,7 +1192,7 @@ public class PhoneStatusBar extends StatusBar { if (mAnimating) { y = (int)mAnimY; } else { - y = mDisplaySize.y-1; + y = mDisplayMetrics.heightPixels-1; } // Let the fling think that we're open so it goes in the right direction // and doesn't try to re-open the windowshade. @@ -1210,7 +1247,7 @@ public class PhoneStatusBar extends StatusBar { if (SPEW) Slog.d(TAG, "doAnimation before mAnimY=" + mAnimY); incrementAnim(); if (SPEW) Slog.d(TAG, "doAnimation after mAnimY=" + mAnimY); - if (mAnimY >= mDisplaySize.y-1) { + if (mAnimY >= mDisplayMetrics.heightPixels-1) { if (SPEW) Slog.d(TAG, "Animation completed to expanded state."); mAnimating = false; updateExpandedViewPos(EXPANDED_FULL_OPEN); @@ -1317,7 +1354,7 @@ public class PhoneStatusBar extends StatusBar { if (mExpanded) { if (!always && ( vel > 200.0f - || (y > (mDisplaySize.y-25) && vel > -200.0f))) { + || (y > (mDisplayMetrics.heightPixels-25) && vel > -200.0f))) { // We are expanded, but they didn't move sufficiently to cause // us to retract. Animate back to the expanded position. mAnimAccel = 2000.0f; @@ -1335,7 +1372,7 @@ public class PhoneStatusBar extends StatusBar { } else { if (always || ( vel > 200.0f - || (y > (mDisplaySize.y/2) && vel > -200.0f))) { + || (y > (mDisplayMetrics.heightPixels/2) && vel > -200.0f))) { // We are collapsed, and they moved enough to allow us to // expand. Animate in the notifications. mAnimAccel = 2000.0f; @@ -1393,14 +1430,14 @@ public class PhoneStatusBar extends StatusBar { mViewDelta = mAbsPos[1] + mTrackingView.getHeight() - y; } if ((!mExpanded && y < hitSize) || - (mExpanded && y > (mDisplaySize.y-hitSize))) { + (mExpanded && y > (mDisplayMetrics.heightPixels-hitSize))) { // We drop events at the edge of the screen to make the windowshade come // down by accident less, especially when pushing open a device with a keyboard // that rotates (like g1 and droid) int x = (int)event.getRawX(); final int edgeBorder = mEdgeBorder; - if (x >= edgeBorder && x < mDisplaySize.x - edgeBorder) { + if (x >= edgeBorder && x < mDisplayMetrics.widthPixels - edgeBorder) { prepareTracking(y, !mExpanded);// opening if we're not already fully visible mVelocityTracker.addMovement(event); } @@ -1641,7 +1678,7 @@ public class PhoneStatusBar extends StatusBar { + " mAnimLastTime=" + mAnimLastTime); pw.println(" mAnimatingReveal=" + mAnimatingReveal + " mViewDelta=" + mViewDelta); - pw.println(" mDisplaySize=" + mDisplaySize); + pw.println(" mDisplayMetrics=" + mDisplayMetrics); pw.println(" mExpandedParams: " + mExpandedParams); pw.println(" mExpandedView: " + viewInfo(mExpandedView)); pw.println(" mExpandedDialog: " + mExpandedDialog); @@ -1653,7 +1690,6 @@ public class PhoneStatusBar extends StatusBar { pw.println(" mTickerView: " + viewInfo(mTickerView)); pw.println(" mScrollView: " + viewInfo(mScrollView) + " scroll " + mScrollView.getScrollX() + "," + mScrollView.getScrollY()); - pw.println("mNotificationLinearLayout: " + viewInfo(mNotificationLinearLayout)); } /* synchronized (mNotificationData) { @@ -1717,7 +1753,8 @@ public class PhoneStatusBar extends StatusBar { ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL, - WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + 0 + | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, pixelFormat); @@ -1739,9 +1776,10 @@ public class PhoneStatusBar extends StatusBar { lp = mExpandedDialog.getWindow().getAttributes(); lp.x = 0; - mTrackingPosition = lp.y = mDisplaySize.y; // sufficiently large negative + mTrackingPosition = lp.y = mDisplayMetrics.heightPixels; // sufficiently large negative lp.type = WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL; - lp.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + lp.flags = 0 + | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_DITHER @@ -1772,14 +1810,14 @@ public class PhoneStatusBar extends StatusBar { void updateExpandedInvisiblePosition() { if (mTrackingView != null) { - mTrackingPosition = -mDisplaySize.y; + mTrackingPosition = -mDisplayMetrics.heightPixels; if (mTrackingParams != null) { mTrackingParams.y = mTrackingPosition; WindowManagerImpl.getDefault().updateViewLayout(mTrackingView, mTrackingParams); } } if (mExpandedParams != null) { - mExpandedParams.y = -mDisplaySize.y; + mExpandedParams.y = -mDisplayMetrics.heightPixels; mExpandedDialog.getWindow().setAttributes(mExpandedParams); } } @@ -1792,7 +1830,7 @@ public class PhoneStatusBar extends StatusBar { } int h = mStatusBarView.getHeight(); - int disph = mDisplaySize.y; + int disph = mDisplayMetrics.heightPixels; // If the expanded view is not visible, make sure they're still off screen. // Maybe the view was resized. @@ -1845,7 +1883,7 @@ public class PhoneStatusBar extends StatusBar { // If the tracking view is not yet visible, then we can't have // a good value of the close view location. We need to wait for // it to be visible to do a layout. - mExpandedParams.y = -mDisplaySize.y; + mExpandedParams.y = -mDisplayMetrics.heightPixels; } int max = h; if (mExpandedParams.y > max) { @@ -1891,7 +1929,10 @@ public class PhoneStatusBar extends StatusBar { } void updateDisplaySize() { - mDisplay.getSize(mDisplaySize); + mDisplay.getMetrics(mDisplayMetrics); + if (DEBUG) { + Slog.d(TAG, "updateDisplaySize: " + mDisplayMetrics); + } updateExpandedSize(); } @@ -1899,9 +1940,9 @@ public class PhoneStatusBar extends StatusBar { if (DEBUG) { Slog.d(TAG, "updateExpandedSize()"); } - if (mExpandedDialog != null && mExpandedParams != null && mDisplaySize != null) { - mExpandedParams.width = mDisplaySize.x; - mExpandedParams.height = getExpandedHeight(mDisplaySize.y); + if (mExpandedDialog != null && mExpandedParams != null && mDisplayMetrics != null) { + mExpandedParams.width = mDisplayMetrics.widthPixels; + mExpandedParams.height = getExpandedHeight(mDisplayMetrics.heightPixels); if (!mExpandedVisible) { updateExpandedInvisiblePosition(); } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingView.java index fc0f332..cc23afc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingView.java @@ -26,7 +26,6 @@ import android.widget.LinearLayout; public class TrackingView extends LinearLayout { - final Display mDisplay; PhoneStatusBar mService; boolean mTracking; int mStartX, mStartY; @@ -34,8 +33,6 @@ public class TrackingView extends LinearLayout { public TrackingView(Context context, AttributeSet attrs) { super(context, attrs); - mDisplay = ((WindowManager)context.getSystemService( - Context.WINDOW_SERVICE)).getDefaultDisplay(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java index 2a0dfb5..469b462 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java @@ -166,20 +166,16 @@ public class NotificationRowLayout extends ViewGroup implements SwipeHelper.Call mAppearingViews.add(child); child.setPivotY(0); - AnimatorSet a = new AnimatorSet(); - a.playTogether( - ObjectAnimator.ofFloat(child, "alpha", 0f, 1f) -// ,ObjectAnimator.ofFloat(child, "scaleY", 0f, 1f) - ); - a.setDuration(APPEAR_ANIM_LEN); - a.addListener(new AnimatorListenerAdapter() { + final ObjectAnimator alphaFade = ObjectAnimator.ofFloat(child, "alpha", 0f, 1f); + alphaFade.setDuration(APPEAR_ANIM_LEN); + alphaFade.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mAppearingViews.remove(childF); requestLayout(); // pick up any final changes in position } }); - a.start(); + alphaFade.start(); requestLayout(); // start the container animation } } @@ -195,23 +191,10 @@ public class NotificationRowLayout extends ViewGroup implements SwipeHelper.Call child.setPivotY(0); - //final float velocity = (mSlidingChild == child) - // ? Math.min(mLiftoffVelocity, SWIPE_ANIM_VELOCITY_MIN) - // : SWIPE_ESCAPE_VELOCITY; - final float velocity = 0f; - final TimeAnimator zoom = new TimeAnimator(); - zoom.setTimeListener(new TimeAnimator.TimeListener() { - @Override - public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) { - childF.setTranslationX(childF.getTranslationX() + deltaTime / 1000f * velocity); - } - }); - final ObjectAnimator alphaFade = ObjectAnimator.ofFloat(child, "alpha", 0f); alphaFade.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - zoom.cancel(); // it won't end on its own if (DEBUG) Slog.d(TAG, "actually removing child: " + childF); NotificationRowLayout.super.removeView(childF); childF.setAlpha(1f); @@ -220,14 +203,8 @@ public class NotificationRowLayout extends ViewGroup implements SwipeHelper.Call } }); - AnimatorSet a = new AnimatorSet(); - a.playTogether(alphaFade, zoom); - -// ,ObjectAnimator.ofFloat(child, "scaleY", 0f) -// ,ObjectAnimator.ofFloat(child, "translationX", child.getTranslationX() + 300f) - - a.setDuration(DISAPPEAR_ANIM_LEN); - a.start(); + alphaFade.setDuration(DISAPPEAR_ANIM_LEN); + alphaFade.start(); requestLayout(); // start the container animation } else { super.removeView(child); |