am 4b7494e0
: Merge "Updating recent apps visuals on tablet" into ics-mr1
* commit '4b7494e07a44c0aa363379be463de70455a895f3': Updating recent apps visuals on tablet
This commit is contained in:
@ -33,39 +33,29 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_glow"
|
<com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
|
||||||
|
android:divider="@null"
|
||||||
|
android:stackFromBottom="true"
|
||||||
|
android:fadingEdge="horizontal"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false">
|
||||||
>
|
|
||||||
<com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
|
<LinearLayout android:id="@+id/recents_linear_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
|
|
||||||
android:divider="@null"
|
|
||||||
android:stackFromBottom="true"
|
|
||||||
android:fadingEdge="horizontal"
|
|
||||||
android:scrollbars="none"
|
|
||||||
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
|
|
||||||
android:layout_gravity="bottom|left"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_linear_layout"
|
</com.android.systemui.recent.RecentsHorizontalScrollView>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:clipChildren="false">
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.android.systemui.recent.RecentsHorizontalScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -31,39 +31,29 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentBottom="true">
|
android:layout_alignParentBottom="true">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_glow"
|
<com.android.systemui.recent.RecentsVerticalScrollView
|
||||||
|
android:id="@+id/recents_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_marginRight="0dp"
|
||||||
android:orientation="horizontal"
|
android:divider="@null"
|
||||||
android:clipChildren="false"
|
android:stackFromBottom="true"
|
||||||
android:layout_marginTop="@*android:dimen/status_bar_height">
|
android:fadingEdge="vertical"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:fadingEdgeLength="@*android:dimen/status_bar_height"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:clipChildren="false">
|
||||||
|
|
||||||
<com.android.systemui.recent.RecentsVerticalScrollView
|
<LinearLayout android:id="@+id/recents_linear_layout"
|
||||||
android:id="@+id/recents_container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="0dp"
|
android:orientation="vertical"
|
||||||
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:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_linear_layout"
|
</com.android.systemui.recent.RecentsVerticalScrollView>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:clipChildren="false">
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.android.systemui.recent.RecentsVerticalScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/* apps/common/assets/default/default/skins/StatusBar.xml
|
||||||
|
**
|
||||||
|
** Copyright 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="20dp"
|
||||||
|
android:textColor="@android:color/holo_blue_light"
|
||||||
|
android:text="@string/status_bar_no_recent_apps"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
|
/>
|
||||||
|
</FrameLayout>
|
@ -23,31 +23,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content">
|
android:layout_width="wrap_content">
|
||||||
|
|
||||||
<FrameLayout android:id="@+id/app_thumbnail"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentTop="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_fg"
|
|
||||||
android:visibility="invisible">
|
|
||||||
<ImageView android:id="@+id/app_thumbnail_image"
|
|
||||||
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
|
||||||
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
|
||||||
/>
|
|
||||||
<ImageView android:id="@+id/app_icon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
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_app_icon_max_width"
|
|
||||||
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
/>
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/app_label"
|
<TextView android:id="@+id/app_label"
|
||||||
android:layout_width="@dimen/status_bar_recents_app_label_width"
|
android:layout_width="@dimen/status_bar_recents_app_label_width"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -64,6 +39,35 @@
|
|||||||
android:textColor="@color/status_bar_recents_app_label_color"
|
android:textColor="@color/status_bar_recents_app_label_color"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FrameLayout android:id="@+id/app_thumbnail"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@id/app_label"
|
||||||
|
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:background="@drawable/recents_thumbnail_bg"
|
||||||
|
android:foreground="@drawable/recents_thumbnail_fg"
|
||||||
|
android:visibility="invisible">
|
||||||
|
<ImageView android:id="@+id/app_thumbnail_image"
|
||||||
|
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
||||||
|
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
||||||
|
/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView android:id="@+id/app_icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@id/app_label"
|
||||||
|
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_app_icon_max_width"
|
||||||
|
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<View android:id="@+id/recents_callout_line"
|
<View android:id="@+id/recents_callout_line"
|
||||||
android:layout_width="@dimen/status_bar_recents_app_label_width"
|
android:layout_width="@dimen/status_bar_recents_app_label_width"
|
||||||
android:layout_height="1dip"
|
android:layout_height="1dip"
|
||||||
|
@ -36,40 +36,36 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_glow"
|
<com.android.systemui.recent.RecentsVerticalScrollView android:id="@+id/recents_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="-49dip"
|
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
|
||||||
android:layout_gravity="bottom"
|
android:divider="@null"
|
||||||
android:background="@drawable/recents_blue_glow"
|
android:stackFromBottom="true"
|
||||||
android:orientation="horizontal"
|
android:fadingEdge="vertical"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:fadingEdgeLength="20dip"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false">
|
||||||
>
|
|
||||||
<com.android.systemui.recent.RecentsVerticalScrollView android:id="@+id/recents_container"
|
<LinearLayout android:id="@+id/recents_linear_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
|
android:orientation="vertical"
|
||||||
android:divider="@null"
|
|
||||||
android:stackFromBottom="true"
|
|
||||||
android:fadingEdge="vertical"
|
|
||||||
android:scrollbars="none"
|
|
||||||
android:fadingEdgeLength="20dip"
|
|
||||||
android:layout_gravity="bottom|left"
|
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_linear_layout"
|
</com.android.systemui.recent.RecentsVerticalScrollView>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:clipChildren="false">
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.android.systemui.recent.RecentsVerticalScrollView>
|
<include layout="@layout/status_bar_no_recent_apps"
|
||||||
|
android:id="@+id/recents_no_apps"
|
||||||
</LinearLayout>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="58dip"
|
||||||
|
android:layout_marginBottom="36dip"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@ -82,4 +78,5 @@
|
|||||||
android:contentDescription="@string/status_bar_accessibility_dismiss_recents"
|
android:contentDescription="@string/status_bar_accessibility_dismiss_recents"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</com.android.systemui.recent.RecentsPanelView>
|
</com.android.systemui.recent.RecentsPanelView>
|
||||||
|
@ -18,8 +18,11 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Whether we're using the tablet-optimized recents interface (we use this
|
<!-- Whether we're using the tablet-optimized recents interface (we use this
|
||||||
value at runtime for some things) -->
|
value at runtime for some things) -->
|
||||||
<bool name="config_recents_interface_for_tablets">true</bool>
|
<bool name="config_recents_interface_for_tablets">true</bool>
|
||||||
|
|
||||||
|
<!-- Whether recents thumbnails should stretch in both x and y to fill their
|
||||||
|
ImageView -->
|
||||||
|
<bool name="config_recents_thumbnail_image_fits_to_xy">true</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -31,15 +31,15 @@
|
|||||||
|
|
||||||
<!-- Recent Applications parameters -->
|
<!-- Recent Applications parameters -->
|
||||||
<!-- How far the thumbnail for a recent app appears from left edge -->
|
<!-- How far the thumbnail for a recent app appears from left edge -->
|
||||||
<dimen name="status_bar_recents_thumbnail_left_margin">121dp</dimen>
|
<dimen name="status_bar_recents_thumbnail_left_margin">28dp</dimen>
|
||||||
<!-- Upper width limit for application icon -->
|
<!-- Upper width limit for application icon -->
|
||||||
<dimen name="status_bar_recents_app_icon_max_width">64dp</dimen>
|
<dimen name="status_bar_recents_app_icon_max_width">64dp</dimen>
|
||||||
<!-- Upper height limit for application icon -->
|
<!-- Upper height limit for application icon -->
|
||||||
<dimen name="status_bar_recents_app_icon_max_height">64dp</dimen>
|
<dimen name="status_bar_recents_app_icon_max_height">64dp</dimen>
|
||||||
|
|
||||||
<!-- Size of application icon -->
|
<!-- Size of application icon -->
|
||||||
<dimen name="status_bar_recents_thumbnail_width">245dp</dimen>
|
<dimen name="status_bar_recents_thumbnail_width">208dp</dimen>
|
||||||
<dimen name="status_bar_recents_thumbnail_height">144dp</dimen>
|
<dimen name="status_bar_recents_thumbnail_height">130dp</dimen>
|
||||||
|
|
||||||
<!-- Width of recents panel -->
|
<!-- Width of recents panel -->
|
||||||
<dimen name="status_bar_recents_width">600dp</dimen>
|
<dimen name="status_bar_recents_width">600dp</dimen>
|
||||||
@ -59,8 +59,8 @@
|
|||||||
<dimen name="status_bar_recents_right_glow_margin">100dip</dimen>
|
<dimen name="status_bar_recents_right_glow_margin">100dip</dimen>
|
||||||
|
|
||||||
<!-- Where to place the app icon over the thumbnail -->
|
<!-- 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_left_margin">0dp</dimen>
|
||||||
<dimen name="status_bar_recents_app_icon_top_margin">13dp</dimen>
|
<dimen name="status_bar_recents_app_icon_top_margin">8dp</dimen>
|
||||||
|
|
||||||
<!-- size at which Notification icons will be drawn in the status bar -->
|
<!-- size at which Notification icons will be drawn in the status bar -->
|
||||||
<dimen name="status_bar_icon_drawing_size">24dip</dimen>
|
<dimen name="status_bar_icon_drawing_size">24dip</dimen>
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
value at runtime for some things) -->
|
value at runtime for some things) -->
|
||||||
<bool name="config_recents_interface_for_tablets">false</bool>
|
<bool name="config_recents_interface_for_tablets">false</bool>
|
||||||
|
|
||||||
|
<!-- Whether recents thumbnails should stretch in both x and y to fill their
|
||||||
|
ImageView -->
|
||||||
|
<bool name="config_recents_thumbnail_image_fits_to_xy">false</bool>
|
||||||
|
|
||||||
<!-- Control whether status bar should distinguish HSPA data icon form UMTS
|
<!-- Control whether status bar should distinguish HSPA data icon form UMTS
|
||||||
data icon on devices -->
|
data icon on devices -->
|
||||||
<bool name="config_hspa_data_distinguishable">false</bool>
|
<bool name="config_hspa_data_distinguishable">false</bool>
|
||||||
|
@ -120,8 +120,13 @@ import android.view.View;
|
|||||||
|
|
||||||
createAnimation(appearing);
|
createAnimation(appearing);
|
||||||
|
|
||||||
mContentView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
// isHardwareAccelerated() checks if we're attached to a window and if that
|
||||||
mContentView.buildLayer();
|
// 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();
|
mContentAnim.start();
|
||||||
|
|
||||||
mVisible = appearing;
|
mVisible = appearing;
|
||||||
|
@ -16,14 +16,13 @@
|
|||||||
|
|
||||||
package com.android.systemui.recent;
|
package com.android.systemui.recent;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.LayoutTransition;
|
import android.animation.LayoutTransition;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Shader.TileMode;
|
import android.graphics.Shader.TileMode;
|
||||||
@ -42,15 +41,15 @@ import android.view.ViewGroup;
|
|||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.HorizontalScrollView;
|
import android.widget.HorizontalScrollView;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ImageView.ScaleType;
|
||||||
import android.widget.PopupMenu;
|
import android.widget.PopupMenu;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
|
||||||
import android.widget.ImageView.ScaleType;
|
|
||||||
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.statusbar.StatusBar;
|
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.StatusBarPanel;
|
||||||
import com.android.systemui.statusbar.tablet.TabletStatusBar;
|
import com.android.systemui.statusbar.tablet.TabletStatusBar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class RecentsPanelView extends RelativeLayout implements OnItemClickListener, RecentsCallback,
|
public class RecentsPanelView extends RelativeLayout implements OnItemClickListener, RecentsCallback,
|
||||||
StatusBarPanel, Animator.AnimatorListener, View.OnTouchListener {
|
StatusBarPanel, Animator.AnimatorListener, View.OnTouchListener {
|
||||||
static final String TAG = "RecentsPanelView";
|
static final String TAG = "RecentsPanelView";
|
||||||
@ -65,7 +66,6 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private StatusBar mBar;
|
private StatusBar mBar;
|
||||||
private View mRecentsScrim;
|
private View mRecentsScrim;
|
||||||
private View mRecentsGlowView;
|
|
||||||
private View mRecentsNoApps;
|
private View mRecentsNoApps;
|
||||||
private ViewGroup mRecentsContainer;
|
private ViewGroup mRecentsContainer;
|
||||||
|
|
||||||
@ -79,6 +79,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
private boolean mRecentTasksDirty = true;
|
private boolean mRecentTasksDirty = true;
|
||||||
private TaskDescriptionAdapter mListAdapter;
|
private TaskDescriptionAdapter mListAdapter;
|
||||||
private int mThumbnailWidth;
|
private int mThumbnailWidth;
|
||||||
|
private boolean mFitThumbnailToXY;
|
||||||
|
|
||||||
public void setRecentTasksLoader(RecentTasksLoader loader) {
|
public void setRecentTasksLoader(RecentTasksLoader loader) {
|
||||||
mRecentTasksLoader = loader;
|
mRecentTasksLoader = loader;
|
||||||
@ -174,9 +175,8 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
// use mRecentsContainer's exact bounds to determine horizontal position
|
// use mRecentsContainer's exact bounds to determine horizontal position
|
||||||
final int l = mRecentsContainer.getLeft();
|
final int l = mRecentsContainer.getLeft();
|
||||||
final int r = mRecentsContainer.getRight();
|
final int r = mRecentsContainer.getRight();
|
||||||
// use surrounding mRecentsGlowView's position in parent determine vertical bounds
|
final int t = mRecentsContainer.getTop();
|
||||||
final int t = mRecentsGlowView.getTop();
|
final int b = mRecentsContainer.getBottom();
|
||||||
final int b = mRecentsGlowView.getBottom();
|
|
||||||
return x >= l && x < r && y >= t && y < b;
|
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
|
// if there are no apps, either bring up a "No recent apps" message, or just
|
||||||
// quit early
|
// quit early
|
||||||
boolean noApps = (mRecentTaskDescriptions.size() == 0);
|
boolean noApps = (mRecentTaskDescriptions.size() == 0);
|
||||||
if (mRecentsNoApps != null) { // doesn't exist on large devices
|
if (mRecentsNoApps != null) {
|
||||||
mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
|
mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
if (noApps) {
|
if (noApps) {
|
||||||
@ -325,8 +325,9 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateValuesFromResources() {
|
public void updateValuesFromResources() {
|
||||||
mThumbnailWidth =
|
final Resources res = mContext.getResources();
|
||||||
(int) mContext.getResources().getDimension(R.dimen.status_bar_recents_thumbnail_width);
|
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
|
@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);
|
mRecentsScrim = findViewById(R.id.recents_bg_protect);
|
||||||
mRecentsNoApps = findViewById(R.id.recents_no_apps);
|
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);
|
mRecentsDismissButton = findViewById(R.id.recents_dismiss_button);
|
||||||
if (mRecentsDismissButton != null) {
|
if (mRecentsDismissButton != null) {
|
||||||
mRecentsDismissButton.setOnClickListener(new OnClickListener() {
|
mRecentsDismissButton.setOnClickListener(new OnClickListener() {
|
||||||
@ -409,11 +409,15 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
if (h.thumbnailViewImageBitmap == null ||
|
if (h.thumbnailViewImageBitmap == null ||
|
||||||
h.thumbnailViewImageBitmap.getWidth() != thumbnail.getWidth() ||
|
h.thumbnailViewImageBitmap.getWidth() != thumbnail.getWidth() ||
|
||||||
h.thumbnailViewImageBitmap.getHeight() != thumbnail.getHeight()) {
|
h.thumbnailViewImageBitmap.getHeight() != thumbnail.getHeight()) {
|
||||||
Matrix scaleMatrix = new Matrix();
|
if (mFitThumbnailToXY) {
|
||||||
float scale = mThumbnailWidth / (float) thumbnail.getWidth();
|
h.thumbnailViewImage.setScaleType(ScaleType.FIT_XY);
|
||||||
scaleMatrix.setScale(scale, scale);
|
} else {
|
||||||
h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
|
Matrix scaleMatrix = new Matrix();
|
||||||
h.thumbnailViewImage.setImageMatrix(scaleMatrix);
|
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 (show && h.thumbnailView.getVisibility() != View.VISIBLE) {
|
||||||
if (anim) {
|
if (anim) {
|
||||||
@ -444,7 +448,7 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
// only fade in the thumbnail if recents is already visible-- we
|
// only fade in the thumbnail if recents is already visible-- we
|
||||||
// show it immediately otherwise
|
// show it immediately otherwise
|
||||||
boolean animateShow = mShowing &&
|
boolean animateShow = mShowing &&
|
||||||
mRecentsGlowView.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD;
|
mRecentsContainer.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD;
|
||||||
updateThumbnail(h, ad.getThumbnail(), true, animateShow);
|
updateThumbnail(h, ad.getThumbnail(), true, animateShow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -516,7 +520,6 @@ public class RecentsPanelView extends RelativeLayout implements OnItemClickListe
|
|||||||
final int items = mRecentTaskDescriptions.size();
|
final int items = mRecentTaskDescriptions.size();
|
||||||
|
|
||||||
mRecentsContainer.setVisibility(items > 0 ? View.VISIBLE : View.GONE);
|
mRecentsContainer.setVisibility(items > 0 ? View.VISIBLE : View.GONE);
|
||||||
mRecentsGlowView.setVisibility(items > 0 ? View.VISIBLE : View.GONE);
|
|
||||||
|
|
||||||
// Set description for accessibility
|
// Set description for accessibility
|
||||||
int numRecentApps = mRecentTaskDescriptions.size();
|
int numRecentApps = mRecentTaskDescriptions.size();
|
||||||
|
@ -5090,10 +5090,22 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
// Constrain thumbnail to smaller of screen width or height. Assumes aspect
|
// Constrain thumbnail to smaller of screen width or height. Assumes aspect
|
||||||
// of thumbnail is the same as the screen (in landscape) or square.
|
// 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) {
|
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 {
|
} 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.
|
// The screen shot will contain the entire screen.
|
||||||
|
Reference in New Issue
Block a user