updating visuals of Recent Apps

- replacing background PNGs with 9 patches
- removing border around thumbnails by default
- when swiping thumbnails, draw a border around them
- fix callout line length
- make recents window smaller on tablets
- deleting unused assets

Change-Id: If5bb1ba0d55a6d10e36ee14274c23596f0ba73b9
This commit is contained in:
Peter Ng
2011-08-29 10:56:53 -07:00
committed by Michael Jurka
parent 185a251b08
commit 622a97646d
69 changed files with 63 additions and 93 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -15,5 +15,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/recents_thumbnail_bg_press" android:state_pressed="true" />
<item android:drawable="@drawable/recents_thumbnail_bg" android:state_activated="true" />
<item android:drawable="@*android:color/transparent"/>
</selector>

View File

@@ -38,8 +38,7 @@
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
android:scaleType="center"
android:clickable="true"
android:background="@drawable/recents_thumbnail_bg"
android:foreground="@drawable/recents_thumbnail_overlay">
android:background="@drawable/recents_thumbnail_overlay">
<ImageView android:id="@+id/app_thumbnail_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -54,8 +53,8 @@
android:layout_alignTop="@id/app_thumbnail"
android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
android:maxWidth="@dimen/status_bar_recents_thumbnail_max_width"
android:maxHeight="@dimen/status_bar_recents_thumbnail_max_height"
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
android:adjustViewBounds="true"
android:visibility="invisible"
/>
@@ -70,7 +69,6 @@
android:layout_alignLeft="@id/app_thumbnail"
android:layout_below="@id/app_thumbnail"
android:layout_marginTop="@dimen/status_bar_recents_text_description_padding"
android:layout_marginLeft="@dimen/recents_thumbnail_bg_padding_left"
android:singleLine="true"
android:ellipsize="marquee"
android:visibility="invisible"
@@ -86,7 +84,6 @@
android:layout_alignLeft="@id/app_thumbnail"
android:layout_below="@id/app_label"
android:layout_marginTop="@dimen/status_bar_recents_text_description_padding"
android:layout_marginLeft="@dimen/recents_thumbnail_bg_padding_left"
android:singleLine="true"
android:ellipsize="marquee"
/>

View File

@@ -36,8 +36,7 @@
android:clickable="true"
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
android:scaleType="center"
android:background="@drawable/recents_thumbnail_bg"
android:foreground="@drawable/recents_thumbnail_overlay">
android:background="@drawable/recents_thumbnail_overlay">
<ImageView android:id="@+id/app_thumbnail_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -52,8 +51,8 @@
android:layout_alignTop="@id/app_thumbnail"
android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
android:maxWidth="@dimen/status_bar_recents_thumbnail_max_width"
android:maxHeight="@dimen/status_bar_recents_thumbnail_max_height"
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
android:adjustViewBounds="true"
/>

View File

@@ -29,11 +29,10 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:clickable="true"
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
android:scaleType="center"
android:clickable="true"
android:background="@drawable/recents_thumbnail_bg"
android:foreground="@drawable/recents_thumbnail_overlay">
android:background="@drawable/recents_thumbnail_overlay">
<ImageView android:id="@+id/app_thumbnail_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -48,8 +47,8 @@
android:layout_alignTop="@id/app_thumbnail"
android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
android:maxWidth="@dimen/status_bar_recents_thumbnail_max_width"
android:maxHeight="@dimen/status_bar_recents_thumbnail_max_height"
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
android:adjustViewBounds="true"
/>

View File

@@ -47,7 +47,7 @@
android:clipChildren="false"
>
<com.android.systemui.recent.RecentsVerticalScrollView android:id="@+id/recents_container"
android:layout_width="@dimen/status_bar_recents_width"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
android:divider="@null"

View File

