Merge "Added "No recent apps" message on phones" into ics-factoryrom

This commit is contained in:
Michael Jurka
2011-09-19 10:33:08 -07:00
committed by Android (Google) Code Review
6 changed files with 84 additions and 4 deletions

View File

@@ -69,6 +69,12 @@
</FrameLayout>
<include layout="@layout/status_bar_no_recent_apps"
android:id="@+id/recents_no_apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
<View android:id="@+id/recents_dismiss_button"
android:layout_width="80px"
android:layout_height="@*android:dimen/status_bar_height"

View File

@@ -67,6 +67,12 @@
</FrameLayout>
<include layout="@layout/status_bar_no_recent_apps"
android:id="@+id/recents_no_apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
<View android:id="@+id/recents_dismiss_button"
android:layout_width="80px"
android:layout_height="@*android:dimen/status_bar_height"

View File

@@ -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="24dp"
android:textColor="#ffffffff"
android:text="@string/status_bar_no_recent_apps"
android:gravity="center_horizontal"
android:layout_gravity="center"
/>
</FrameLayout>

View File

@@ -41,6 +41,10 @@
<!-- Title shown in recents popup for inspecting an application's properties -->
<string name="status_bar_recent_inspect_item_title">App info</string>
<!-- Message shown in the middle of the screen after clicking on the recent apps button
when there are no recent apps to show [CHAR LIMIT=45]-->
<string name="status_bar_no_recent_apps">No recent apps</string>
<!-- The label in the bar at the top of the status bar when there are no notifications
showing. [CHAR LIMIT=40]-->
<string name="status_bar_no_notifications_title">No notifications</string>

View File

@@ -38,17 +38,20 @@ import android.view.View;
View mRootView;
View mScrimView;
View mContentView;
View mNoRecentAppsView;
AnimatorSet mContentAnim;
Animator.AnimatorListener mListener;
// the panel will start to appear this many px from the end
final int HYPERSPACE_OFFRAMP = 200;
public Choreographer(View root, View scrim, View content, Animator.AnimatorListener listener) {
public Choreographer(View root, View scrim, View content,
View noRecentApps, Animator.AnimatorListener listener) {
mRootView = root;
mScrimView = scrim;
mContentView = content;
mListener = listener;
mNoRecentAppsView = noRecentApps;
}
void createAnimation(boolean appearing) {
@@ -81,8 +84,24 @@ import android.view.View;
: new android.view.animation.DecelerateInterpolator(1.0f));
glowAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION);
Animator noRecentAppsFadeAnim = null;
if (mNoRecentAppsView != null && // doesn't exist on large devices
mNoRecentAppsView.getVisibility() == View.VISIBLE) {
noRecentAppsFadeAnim = ObjectAnimator.ofFloat(mNoRecentAppsView, "alpha",
mContentView.getAlpha(), appearing ? 1.0f : 0.0f);
noRecentAppsFadeAnim.setInterpolator(appearing
? new android.view.animation.AccelerateInterpolator(1.0f)
: new android.view.animation.DecelerateInterpolator(1.0f));
noRecentAppsFadeAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION);
}
mContentAnim = new AnimatorSet();
final Builder builder = mContentAnim.play(glowAnim).with(posAnim);
if (noRecentAppsFadeAnim != null) {
builder.with(noRecentAppsFadeAnim);
}
Drawable background = mScrimView.getBackground();
if (background != null) {
Animator bgAnim = ObjectAnimator.ofInt(background,

View File

@@ -83,6 +83,7 @@ public class RecentsPanelView extends RelativeLayout
private int mIconDpi;
private View mRecentsScrim;
private View mRecentsGlowView;
private View mRecentsNoApps;
private ViewGroup mRecentsContainer;
private Bitmap mDefaultThumbnailBackground;
@@ -373,8 +374,9 @@ public class RecentsPanelView extends RelativeLayout
mRecentsGlowView = findViewById(R.id.recents_glow);
mRecentsScrim = (View) findViewById(R.id.recents_bg_protect);
mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView, this);
mRecentsScrim = findViewById(R.id.recents_bg_protect);
mRecentsNoApps = findViewById(R.id.recents_no_apps);
mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView, mRecentsNoApps, this);
mRecentsDismissButton = findViewById(R.id.recents_dismiss_button);
mRecentsDismissButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
@@ -581,6 +583,9 @@ public class RecentsPanelView extends RelativeLayout
mThumbnailLoader.cancel(false);
mThumbnailLoader = null;
}
if (mRecentsNoApps != null) { // doesn't exist on large devices
mRecentsNoApps.setVisibility(View.INVISIBLE);
}
mActivityDescriptions = getRecentTasks();
for (ActivityDescription ad : mActivityDescriptions) {
ad.setThumbnail(mDefaultThumbnailBackground);
@@ -647,7 +652,11 @@ public class RecentsPanelView extends RelativeLayout
} else {
// Immediately hide this panel
if (DEBUG) Log.v(TAG, "Nothing to show");
hide(false);
if (mRecentsNoApps != null) { // doesn't exist on large devices
mRecentsNoApps.setVisibility(View.VISIBLE);
} else {
hide(false);
}
}
}