diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
index 3ee9e77e23a43..180f0228b5d36 100644
--- a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
@@ -33,39 +33,29 @@
android:clipToPadding="false"
android:clipChildren="false">
-
-
+
+
+
-
-
-
-
-
-
+
diff --git a/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml
index d040544e63f09..e6a077a5e20a2 100644
--- a/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml
@@ -31,39 +31,29 @@
android:layout_height="match_parent"
android:layout_alignParentBottom="true">
-
+ android:layout_marginRight="0dp"
+ android:divider="@null"
+ android:stackFromBottom="true"
+ android:fadingEdge="vertical"
+ android:scrollbars="none"
+ android:fadingEdgeLength="@*android:dimen/status_bar_height"
+ android:layout_gravity="bottom|left"
+ android:clipToPadding="false"
+ android:clipChildren="false">
-
+
-
-
-
-
-
-
+
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_no_recent_apps.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_no_recent_apps.xml
new file mode 100644
index 0000000000000..bc89281190de0
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_no_recent_apps.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
index 18a31f7dc1365..cb26db00a54b1 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml
@@ -23,31 +23,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content">
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
+
-
-
-
+
@@ -82,4 +78,5 @@
android:contentDescription="@string/status_bar_accessibility_dismiss_recents"
/>
+
diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml
index 3e2ec59578123..24185a4f18445 100644
--- a/packages/SystemUI/res/values-sw600dp/config.xml
+++ b/packages/SystemUI/res/values-sw600dp/config.xml
@@ -18,8 +18,11 @@
-->
-
true
+
+
+ true
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index fe9245dda1fc8..f522285a18a6c 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -31,15 +31,15 @@
- 121dp
+ 28dp
64dp
64dp
- 245dp
- 144dp
+ 208dp
+ 130dp
600dp
@@ -59,8 +59,8 @@
100dip
- 13dp
- 13dp
+ 0dp
+ 8dp
24dip
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 1fe4ebbb4102a..1f225074c4113 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -25,6 +25,10 @@
value at runtime for some things) -->
false
+
+ false
+
false
diff --git a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java
index 886a14d9e756e..ad38a11a2a3cd 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java
@@ -120,8 +120,13 @@ import android.view.View;
createAnimation(appearing);
- mContentView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
- mContentView.buildLayer();
+ // isHardwareAccelerated() checks if we're attached to a window and if that
+ // window is HW accelerated-- we were sometimes not attached to a window
+ // and buildLayer was throwing an IllegalStateException
+ if (mContentView.isHardwareAccelerated()) {
+ mContentView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ mContentView.buildLayer();
+ }
mContentAnim.start();
mVisible = appearing;
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 6b8b65eab4287..8bfd7111fb5aa 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -16,14 +16,13 @@
package com.android.systemui.recent;
-import java.util.ArrayList;
-
import android.animation.Animator;
import android.animation.LayoutTransition;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Shader.TileMode;
@@ -42,15 +41,15 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
+import android.widget.ImageView.ScaleType;
import android.widget.PopupMenu;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ImageView.ScaleType;
import com.android.systemui.R;
import com.android.systemui.statusbar.StatusBar;
@@ -58,6 +57,8 @@ import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.tablet.StatusBarPanel;
import com.android.systemui.statusbar.tablet.TabletStatusBar;
+import java.util.ArrayList;
+
public class RecentsPanelView extends RelativeLayout implements OnItemClickListener, RecentsCallback,
StatusBarPanel, Animator.AnimatorListener, View.OnTouchListener {
static final String TAG = "RecentsPanelView";
@@ -65,7 +66,6 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
private Context mContext;
private StatusBar mBar;
private View mRecentsScrim;
- private View mRecentsGlowView;
private View mRecentsNoApps;
private ViewGroup mRecentsContainer;
@@ -79,6 +79,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
private boolean mRecentTasksDirty = true;
private TaskDescriptionAdapter mListAdapter;
private int mThumbnailWidth;
+ private boolean mFitThumbnailToXY;
public void setRecentTasksLoader(RecentTasksLoader loader) {
mRecentTasksLoader = loader;
@@ -174,9 +175,8 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
// use mRecentsContainer's exact bounds to determine horizontal position
final int l = mRecentsContainer.getLeft();
final int r = mRecentsContainer.getRight();
- // use surrounding mRecentsGlowView's position in parent determine vertical bounds
- final int t = mRecentsGlowView.getTop();
- final int b = mRecentsGlowView.getBottom();
+ final int t = mRecentsContainer.getTop();
+ final int b = mRecentsContainer.getBottom();
return x >= l && x < r && y >= t && y < b;
}
@@ -194,7 +194,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
// if there are no apps, either bring up a "No recent apps" message, or just
// quit early
boolean noApps = (mRecentTaskDescriptions.size() == 0);
- if (mRecentsNoApps != null) { // doesn't exist on large devices
+ if (mRecentsNoApps != null) {
mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
} else {
if (noApps) {
@@ -325,8 +325,9 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
}
public void updateValuesFromResources() {
- mThumbnailWidth =
- (int) mContext.getResources().getDimension(R.dimen.status_bar_recents_thumbnail_width);
+ final Resources res = mContext.getResources();
+ mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width));
+ mFitThumbnailToXY = res.getBoolean(R.bool.config_recents_thumbnail_image_fits_to_xy);
}
@Override
@@ -351,10 +352,9 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
}
- mRecentsGlowView = findViewById(R.id.recents_glow);
mRecentsScrim = findViewById(R.id.recents_bg_protect);
mRecentsNoApps = findViewById(R.id.recents_no_apps);
- mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView, mRecentsNoApps, this);
+ mChoreo = new Choreographer(this, mRecentsScrim, mRecentsContainer, mRecentsNoApps, this);
mRecentsDismissButton = findViewById(R.id.recents_dismiss_button);
if (mRecentsDismissButton != null) {
mRecentsDismissButton.setOnClickListener(new OnClickListener() {
@@ -409,11 +409,15 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
if (h.thumbnailViewImageBitmap == null ||
h.thumbnailViewImageBitmap.getWidth() != thumbnail.getWidth() ||
h.thumbnailViewImageBitmap.getHeight() != thumbnail.getHeight()) {
- Matrix scaleMatrix = new Matrix();
- float scale = mThumbnailWidth / (float) thumbnail.getWidth();
- scaleMatrix.setScale(scale, scale);
- h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
- h.thumbnailViewImage.setImageMatrix(scaleMatrix);
+ if (mFitThumbnailToXY) {
+ h.thumbnailViewImage.setScaleType(ScaleType.FIT_XY);
+ } else {
+ Matrix scaleMatrix = new Matrix();
+ float scale = mThumbnailWidth / (float) thumbnail.getWidth();
+ scaleMatrix.setScale(scale, scale);
+ h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
+ h.thumbnailViewImage.setImageMatrix(scaleMatrix);
+ }
}
if (show && h.thumbnailView.getVisibility() != View.VISIBLE) {
if (anim) {
@@ -444,7 +448,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
// only fade in the thumbnail if recents is already visible-- we
// show it immediately otherwise
boolean animateShow = mShowing &&
- mRecentsGlowView.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD;
+ mRecentsContainer.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD;
updateThumbnail(h, ad.getThumbnail(), true, animateShow);
}
}
@@ -516,7 +520,6 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
final int items = mRecentTaskDescriptions.size();
mRecentsContainer.setVisibility(items > 0 ? View.VISIBLE : View.GONE);
- mRecentsGlowView.setVisibility(items > 0 ? View.VISIBLE : View.GONE);
// Set description for accessibility
int numRecentApps = mRecentTaskDescriptions.size();
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 50321b3270f64..ebb13d5c8f614 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -5090,10 +5090,22 @@ public class WindowManagerService extends IWindowManager.Stub
// Constrain thumbnail to smaller of screen width or height. Assumes aspect
// of thumbnail is the same as the screen (in landscape) or square.
+ float targetWidthScale = width / (float) fw;
+ float targetHeightScale = height / (float) fh;
if (dw <= dh) {
- scale = width / (float) fw; // portrait
+ scale = targetWidthScale;
+ // If aspect of thumbnail is the same as the screen (in landscape),
+ // select the slightly larger value so we fill the entire bitmap
+ if (targetHeightScale > scale && (int) (targetHeightScale * fw) == width) {
+ scale = targetHeightScale;
+ }
} else {
- scale = height / (float) fh; // landscape
+ scale = targetHeightScale;
+ // If aspect of thumbnail is the same as the screen (in landscape),
+ // select the slightly larger value so we fill the entire bitmap
+ if (targetWidthScale > scale && (int) (targetWidthScale * fh) == height) {
+ scale = targetWidthScale;
+ }
}
// The screen shot will contain the entire screen.