Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks private ArrayList<Animator> mTmpAnimators = new ArrayList<>(); @ViewDebug.ExportedProperty(deepExport=true, prefix="thumbnail_") TaskViewThumbnail mThumbnailView; protected TaskViewThumbnail mThumbnailView; @ViewDebug.ExportedProperty(deepExport=true, prefix="header_") TaskViewHeader mHeaderView; private View mActionButtonView; Loading Loading @@ -239,7 +239,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks /** * Update the task view when the configuration changes. */ void onConfigurationChanged() { protected void onConfigurationChanged() { mHeaderView.onConfigurationChanged(); } Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java +20 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public class TaskViewThumbnail extends View { @ViewDebug.ExportedProperty(category="recents") private float mThumbnailScale; private float mFullscreenThumbnailScale; private boolean mSizeToFit = false; private boolean mOverlayHeaderOnThumbnailActionBar = true; private ActivityManager.TaskThumbnailInfo mThumbnailInfo; private int mCornerRadius; Loading Loading @@ -140,9 +142,10 @@ public class TaskViewThumbnail extends View { canvas.drawRoundRect(0, 0, viewWidth, viewHeight, mCornerRadius, mCornerRadius, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { int topOffset = mTaskBar != null ? mTaskBar.getHeight() - mCornerRadius : 0; int topOffset = 0; if (mTaskBar != null && mOverlayHeaderOnThumbnailActionBar) { topOffset = mTaskBar.getHeight() - mCornerRadius; } // Draw the background, there will be some small overdraw with the thumbnail if (thumbnailWidth < viewWidth) { Loading Loading @@ -238,7 +241,7 @@ public class TaskViewThumbnail extends View { // If we haven't measured or the thumbnail is invalid, skip the thumbnail drawing // and only draw the background color mThumbnailScale = 0f; } else if (isStackTask) { } else if (isStackTask && !mSizeToFit) { float invThumbnailScale = 1f / mFullscreenThumbnailScale; if (mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT) { if (mThumbnailInfo.screenOrientation == Configuration.ORIENTATION_PORTRAIT) { Loading Loading @@ -270,6 +273,19 @@ public class TaskViewThumbnail extends View { } } /** Sets whether the thumbnail should be resized to fit the task view in all orientations. */ public void setSizeToFit(boolean flag) { mSizeToFit = flag; } /** * Sets whether the header should overlap (and hide) the action bar in the thumbnail, or * be stacked just above it. */ public void setOverlayHeaderOnThumbnailActionBar(boolean flag) { mOverlayHeaderOnThumbnailActionBar = flag; } /** Updates the clip rect based on the given task bar. */ void updateClipToTaskBar(View taskBar) { mTaskBar = taskBar; Loading packages/SystemUI/src/com/android/systemui/recents/views/grid/GridTaskView.java +24 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ import com.android.systemui.recents.views.AnimateableViewBounds; import com.android.systemui.recents.views.TaskView; public class GridTaskView extends TaskView { /** The height, in pixels, of the header view. */ private int mHeaderHeight; public GridTaskView(Context context) { this(context, null); } Loading @@ -37,6 +41,18 @@ public class GridTaskView extends TaskView { public GridTaskView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); mHeaderHeight = context.getResources().getDimensionPixelSize( R.dimen.recents_task_view_header_height); } @Override protected void onFinishInflate() { super.onFinishInflate(); // Show the full thumbnail and don't overlap with the header. mThumbnailView.setSizeToFit(true); mThumbnailView.setOverlayHeaderOnThumbnailActionBar(false); mThumbnailView.updateThumbnailScale(); mThumbnailView.setTranslationY(mHeaderHeight); } @Override Loading @@ -44,4 +60,12 @@ public class GridTaskView extends TaskView { return new AnimateableGridViewBounds(this, mContext.getResources().getDimensionPixelSize( R.dimen.recents_task_view_shadow_rounded_corners_radius)); } @Override protected void onConfigurationChanged() { super.onConfigurationChanged(); mHeaderHeight = mContext.getResources().getDimensionPixelSize( R.dimen.recents_task_view_header_height); mThumbnailView.setTranslationY(mHeaderHeight); } } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks private ArrayList<Animator> mTmpAnimators = new ArrayList<>(); @ViewDebug.ExportedProperty(deepExport=true, prefix="thumbnail_") TaskViewThumbnail mThumbnailView; protected TaskViewThumbnail mThumbnailView; @ViewDebug.ExportedProperty(deepExport=true, prefix="header_") TaskViewHeader mHeaderView; private View mActionButtonView; Loading Loading @@ -239,7 +239,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks /** * Update the task view when the configuration changes. */ void onConfigurationChanged() { protected void onConfigurationChanged() { mHeaderView.onConfigurationChanged(); } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java +20 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public class TaskViewThumbnail extends View { @ViewDebug.ExportedProperty(category="recents") private float mThumbnailScale; private float mFullscreenThumbnailScale; private boolean mSizeToFit = false; private boolean mOverlayHeaderOnThumbnailActionBar = true; private ActivityManager.TaskThumbnailInfo mThumbnailInfo; private int mCornerRadius; Loading Loading @@ -140,9 +142,10 @@ public class TaskViewThumbnail extends View { canvas.drawRoundRect(0, 0, viewWidth, viewHeight, mCornerRadius, mCornerRadius, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { int topOffset = mTaskBar != null ? mTaskBar.getHeight() - mCornerRadius : 0; int topOffset = 0; if (mTaskBar != null && mOverlayHeaderOnThumbnailActionBar) { topOffset = mTaskBar.getHeight() - mCornerRadius; } // Draw the background, there will be some small overdraw with the thumbnail if (thumbnailWidth < viewWidth) { Loading Loading @@ -238,7 +241,7 @@ public class TaskViewThumbnail extends View { // If we haven't measured or the thumbnail is invalid, skip the thumbnail drawing // and only draw the background color mThumbnailScale = 0f; } else if (isStackTask) { } else if (isStackTask && !mSizeToFit) { float invThumbnailScale = 1f / mFullscreenThumbnailScale; if (mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT) { if (mThumbnailInfo.screenOrientation == Configuration.ORIENTATION_PORTRAIT) { Loading Loading @@ -270,6 +273,19 @@ public class TaskViewThumbnail extends View { } } /** Sets whether the thumbnail should be resized to fit the task view in all orientations. */ public void setSizeToFit(boolean flag) { mSizeToFit = flag; } /** * Sets whether the header should overlap (and hide) the action bar in the thumbnail, or * be stacked just above it. */ public void setOverlayHeaderOnThumbnailActionBar(boolean flag) { mOverlayHeaderOnThumbnailActionBar = flag; } /** Updates the clip rect based on the given task bar. */ void updateClipToTaskBar(View taskBar) { mTaskBar = taskBar; Loading
packages/SystemUI/src/com/android/systemui/recents/views/grid/GridTaskView.java +24 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ import com.android.systemui.recents.views.AnimateableViewBounds; import com.android.systemui.recents.views.TaskView; public class GridTaskView extends TaskView { /** The height, in pixels, of the header view. */ private int mHeaderHeight; public GridTaskView(Context context) { this(context, null); } Loading @@ -37,6 +41,18 @@ public class GridTaskView extends TaskView { public GridTaskView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); mHeaderHeight = context.getResources().getDimensionPixelSize( R.dimen.recents_task_view_header_height); } @Override protected void onFinishInflate() { super.onFinishInflate(); // Show the full thumbnail and don't overlap with the header. mThumbnailView.setSizeToFit(true); mThumbnailView.setOverlayHeaderOnThumbnailActionBar(false); mThumbnailView.updateThumbnailScale(); mThumbnailView.setTranslationY(mHeaderHeight); } @Override Loading @@ -44,4 +60,12 @@ public class GridTaskView extends TaskView { return new AnimateableGridViewBounds(this, mContext.getResources().getDimensionPixelSize( R.dimen.recents_task_view_shadow_rounded_corners_radius)); } @Override protected void onConfigurationChanged() { super.onConfigurationChanged(); mHeaderHeight = mContext.getResources().getDimensionPixelSize( R.dimen.recents_task_view_header_height); mThumbnailView.setTranslationY(mHeaderHeight); } }