Loading packages/SystemUI/res/layout-land/status_bar_recent_panel.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,11 @@ android:layout_width="match_parent" systemui:recentItemLayout="@layout/status_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" Loading packages/SystemUI/res/layout-port/status_bar_recent_panel.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,11 @@ android:layout_width="match_parent" systemui:recentItemLayout="@layout/status_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" Loading packages/SystemUI/res/layout/system_bar_recent_panel.xml +5 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,11 @@ android:clipChildren="false" systemui:recentItemLayout="@layout/system_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/recents_bg_protect_tile" Loading @@ -38,7 +42,6 @@ android:layout_marginBottom="@*android:dimen/system_bar_height" android:clipToPadding="false" android:clipChildren="false"> <ImageView android:id="@+id/recents_transition_placeholder_icon" android:layout_width="wrap_content" Loading packages/SystemUI/src/com/android/systemui/recent/Choreographer.java +24 −2 Original line number Diff line number Diff line Loading @@ -20,15 +20,19 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.AnimatorSet.Builder; import android.animation.ObjectAnimator; import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.util.Slog; import android.view.View; import android.view.ViewRootImpl; import com.android.systemui.R; /* package */ class Choreographer implements Animator.AnimatorListener { // should group this into a multi-property animation private static final int OPEN_DURATION = 136; private static final int CLOSE_DURATION = 130; private static final int CLOSE_DURATION = 230; private static final int SCRIM_DURATION = 400; private static final String TAG = RecentsPanelView.TAG; private static final boolean DEBUG = RecentsPanelView.DEBUG; Loading Loading @@ -81,7 +85,7 @@ import android.view.ViewRootImpl; mContentView.getAlpha(), appearing ? 1.0f : 0.0f); fadeAnim.setInterpolator(appearing ? new android.view.animation.AccelerateInterpolator(1.0f) : new android.view.animation.DecelerateInterpolator(1.0f)); : new android.view.animation.AccelerateInterpolator(2.5f)); fadeAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION); Animator noRecentAppsFadeAnim = null; Loading Loading @@ -110,6 +114,20 @@ import android.view.ViewRootImpl; bgAnim.setDuration(appearing ? SCRIM_DURATION : CLOSE_DURATION); builder.with(bgAnim); } } else { final Resources res = mRootView.getResources(); boolean isTablet = res.getBoolean(R.bool.config_recents_interface_for_tablets); if (!isTablet) { View recentsTransitionBackground = mRootView.findViewById(R.id.recents_transition_background); recentsTransitionBackground.setVisibility(View.VISIBLE); Drawable bgDrawable = new ColorDrawable(0xFF000000); recentsTransitionBackground.setBackground(bgDrawable); Animator bgAnim = ObjectAnimator.ofInt(bgDrawable, "alpha", 0, 255); bgAnim.setDuration(CLOSE_DURATION); bgAnim.setInterpolator(new android.view.animation.AccelerateInterpolator(1f)); builder.with(bgAnim); } } mContentAnim.addListener(this); if (mListener != null) { Loading Loading @@ -139,6 +157,10 @@ import android.view.ViewRootImpl; if (mScrimView.getBackground() != null) { mScrimView.getBackground().setAlpha(appearing ? 255 : 0); } View recentsTransitionBackground = mRootView.findViewById(R.id.recents_transition_background); recentsTransitionBackground.setVisibility(View.INVISIBLE); mRootView.requestLayout(); } public void setPanelHeight(int h) { Loading packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +65 −22 Original line number Diff line number Diff line Loading @@ -34,11 +34,13 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.view.Display; import android.view.KeyEvent; import android.view.IWindowManager; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.MotionEvent; Loading Loading @@ -86,7 +88,8 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener OnRecentsPanelVisibilityChangedListener mVisibilityChangedListener; ImageView mPlaceholderThumbnail; boolean mHideWindowAfterPlaceholderThumbnailIsHidden; View mTransitionBg; boolean mHideRecentsAfterThumbnailScaleUpStarted; private RecentTasksLoader mRecentTasksLoader; private ArrayList<TaskDescription> mRecentTaskDescriptions; Loading @@ -97,6 +100,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener private boolean mFitThumbnailToXY; private int mRecentItemLayoutId; private boolean mFirstScreenful = true; private boolean mHighEndGfx; public static interface OnRecentsPanelVisibilityChangedListener { public void onRecentsPanelVisibilityChanged(boolean visible); Loading Loading @@ -248,7 +252,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && !event.isCanceled()) { show(false, true); show(false, false); return true; } return super.onKeyUp(keyCode, event); Loading Loading @@ -305,10 +309,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener ArrayList<TaskDescription> recentTaskDescriptions, boolean firstScreenful) { sendCloseSystemWindows(mContext, BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); // For now, disable animations. We may want to re-enable in the future if (show) { animate = false; } if (show) { // Need to update list of recent apps before we set visibility so this view's // content description is updated before it gets focus for TalkBack mode Loading @@ -318,6 +318,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener // quit early boolean noApps = !mFirstScreenful && (mRecentTaskDescriptions.size() == 0); if (mRecentsNoApps != null) { mRecentsNoApps.setAlpha(1f); mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE); } else { if (noApps) { Loading @@ -339,7 +340,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener mRecentTasksDirty = true; mWaitingToShow = false; mReadyToShow = false; mRecentsNoApps.setVisibility(View.INVISIBLE); } if (animate) { if (mShowing != show) { Loading Loading @@ -488,7 +488,8 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (mRecentsScrim != null) { Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); if (!ActivityManager.isHighEndGfx(d)) { mHighEndGfx = ActivityManager.isHighEndGfx(d); if (!mHighEndGfx) { mRecentsScrim.setBackground(null); } else if (mRecentsScrim.getBackground() instanceof BitmapDrawable) { // In order to save space, we make the background texture repeat in the Y direction Loading Loading @@ -704,22 +705,57 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener setContentDescription(recentAppsAccessibilityDescription); } boolean mThumbnailScaleUpStarted; public void handleOnClick(View view) { ViewHolder holder = (ViewHolder)view.getTag(); TaskDescription ad = holder.taskDescription; final Context context = view.getContext(); final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); Bitmap bm = holder.thumbnailViewImageBitmap; boolean usingDrawingCache; if (bm.getWidth() == holder.thumbnailViewImage.getWidth() && bm.getHeight() == holder.thumbnailViewImage.getHeight()) { usingDrawingCache = false; } else { holder.thumbnailViewImage.setDrawingCacheEnabled(true); Bitmap bm = holder.thumbnailViewImage.getDrawingCache(); mPlaceholderThumbnail = (ImageView) findViewById(R.id.recents_transition_placeholder_icon); bm = holder.thumbnailViewImage.getDrawingCache(); usingDrawingCache = true; } if (mPlaceholderThumbnail == null) { mPlaceholderThumbnail = (ImageView) findViewById(R.id.recents_transition_placeholder_icon); } if (mTransitionBg == null) { mTransitionBg = (View) findViewById(R.id.recents_transition_background); IWindowManager wm = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); try { if (!wm.hasSystemNavBar()) { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mTransitionBg.getLayoutParams(); int statusBarHeight = getResources(). getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height); lp.setMargins(0, statusBarHeight, 0, 0); mTransitionBg.setLayoutParams(lp); } } catch (RemoteException e) { Log.w(TAG, "Failing checking whether status bar is visible", e); } } final ImageView placeholderThumbnail = mPlaceholderThumbnail; mHideWindowAfterPlaceholderThumbnailIsHidden = false; mHideRecentsAfterThumbnailScaleUpStarted = false; placeholderThumbnail.setVisibility(VISIBLE); if (!usingDrawingCache) { placeholderThumbnail.setImageBitmap(bm); } else { Bitmap b2 = bm.copy(bm.getConfig(), true); placeholderThumbnail.setImageBitmap(b2); } Rect r = new Rect(); holder.thumbnailViewImage.getGlobalVisibleRect(r); Loading @@ -728,13 +764,16 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener show(false, true); mThumbnailScaleUpStarted = false; ActivityOptions opts = ActivityOptions.makeDelayedThumbnailScaleUpAnimation( holder.thumbnailViewImage, bm, 0, 0, new ActivityOptions.OnAnimationStartedListener() { @Override public void onAnimationStarted() { mPlaceholderThumbnail = null; placeholderThumbnail.setVisibility(INVISIBLE); if (mHideWindowAfterPlaceholderThumbnailIsHidden) { mThumbnailScaleUpStarted = true; if (!mHighEndGfx) { mPlaceholderThumbnail.setVisibility(INVISIBLE); } if (mHideRecentsAfterThumbnailScaleUpStarted) { hideWindow(); } } Loading @@ -751,15 +790,19 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (DEBUG) Log.v(TAG, "Starting activity " + intent); context.startActivity(intent, opts.toBundle()); } if (!usingDrawingCache) { holder.thumbnailViewImage.setDrawingCacheEnabled(false); } } public void hideWindow() { if (mPlaceholderThumbnail != null) { mHideWindowAfterPlaceholderThumbnailIsHidden = true; if (!mThumbnailScaleUpStarted) { mHideRecentsAfterThumbnailScaleUpStarted = true; } else { setVisibility(GONE); mHideWindowAfterPlaceholderThumbnailIsHidden = false; mTransitionBg.setVisibility(INVISIBLE); mPlaceholderThumbnail.setVisibility(INVISIBLE); mHideRecentsAfterThumbnailScaleUpStarted = false; } } Loading Loading
packages/SystemUI/res/layout-land/status_bar_recent_panel.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,11 @@ android:layout_width="match_parent" systemui:recentItemLayout="@layout/status_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" Loading
packages/SystemUI/res/layout-port/status_bar_recent_panel.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,11 @@ android:layout_width="match_parent" systemui:recentItemLayout="@layout/status_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" Loading
packages/SystemUI/res/layout/system_bar_recent_panel.xml +5 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,11 @@ android:clipChildren="false" systemui:recentItemLayout="@layout/system_bar_recent_item" > <View android:id="@+id/recents_transition_background" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" /> <FrameLayout android:id="@+id/recents_bg_protect" android:background="@drawable/recents_bg_protect_tile" Loading @@ -38,7 +42,6 @@ android:layout_marginBottom="@*android:dimen/system_bar_height" android:clipToPadding="false" android:clipChildren="false"> <ImageView android:id="@+id/recents_transition_placeholder_icon" android:layout_width="wrap_content" Loading
packages/SystemUI/src/com/android/systemui/recent/Choreographer.java +24 −2 Original line number Diff line number Diff line Loading @@ -20,15 +20,19 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.AnimatorSet.Builder; import android.animation.ObjectAnimator; import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.util.Slog; import android.view.View; import android.view.ViewRootImpl; import com.android.systemui.R; /* package */ class Choreographer implements Animator.AnimatorListener { // should group this into a multi-property animation private static final int OPEN_DURATION = 136; private static final int CLOSE_DURATION = 130; private static final int CLOSE_DURATION = 230; private static final int SCRIM_DURATION = 400; private static final String TAG = RecentsPanelView.TAG; private static final boolean DEBUG = RecentsPanelView.DEBUG; Loading Loading @@ -81,7 +85,7 @@ import android.view.ViewRootImpl; mContentView.getAlpha(), appearing ? 1.0f : 0.0f); fadeAnim.setInterpolator(appearing ? new android.view.animation.AccelerateInterpolator(1.0f) : new android.view.animation.DecelerateInterpolator(1.0f)); : new android.view.animation.AccelerateInterpolator(2.5f)); fadeAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION); Animator noRecentAppsFadeAnim = null; Loading Loading @@ -110,6 +114,20 @@ import android.view.ViewRootImpl; bgAnim.setDuration(appearing ? SCRIM_DURATION : CLOSE_DURATION); builder.with(bgAnim); } } else { final Resources res = mRootView.getResources(); boolean isTablet = res.getBoolean(R.bool.config_recents_interface_for_tablets); if (!isTablet) { View recentsTransitionBackground = mRootView.findViewById(R.id.recents_transition_background); recentsTransitionBackground.setVisibility(View.VISIBLE); Drawable bgDrawable = new ColorDrawable(0xFF000000); recentsTransitionBackground.setBackground(bgDrawable); Animator bgAnim = ObjectAnimator.ofInt(bgDrawable, "alpha", 0, 255); bgAnim.setDuration(CLOSE_DURATION); bgAnim.setInterpolator(new android.view.animation.AccelerateInterpolator(1f)); builder.with(bgAnim); } } mContentAnim.addListener(this); if (mListener != null) { Loading Loading @@ -139,6 +157,10 @@ import android.view.ViewRootImpl; if (mScrimView.getBackground() != null) { mScrimView.getBackground().setAlpha(appearing ? 255 : 0); } View recentsTransitionBackground = mRootView.findViewById(R.id.recents_transition_background); recentsTransitionBackground.setVisibility(View.INVISIBLE); mRootView.requestLayout(); } public void setPanelHeight(int h) { Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +65 −22 Original line number Diff line number Diff line Loading @@ -34,11 +34,13 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.view.Display; import android.view.KeyEvent; import android.view.IWindowManager; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.MotionEvent; Loading Loading @@ -86,7 +88,8 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener OnRecentsPanelVisibilityChangedListener mVisibilityChangedListener; ImageView mPlaceholderThumbnail; boolean mHideWindowAfterPlaceholderThumbnailIsHidden; View mTransitionBg; boolean mHideRecentsAfterThumbnailScaleUpStarted; private RecentTasksLoader mRecentTasksLoader; private ArrayList<TaskDescription> mRecentTaskDescriptions; Loading @@ -97,6 +100,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener private boolean mFitThumbnailToXY; private int mRecentItemLayoutId; private boolean mFirstScreenful = true; private boolean mHighEndGfx; public static interface OnRecentsPanelVisibilityChangedListener { public void onRecentsPanelVisibilityChanged(boolean visible); Loading Loading @@ -248,7 +252,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && !event.isCanceled()) { show(false, true); show(false, false); return true; } return super.onKeyUp(keyCode, event); Loading Loading @@ -305,10 +309,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener ArrayList<TaskDescription> recentTaskDescriptions, boolean firstScreenful) { sendCloseSystemWindows(mContext, BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); // For now, disable animations. We may want to re-enable in the future if (show) { animate = false; } if (show) { // Need to update list of recent apps before we set visibility so this view's // content description is updated before it gets focus for TalkBack mode Loading @@ -318,6 +318,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener // quit early boolean noApps = !mFirstScreenful && (mRecentTaskDescriptions.size() == 0); if (mRecentsNoApps != null) { mRecentsNoApps.setAlpha(1f); mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE); } else { if (noApps) { Loading @@ -339,7 +340,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener mRecentTasksDirty = true; mWaitingToShow = false; mReadyToShow = false; mRecentsNoApps.setVisibility(View.INVISIBLE); } if (animate) { if (mShowing != show) { Loading Loading @@ -488,7 +488,8 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (mRecentsScrim != null) { Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); if (!ActivityManager.isHighEndGfx(d)) { mHighEndGfx = ActivityManager.isHighEndGfx(d); if (!mHighEndGfx) { mRecentsScrim.setBackground(null); } else if (mRecentsScrim.getBackground() instanceof BitmapDrawable) { // In order to save space, we make the background texture repeat in the Y direction Loading Loading @@ -704,22 +705,57 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener setContentDescription(recentAppsAccessibilityDescription); } boolean mThumbnailScaleUpStarted; public void handleOnClick(View view) { ViewHolder holder = (ViewHolder)view.getTag(); TaskDescription ad = holder.taskDescription; final Context context = view.getContext(); final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); Bitmap bm = holder.thumbnailViewImageBitmap; boolean usingDrawingCache; if (bm.getWidth() == holder.thumbnailViewImage.getWidth() && bm.getHeight() == holder.thumbnailViewImage.getHeight()) { usingDrawingCache = false; } else { holder.thumbnailViewImage.setDrawingCacheEnabled(true); Bitmap bm = holder.thumbnailViewImage.getDrawingCache(); mPlaceholderThumbnail = (ImageView) findViewById(R.id.recents_transition_placeholder_icon); bm = holder.thumbnailViewImage.getDrawingCache(); usingDrawingCache = true; } if (mPlaceholderThumbnail == null) { mPlaceholderThumbnail = (ImageView) findViewById(R.id.recents_transition_placeholder_icon); } if (mTransitionBg == null) { mTransitionBg = (View) findViewById(R.id.recents_transition_background); IWindowManager wm = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); try { if (!wm.hasSystemNavBar()) { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mTransitionBg.getLayoutParams(); int statusBarHeight = getResources(). getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height); lp.setMargins(0, statusBarHeight, 0, 0); mTransitionBg.setLayoutParams(lp); } } catch (RemoteException e) { Log.w(TAG, "Failing checking whether status bar is visible", e); } } final ImageView placeholderThumbnail = mPlaceholderThumbnail; mHideWindowAfterPlaceholderThumbnailIsHidden = false; mHideRecentsAfterThumbnailScaleUpStarted = false; placeholderThumbnail.setVisibility(VISIBLE); if (!usingDrawingCache) { placeholderThumbnail.setImageBitmap(bm); } else { Bitmap b2 = bm.copy(bm.getConfig(), true); placeholderThumbnail.setImageBitmap(b2); } Rect r = new Rect(); holder.thumbnailViewImage.getGlobalVisibleRect(r); Loading @@ -728,13 +764,16 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener show(false, true); mThumbnailScaleUpStarted = false; ActivityOptions opts = ActivityOptions.makeDelayedThumbnailScaleUpAnimation( holder.thumbnailViewImage, bm, 0, 0, new ActivityOptions.OnAnimationStartedListener() { @Override public void onAnimationStarted() { mPlaceholderThumbnail = null; placeholderThumbnail.setVisibility(INVISIBLE); if (mHideWindowAfterPlaceholderThumbnailIsHidden) { mThumbnailScaleUpStarted = true; if (!mHighEndGfx) { mPlaceholderThumbnail.setVisibility(INVISIBLE); } if (mHideRecentsAfterThumbnailScaleUpStarted) { hideWindow(); } } Loading @@ -751,15 +790,19 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (DEBUG) Log.v(TAG, "Starting activity " + intent); context.startActivity(intent, opts.toBundle()); } if (!usingDrawingCache) { holder.thumbnailViewImage.setDrawingCacheEnabled(false); } } public void hideWindow() { if (mPlaceholderThumbnail != null) { mHideWindowAfterPlaceholderThumbnailIsHidden = true; if (!mThumbnailScaleUpStarted) { mHideRecentsAfterThumbnailScaleUpStarted = true; } else { setVisibility(GONE); mHideWindowAfterPlaceholderThumbnailIsHidden = false; mTransitionBg.setVisibility(INVISIBLE); mPlaceholderThumbnail.setVisibility(INVISIBLE); mHideRecentsAfterThumbnailScaleUpStarted = false; } } Loading