@@ -16,12 +16,6 @@
*/
-->
<resources>
<!-- Offsets for rendering thumbnails over drawable recents_thumbnail_bg -->
<dimen name="recents_thumbnail_bg_padding_left">6px</dimen>
<dimen name="recents_thumbnail_bg_padding_top">7px</dimen>
<dimen name="recents_thumbnail_bg_padding_right">6px</dimen>
<dimen name="recents_thumbnail_bg_padding_bottom">6px</dimen>
<!-- thickness (height) of each notification row, including any separators or padding -->
<!-- Note: this is 64dip + 1px divider = 97px. -->
<dimen name="notification_height">97px</dimen>

View File

@@ -24,8 +24,6 @@
<dimen name="status_bar_recents_thumbnail_left_margin">8dp</dimen>
<!-- How far the thumbnail for a recent app appears from top edge -->
<dimen name="status_bar_recents_thumbnail_top_margin">12dp</dimen>
<!-- Width of scrollable area in recents -->
<dimen name="status_bar_recents_width">128dp</dimen>
<!-- Padding for text descriptions -->
<dimen name="status_bar_recents_text_description_padding">8dp</dimen>
<!-- Width of application label text -->

View File

@@ -1,24 +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.
*/
-->
<resources>
<!-- Offsets for rendering thumbnails over drawable recents_thumbnail_bg -->
<dimen name="recents_thumbnail_bg_padding_left">6px</dimen>
<dimen name="recents_thumbnail_bg_padding_top">7px</dimen>
<dimen name="recents_thumbnail_bg_padding_right">6px</dimen>
<dimen name="recents_thumbnail_bg_padding_bottom">6px</dimen>
</resources>

View File

@@ -19,14 +19,12 @@
<!-- Recent Applications parameters -->
<!-- How far the thumbnail for a recent app appears from left edge -->
<dimen name="status_bar_recents_thumbnail_left_margin">110dp</dimen>
<!-- Width of scrollable area in recents -->
<dimen name="status_bar_recents_width">356dp</dimen>
<!-- Padding for text descriptions -->
<dimen name="status_bar_recents_text_description_padding">8dp</dimen>
<!-- Width of application label text -->
<dimen name="status_bar_recents_app_label_width">97dip</dimen>
<!-- Left margin of application label text -->
<dimen name="status_bar_recents_app_label_left_margin">16dip</dimen>
<dimen name="status_bar_recents_app_label_left_margin">8dip</dimen>
<!-- Margin between recents container and glow on the right -->
<dimen name="status_bar_recents_right_glow_margin">100dip</dimen>
</resources>

View File

@@ -30,16 +30,19 @@
<dimen name="panel_float">56dp</dimen>
<!-- Recent Applications parameters -->
<!-- Width of a recent app view, including all content -->
<dimen name="status_bar_recents_thumbnail_view_width">156dp</dimen>
<!-- How far the thumbnail for a recent app appears from left edge -->
<dimen name="status_bar_recents_thumbnail_left_margin">110dp</dimen>
<dimen name="status_bar_recents_thumbnail_left_margin">121dp</dimen>
<!-- Upper width limit for application icon -->
<dimen name="status_bar_recents_thumbnail_max_width">64dp</dimen>
<dimen name="status_bar_recents_app_icon_max_width">64dp</dimen>
<!-- Upper height limit for application icon -->
<dimen name="status_bar_recents_thumbnail_max_height">64dp</dimen>
<!-- Width of scrollable area in recents -->
<dimen name="status_bar_recents_width">356dp</dimen>
<dimen name="status_bar_recents_app_icon_max_height">64dp</dimen>
<!-- Size of application icon -->
<dimen name="status_bar_recents_thumbnail_width">245dp</dimen>
<dimen name="status_bar_recents_thumbnail_height">144dp</dimen>
<!-- Width of recents panel -->
<dimen name="status_bar_recents_width">600dp</dimen>
<!-- Padding for text descriptions -->
<dimen name="status_bar_recents_text_description_padding">8dp</dimen>
<!-- Size of application label text -->
@@ -55,12 +58,6 @@
<!-- Margin between recents container and glow on the right -->
<dimen name="status_bar_recents_right_glow_margin">100dip</dimen>
<!-- Offsets for rendering thumbnails over drawable recents_thumbnail_bg -->
<dimen name="recents_thumbnail_bg_padding_left">15px</dimen>
<dimen name="recents_thumbnail_bg_padding_top">8px</dimen>
<dimen name="recents_thumbnail_bg_padding_right">12px</dimen>
<dimen name="recents_thumbnail_bg_padding_bottom">8px</dimen>
<!-- Where to place the app icon over the thumbnail -->
<dimen name="status_bar_recents_app_icon_left_margin">13dp</dimen>
<dimen name="status_bar_recents_app_icon_top_margin">13dp</dimen>

