diff options
author | Michael Jurka <mikejurka@google.com> | 2012-10-10 00:00:21 +0200 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-10-13 01:02:09 +0200 |
commit | 071316e5612ae1554309912ad4ad4680b80c718d (patch) | |
tree | fd8ad76025db9aad666b24ca87dcb19ad56b8e43 /packages | |
parent | 957b27f62b5dd439c71ab8e2c0e46313ea89d4e8 (diff) | |
download | frameworks_base-071316e5612ae1554309912ad4ad4680b80c718d.zip frameworks_base-071316e5612ae1554309912ad4ad4680b80c718d.tar.gz frameworks_base-071316e5612ae1554309912ad4ad4680b80c718d.tar.bz2 |
Use black bg in recents if using live wallpaper
Bug: 7282784
Change-Id: I686f8f0e36e3414ad30d23de80cbbfb2868069d4
Diffstat (limited to 'packages')
10 files changed, 149 insertions, 63 deletions
diff --git a/packages/SystemUI/res/anim/recent_app_enter.xml b/packages/SystemUI/res/anim/recent_app_enter.xml deleted file mode 100644 index 4947eee..0000000 --- a/packages/SystemUI/res/anim/recent_app_enter.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2009, 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. -*/ ---> - -<!-- Special window zoom animation: this is the element that enters the screen, - it starts at 200% and scales down. Goes with zoom_exit.xml. --> -<set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:anim/decelerate_interpolator"> - <scale android:fromXScale="0.25" android:toXScale="1.0" - android:fromYScale="0.25" android:toYScale="1.0" - android:pivotX="0%p" android:pivotY="0%p" - android:duration="500" /> - <alpha android:fromAlpha="0.0" android:toAlpha="1.0" - android:duration="500"/> -</set> diff --git a/packages/SystemUI/res/anim/recent_app_leave.xml b/packages/SystemUI/res/anim/recent_app_leave.xml deleted file mode 100644 index 3d83988..0000000 --- a/packages/SystemUI/res/anim/recent_app_leave.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2009, 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. -*/ ---> - -<!-- Special window zoom animation: this is the element that enters the screen, - it starts at 200% and scales down. Goes with zoom_exit.xml. --> -<set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:anim/decelerate_interpolator"> - <scale android:fromXScale="1.0" android:toXScale="0.25" - android:fromYScale="1.0" android:toYScale="0.25" - android:pivotX="0%p" android:pivotY="0%p" - android:duration="500" /> - <alpha android:fromAlpha="1.0" android:toAlpha="0.0" - android:duration="500"/> -</set> diff --git a/packages/SystemUI/res/anim/recents_launch_from_launcher_enter.xml b/packages/SystemUI/res/anim/recents_launch_from_launcher_enter.xml new file mode 100644 index 0000000..73ae9f2 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_from_launcher_enter.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2012, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:detachWallpaper="true" + android:shareInterpolator="false" + android:zAdjustment="normal"> + <!--scale android:fromXScale="2.0" android:toXScale="1.0" + android:fromYScale="2.0" android:toYScale="1.0" + android:interpolator="@android:interpolator/decelerate_cubic" + android:fillEnabled="true" + android:fillBefore="true" android:fillAfter="true" + android:pivotX="50%p" android:pivotY="50%p" + android:duration="250" /--> + <alpha android:fromAlpha="0.0" android:toAlpha="1.0" + android:fillEnabled="true" + android:fillBefore="true" android:fillAfter="true" + android:interpolator="@android:interpolator/decelerate_cubic" + android:duration="250"/> +</set> diff --git a/packages/SystemUI/res/anim/recents_launch_from_launcher_exit.xml b/packages/SystemUI/res/anim/recents_launch_from_launcher_exit.xml new file mode 100644 index 0000000..becc9d0 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_launch_from_launcher_exit.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2012, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false" + android:zAdjustment="normal"> + <alpha android:fromAlpha="1.0" android:toAlpha="0.0" + android:fillEnabled="true" + android:fillBefore="true" android:fillAfter="true" + android:interpolator="@android:interpolator/decelerate_cubic" + android:duration="250"/> +</set> diff --git a/packages/SystemUI/res/anim/recents_return_to_launcher_enter.xml b/packages/SystemUI/res/anim/recents_return_to_launcher_enter.xml new file mode 100644 index 0000000..efa9019 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_return_to_launcher_enter.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2012, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false" + android:zAdjustment="normal"> + <alpha android:fromAlpha="0.0" android:toAlpha="1.0" + android:interpolator="@android:interpolator/decelerate_cubic" + android:duration="250"/> +</set> diff --git a/packages/SystemUI/res/anim/recents_return_to_launcher_exit.xml b/packages/SystemUI/res/anim/recents_return_to_launcher_exit.xml new file mode 100644 index 0000000..e95e667 --- /dev/null +++ b/packages/SystemUI/res/anim/recents_return_to_launcher_exit.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2012, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false" + android:zAdjustment="normal"> + <!--scale android:fromXScale="1.0" android:toXScale="2.0" + android:fromYScale="1.0" android:toYScale="2.0" + android:interpolator="@android:interpolator/decelerate_cubic" + android:pivotX="50%p" android:pivotY="50%p" + android:duration="250" /--> + <alpha android:fromAlpha="1.0" android:toAlpha="0.0" + android:interpolator="@android:interpolator/decelerate_cubic" + android:duration="250"/> +</set> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 4bf6c10..4de0891 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -52,7 +52,7 @@ <dimen name="status_bar_recents_item_padding">0dip</dimen> <!-- When recents first appears, how far the icon and label of the primary activity travel --> - <dimen name="status_bar_recents_app_icon_translate_distance">100dp</dimen> + <dimen name="status_bar_recents_app_icon_translate_distance">35dip</dimen> <!-- Where to place the app icon over the thumbnail --> <dimen name="status_bar_recents_app_icon_left_margin">0dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java index 79069b8..ef9f36e 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java @@ -18,6 +18,7 @@ package com.android.systemui.recent; import android.app.Activity; import android.app.ActivityManager; +import android.app.WallpaperManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -26,6 +27,7 @@ import android.os.Bundle; import android.os.UserHandle; import android.view.MotionEvent; import android.view.View; +import android.view.WindowManager; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; @@ -42,6 +44,7 @@ public class RecentsActivity extends Activity { private IntentFilter mIntentFilter; private boolean mShowing; private boolean mForeground; + private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -79,6 +82,9 @@ public class RecentsActivity extends Activity { @Override public void onPause() { + overridePendingTransition( + R.anim.recents_return_to_launcher_enter, + R.anim.recents_return_to_launcher_exit); mForeground = false; super.onPause(); } @@ -92,8 +98,23 @@ public class RecentsActivity extends Activity { super.onStop(); } + private void updateWallpaperVisibility(boolean visible) { + int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0; + int curflags = getWindow().getAttributes().flags + & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; + if (wpflags != curflags) { + getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER); + } + } + @Override public void onStart() { + // Hide wallpaper if it's not a static image + if (WallpaperManager.getInstance(this).getWallpaperInfo() != null) { + updateWallpaperVisibility(false); + } else { + updateWallpaperVisibility(true); + } mShowing = true; if (mRecentsPanel != null) { mRecentsPanel.refreshViews(); diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 8607508..57d2ed3 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -520,7 +520,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener public void onWindowAnimationStart() { if (mItemToAnimateInWhenWindowAnimationIsFinished != null) { - final int startDelay = 100; + final int startDelay = 150; final int duration = 250; final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished; final TimeInterpolator cubic = new DecelerateInterpolator(1.5f); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 3e929d6..577b1f4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -485,7 +485,11 @@ public abstract class BaseStatusBar extends SystemUI implements | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); if (firstTask == null) { - mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); + ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext, + R.anim.recents_launch_from_launcher_enter, + R.anim.recents_launch_from_launcher_exit); + mContext.startActivityAsUser(intent, opts.toBundle(), new UserHandle( + UserHandle.USER_CURRENT)); } else { Bitmap first = firstTask.getThumbnail(); final Resources res = mContext.getResources(); |