summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-06-17 15:53:44 -0700
committerWinson Chung <winsonc@google.com>2014-06-17 16:37:56 -0700
commit06795630f62e1e7ad89825db23d7656f8dcd6c5a (patch)
treef5b6bf0708ac67fb5c2825b602124b781de45201
parent96401d99959afc2034a6b43580a93dae94da684a (diff)
downloadframeworks_base-06795630f62e1e7ad89825db23d7656f8dcd6c5a.zip
frameworks_base-06795630f62e1e7ad89825db23d7656f8dcd6c5a.tar.gz
frameworks_base-06795630f62e1e7ad89825db23d7656f8dcd6c5a.tar.bz2
Adding status bar scrim, reducing extra work updating configuration values.
- Making the app icon larger for tapping
-rw-r--r--packages/SystemUI/res/drawable-hdpi/recents_lower_gradient.9.pngbin219 -> 203 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/recents_status_gradient.9.pngbin0 -> 169 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/recents_lower_gradient.9.pngbin193 -> 181 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/recents_status_gradient.9.pngbin0 -> 163 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/recents_lower_gradient.9.pngbin242 -> 220 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/recents_status_gradient.9.pngbin0 -> 186 bytes
-rw-r--r--packages/SystemUI/res/drawable-xxhdpi/recents_lower_gradient.9.pngbin1123 -> 265 bytes
-rw-r--r--packages/SystemUI/res/drawable-xxhdpi/recents_status_gradient.9.pngbin0 -> 223 bytes
-rw-r--r--packages/SystemUI/res/layout/recents_status_bar_scrim.xml23
-rw-r--r--packages/SystemUI/res/layout/recents_task_view.xml5
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java34
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java47
13 files changed, 81 insertions, 30 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/recents_lower_gradient.9.png b/packages/SystemUI/res/drawable-hdpi/recents_lower_gradient.9.png
index d4fdbf3..17100f7 100644
--- a/packages/SystemUI/res/drawable-hdpi/recents_lower_gradient.9.png
+++ b/packages/SystemUI/res/drawable-hdpi/recents_lower_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/recents_status_gradient.9.png b/packages/SystemUI/res/drawable-hdpi/recents_status_gradient.9.png
new file mode 100644
index 0000000..e969d4c
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/recents_status_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/recents_lower_gradient.9.png b/packages/SystemUI/res/drawable-mdpi/recents_lower_gradient.9.png
index 9fc1a3b..b53bd8f 100644
--- a/packages/SystemUI/res/drawable-mdpi/recents_lower_gradient.9.png
+++ b/packages/SystemUI/res/drawable-mdpi/recents_lower_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/recents_status_gradient.9.png b/packages/SystemUI/res/drawable-mdpi/recents_status_gradient.9.png
new file mode 100644
index 0000000..657f710
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/recents_status_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/recents_lower_gradient.9.png b/packages/SystemUI/res/drawable-xhdpi/recents_lower_gradient.9.png
index f38de93..09606f6 100644
--- a/packages/SystemUI/res/drawable-xhdpi/recents_lower_gradient.9.png
+++ b/packages/SystemUI/res/drawable-xhdpi/recents_lower_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/recents_status_gradient.9.png b/packages/SystemUI/res/drawable-xhdpi/recents_status_gradient.9.png
new file mode 100644
index 0000000..a444c55
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/recents_status_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/recents_lower_gradient.9.png b/packages/SystemUI/res/drawable-xxhdpi/recents_lower_gradient.9.png
index 8194605..427cad9 100644
--- a/packages/SystemUI/res/drawable-xxhdpi/recents_lower_gradient.9.png
+++ b/packages/SystemUI/res/drawable-xxhdpi/recents_lower_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/recents_status_gradient.9.png b/packages/SystemUI/res/drawable-xxhdpi/recents_status_gradient.9.png
new file mode 100644
index 0000000..29cf44b
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xxhdpi/recents_status_gradient.9.png
Binary files differ
diff --git a/packages/SystemUI/res/layout/recents_status_bar_scrim.xml b/packages/SystemUI/res/layout/recents_status_bar_scrim.xml
new file mode 100644
index 0000000..24928d0
--- /dev/null
+++ b/packages/SystemUI/res/layout/recents_status_bar_scrim.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<ImageView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal|top"
+ android:scaleType="fitXY"
+ android:src="@drawable/recents_status_gradient" /> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/recents_task_view.xml b/packages/SystemUI/res/layout/recents_task_view.xml
index 23f2796..e4d7b0c 100644
--- a/packages/SystemUI/res/layout/recents_task_view.xml
+++ b/packages/SystemUI/res/layout/recents_task_view.xml
@@ -32,8 +32,9 @@
android:id="@+id/application_icon"
android:layout_width="@dimen/recents_task_view_application_icon_size"
android:layout_height="@dimen/recents_task_view_application_icon_size"
- android:layout_marginStart="16dp"
- android:layout_gravity="center_vertical|start" />
+ android:layout_marginStart="8dp"
+ android:layout_gravity="center_vertical|start"
+ android:padding="8dp" />
<TextView
android:id="@+id/activity_description"
android:layout_width="match_parent"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 8b8c126..bbcc9c1 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -212,7 +212,7 @@
<dimen name="glowpadview_inner_radius">15dip</dimen>
<!-- The size of the application icon in the recents task view. -->
- <dimen name="recents_task_view_application_icon_size">32dp</dimen>
+ <dimen name="recents_task_view_application_icon_size">48dp</dimen>
<!-- The size of the activity icon in the recents task view. -->
<dimen name="recents_task_view_activity_icon_size">60dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index dce8f57..ca66ea1 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -72,6 +72,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
FrameLayout mContainerView;
RecentsView mRecentsView;
View mEmptyView;
+ View mStatusBarScrimView;
View mNavBarScrimView;
FullScreenTransitionView mFullScreenshotView;
@@ -180,13 +181,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
AlternateRecentsComponent.EXTRA_TRIGGERED_FROM_ALT_TAB, false);
mConfig.launchedWithNoRecentTasks = !root.hasTasks();
- if (mConfig.shouldAnimateNavBarScrim()) {
- // Hide the scrim if we animate into Recents with window transitions
- mNavBarScrimView.setVisibility(View.INVISIBLE);
- } else {
- // Show the scrim if we animate into Recents without window transitions
- mNavBarScrimView.setVisibility(View.VISIBLE);
- }
+ // Show the scrim if we animate into Recents without window transitions
+ mNavBarScrimView.setVisibility(mConfig.hasNavBarScrim() &&
+ !mConfig.shouldAnimateNavBarScrim() ? View.VISIBLE : View.INVISIBLE);
+ mStatusBarScrimView.setVisibility(mConfig.hasStatusBarScrim() &&
+ !mConfig.shouldAnimateStatusBarScrim() ? View.VISIBLE : View.INVISIBLE);
// Add the default no-recents layout
if (mConfig.launchedWithNoRecentTasks) {
@@ -325,6 +324,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Create the empty view
LayoutInflater inflater = LayoutInflater.from(this);
mEmptyView = inflater.inflate(R.layout.recents_empty, mContainerView, false);
+ mStatusBarScrimView = inflater.inflate(R.layout.recents_status_bar_scrim, mContainerView, false);
+ mStatusBarScrimView.setLayoutParams(new FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.TOP));
mNavBarScrimView = inflater.inflate(R.layout.recents_nav_bar_scrim, mContainerView, false);
mNavBarScrimView.setLayoutParams(new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -336,6 +339,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
}
mContainerView = new FrameLayout(this);
+ mContainerView.addView(mStatusBarScrimView);
mContainerView.addView(mRecentsView);
mContainerView.addView(mEmptyView);
if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
@@ -563,8 +567,18 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
}
public void onEnterAnimationTriggered() {
- // Fade in the scrim
- if (mConfig.shouldAnimateNavBarScrim() && mConfig.hasNavBarScrim()) {
+ // Fade in the scrims
+ if (mConfig.hasStatusBarScrim() && mConfig.shouldAnimateStatusBarScrim()) {
+ mStatusBarScrimView.setVisibility(View.VISIBLE);
+ mStatusBarScrimView.setTranslationY(-mStatusBarScrimView.getMeasuredHeight());
+ mStatusBarScrimView.animate()
+ .translationY(0)
+ .setStartDelay(mConfig.taskBarEnterAnimDelay)
+ .setDuration(mConfig.navBarScrimEnterDuration)
+ .setInterpolator(mConfig.quintOutInterpolator)
+ .start();
+ }
+ if (mConfig.hasNavBarScrim() && mConfig.shouldAnimateNavBarScrim()) {
mNavBarScrimView.setVisibility(View.VISIBLE);
mNavBarScrimView.setTranslationY(mNavBarScrimView.getMeasuredHeight());
mNavBarScrimView.animate()
@@ -579,7 +593,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
public void onExitAnimationTriggered() {
// Fade out the scrim
- if (mConfig.shouldAnimateNavBarScrim() && mConfig.hasNavBarScrim()) {
+ if (mConfig.hasNavBarScrim() && mConfig.shouldAnimateNavBarScrim()) {
mNavBarScrimView.animate()
.translationY(mNavBarScrimView.getMeasuredHeight())
.setStartDelay(0)
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index c1a8ee6..acf4a18 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -106,12 +106,30 @@ public class RecentsConfiguration {
public boolean developerOptionsEnabled;
/** Private constructor */
- private RecentsConfiguration() {}
+ private RecentsConfiguration(Context context) {
+ // Properties that don't have to be reloaded with each configuration change can be loaded
+ // here.
+
+ // Interpolators
+ fastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.fast_out_slow_in);
+ fastOutLinearInInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.fast_out_linear_in);
+ linearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.linear_out_slow_in);
+ quintOutInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.decelerate_quint);
+
+ // Check if the developer options are enabled
+ ContentResolver cr = context.getContentResolver();
+ developerOptionsEnabled = Settings.Global.getInt(cr,
+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
+ }
/** Updates the configuration to the current context */
public static RecentsConfiguration reinitialize(Context context) {
if (sInstance == null) {
- sInstance = new RecentsConfiguration();
+ sInstance = new RecentsConfiguration(context);
}
sInstance.update(context);
return sInstance;
@@ -132,16 +150,6 @@ public class RecentsConfiguration {
animationPxMovementPerSecond =
res.getDimensionPixelSize(R.dimen.recents_animation_movement_in_dps_per_second);
- // Interpolators
- fastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.fast_out_slow_in);
- fastOutLinearInInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.fast_out_linear_in);
- linearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.linear_out_slow_in);
- quintOutInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.decelerate_quint);
-
// Filtering
filteringCurrentViewsMinAnimDuration =
res.getInteger(R.integer.recents_filter_animate_current_views_min_duration);
@@ -217,11 +225,6 @@ public class RecentsConfiguration {
navBarScrimEnterDuration =
res.getInteger(R.integer.recents_nav_bar_scrim_enter_duration);
- // Check if the developer options are enabled
- ContentResolver cr = context.getContentResolver();
- developerOptionsEnabled = Settings.Global.getInt(cr,
- Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
-
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout,
"[RecentsConfiguration|orientation]", isLandscape ? "Landscape" : "Portrait",
@@ -257,6 +260,16 @@ public class RecentsConfiguration {
return searchBarAppWidgetId >= 0;
}
+ /** Returns whether the status bar scrim should be animated when shown for the first time. */
+ public boolean shouldAnimateStatusBarScrim() {
+ return launchedFromHome;
+ }
+
+ /** Returns whether the status bar scrim should be visible. */
+ public boolean hasStatusBarScrim() {
+ return !launchedWithNoRecentTasks;
+ }
+
/** Returns whether the nav bar scrim should be animated when shown for the first time. */
public boolean shouldAnimateNavBarScrim() {
return true;