View File

@@ -22,5 +22,6 @@
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
<drawable name="status_bar_background">#ff000000</drawable>
<drawable name="status_bar_recents_background">#b3000000</drawable>
<drawable name="status_bar_recents_app_thumbnail_background">#88000000</drawable>
<drawable name="status_bar_notification_row_background_color">#ff000000</drawable>
</resources>

View File

@@ -21,17 +21,21 @@
<!-- Recent Applications parameters -->
<!-- Upper width limit for application icon -->
<dimen name="status_bar_recents_thumbnail_max_width">64dp</dimen>
<dimen name="status_bar_recents_app_icon_max_width">64dp</dimen>
<!-- Upper height limit for application icon -->
<dimen name="status_bar_recents_thumbnail_max_height">64dp</dimen>
<dimen name="status_bar_recents_app_icon_max_height">64dp</dimen>
<!-- Where to place the app icon over the thumbnail -->
<dimen name="status_bar_recents_app_icon_left_margin">13dp</dimen>
<dimen name="status_bar_recents_app_icon_top_margin">13dp</dimen>
<!-- Size of application thumbnail -->
<dimen name="status_bar_recents_thumbnail_width">164dp</dimen>
<dimen name="status_bar_recents_thumbnail_height">164dp</dimen>
<!-- Size of application label text -->
<dimen name="status_bar_recents_app_label_text_size">18dip</dimen>
<dimen name="status_bar_recents_app_label_text_size">16dip</dimen>
<!-- Size of application description text -->
<dimen name="status_bar_recents_app_description_text_size">18dip</dimen>
<dimen name="status_bar_recents_app_description_text_size">16dip</dimen>
<!-- Size of fading edge for scroll effect -->
<dimen name="status_bar_recents_fading_edge_length">20dip</dimen>
<!-- Margin between recents container and glow on the right -->

View File

@@ -307,6 +307,7 @@ public class SwipeHelper {
dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f);
} else {
// snappity
mCallback.onDragCancelled(mCurrView);
snapChild(mCurrView, velocity);
}
}
@@ -325,5 +326,7 @@ public class SwipeHelper {
void onBeginDrag(View v);
void onChildDismissed(View v);
void onDragCancelled(View v);
}
}

View File

@@ -127,6 +127,11 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
requestDisallowInterceptTouchEvent(true);
v.setActivated(true);
}
public void onDragCancelled(View v) {
v.setActivated(false);
}
public View getChildAtPosition(MotionEvent ev) {

View File

@@ -84,12 +84,8 @@ public class RecentsPanelView extends RelativeLayout
private View mRecentsScrim;
private View mRecentsGlowView;
private ViewGroup mRecentsContainer;
private Bitmap mGlowBitmap;
// TODO: add these widgets attributes to the layout file
private int mGlowBitmapPaddingLeftPx;
private int mGlowBitmapPaddingTopPx;
private int mGlowBitmapPaddingRightPx;
private int mGlowBitmapPaddingBottomPx;
private Bitmap mAppThumbnailBackground;
private boolean mShowing;
private Choreographer mChoreo;
private View mRecentsDismissButton;
@@ -129,7 +125,7 @@ public class RecentsPanelView extends RelativeLayout
}
public void setThumbnail(Bitmap thumbnail) {
mThumbnail = compositeBitmap(mGlowBitmap, thumbnail);
mThumbnail = compositeBitmap(mAppThumbnailBackground, thumbnail);
}
public Bitmap getThumbnail() {
@@ -327,15 +323,12 @@ public class RecentsPanelView extends RelativeLayout
mIconDpi = xlarge ? DisplayMetrics.DENSITY_HIGH : res.getDisplayMetrics().densityDpi;
mGlowBitmap = BitmapFactory.decodeResource(res, R.drawable.recents_thumbnail_bg);
mGlowBitmapPaddingLeftPx =
res.getDimensionPixelSize(R.dimen.recents_thumbnail_bg_padding_left);
mGlowBitmapPaddingTopPx =
res.getDimensionPixelSize(R.dimen.recents_thumbnail_bg_padding_top);
mGlowBitmapPaddingRightPx =
res.getDimensionPixelSize(R.dimen.recents_thumbnail_bg_padding_right);
mGlowBitmapPaddingBottomPx =
res.getDimensionPixelSize(R.dimen.recents_thumbnail_bg_padding_bottom);
int width = (int) res.getDimension(R.dimen.status_bar_recents_thumbnail_width);
int height = (int) res.getDimension(R.dimen.status_bar_recents_thumbnail_height);
int color = res.getColor(R.drawable.status_bar_recents_app_thumbnail_background);
mAppThumbnailBackground = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(mAppThumbnailBackground);
c.drawColor(color);
}
@Override
@@ -570,6 +563,9 @@ public class RecentsPanelView extends RelativeLayout
mThumbnailLoader = null;
}
mActivityDescriptions = getRecentTasks();
for (ActivityDescription ad : mActivityDescriptions) {
ad.setThumbnail(mAppThumbnailBackground);
}
mListAdapter.notifyDataSetInvalidated();
if (mActivityDescriptions.size() > 0) {
if (DEBUG) Log.v(TAG, "Showing " + mActivityDescriptions.size() + " apps");
@@ -644,14 +640,8 @@ public class RecentsPanelView extends RelativeLayout
paint.setAntiAlias(true);
paint.setFilterBitmap(true);
paint.setAlpha(255);
final int srcWidth = thumbnail.getWidth();
final int srcHeight = thumbnail.getHeight();
if (DEBUG) Log.v(TAG, "Source thumb: " + srcWidth + "x" + srcHeight);
canvas.drawBitmap(thumbnail,
new Rect(0, 0, srcWidth-1, srcHeight-1),
new RectF(mGlowBitmapPaddingLeftPx, mGlowBitmapPaddingTopPx,
outBitmap.getWidth() - mGlowBitmapPaddingRightPx,
outBitmap.getHeight() - mGlowBitmapPaddingBottomPx), paint);
canvas.drawBitmap(thumbnail, null,
new RectF(0, 0, outBitmap.getWidth(), outBitmap.getHeight()), paint);
canvas.setBitmap(null);
}
return outBitmap;

View File

@@ -142,6 +142,11 @@ public class RecentsVerticalScrollView extends ScrollView implements SwipeHelper
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
requestDisallowInterceptTouchEvent(true);
v.setActivated(true);
}
public void onDragCancelled(View v) {
v.setActivated(false);
}
public View getChildAtPosition(MotionEvent ev) {

View File

@@ -124,6 +124,9 @@ public class NotificationRowLayout extends ViewGroup implements SwipeHelper.Call
requestDisallowInterceptTouchEvent(true);
}
public void onDragCancelled(View v) {
}
public View getChildAtPosition(MotionEvent ev) {
// find the view under the pointer, accounting for GONE views
final int count = getChildCount();

View File

@@ -306,7 +306,7 @@ public class TabletStatusBar extends StatusBar implements
mStatusBarView.setIgnoreChildren(2, mRecentButton, mRecentsPanel);
lp = new WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
(int) res.getDimension(R.dimen.status_bar_recents_width),
ViewGroup.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN