diff options
| author | 2014-06-24 14:40:53 -0700 | |
|---|---|---|
| committer | 2014-06-24 15:42:33 -0700 | |
| commit | 8e548f7025ce930810479a8e628c325d09557fa3 (patch) | |
| tree | 2fb02ae64771c2ae03b95169b38843e22ba6510e | |
| parent | cdbbb7e33033d7ae368aa5b7007ec2b20ebdaff1 (diff) | |
Refactoring Recents layout into an xml.
- Hiding the search bar when entering filtering mode
Change-Id: Ifce8429d6f331406e9688c96cd978f6900879c96
12 files changed, 193 insertions, 118 deletions
diff --git a/packages/SystemUI/res/layout/recents.xml b/packages/SystemUI/res/layout/recents.xml new file mode 100644 index 000000000000..47740ee94eec --- /dev/null +++ b/packages/SystemUI/res/layout/recents.xml @@ -0,0 +1,56 @@ +<?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. +--> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + <!-- Status Bar Scrim View --> + <ImageView + android:id="@+id/status_bar_scrim" + 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" /> + + <!-- Recents View --> + <com.android.systemui.recents.views.RecentsView + android:id="@+id/recents_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:focusable="true" /> + + <!-- Empty View --> + <ViewStub android:id="@+id/empty_view_stub" + android:layout="@layout/recents_empty" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <!-- Fullscreen Transition View --> + <ViewStub android:id="@+id/fullscreen_overlay_stub" + android:layout="@layout/recents_fullscreen_overlay" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <!-- Nav Bar Scrim View --> + <ImageView + android:id="@+id/nav_bar_scrim" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:scaleType="fitXY" + android:src="@drawable/recents_lower_gradient" /> +</FrameLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents_empty.xml b/packages/SystemUI/res/layout/recents_empty.xml index c0ddde1e161f..21d1711c965b 100644 --- a/packages/SystemUI/res/layout/recents_empty.xml +++ b/packages/SystemUI/res/layout/recents_empty.xml @@ -16,11 +16,13 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" android:gravity="center" android:textSize="20sp" android:textColor="#ffffffff" android:text="@string/recents_empty_message" android:fontFamily="sans-serif-light" + android:background="#80000000" android:visibility="gone" />
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents_nav_bar_scrim.xml b/packages/SystemUI/res/layout/recents_fullscreen_overlay.xml index 4245d49ad857..1d021f930892 100644 --- a/packages/SystemUI/res/layout/recents_nav_bar_scrim.xml +++ b/packages/SystemUI/res/layout/recents_fullscreen_overlay.xml @@ -14,10 +14,14 @@ limitations under the License. --> -<ImageView +<com.android.systemui.recents.views.FullscreenTransitionOverlayView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal|bottom" - android:scaleType="fitXY" - android:src="@drawable/recents_lower_gradient" />
\ No newline at end of file + android:layout_height="match_parent" + android:visibility="gone"> + <ImageView + android:id="@+id/image" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="fitXY" /> +</com.android.systemui.recents.views.FullscreenTransitionOverlayView>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents_status_bar_scrim.xml b/packages/SystemUI/res/layout/recents_status_bar_scrim.xml deleted file mode 100644 index 24928d0c7311..000000000000 --- a/packages/SystemUI/res/layout/recents_status_bar_scrim.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?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/src/com/android/systemui/recents/Constants.java b/packages/SystemUI/src/com/android/systemui/recents/Constants.java index ddea0bfe33b3..2abbad5e0a29 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Constants.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Constants.java @@ -33,6 +33,8 @@ public class Constants { public static final boolean EnableTaskFiltering = true; // Enables clipping of tasks against each other public static final boolean EnableTaskStackClipping = true; + // Enables tapping on the TaskBar to launch the task + public static final boolean EnableTaskBarTouchEvents = true; // Enables the use of theme colors as the task bar background public static final boolean EnableTaskBarThemeColors = true; // Enables app-info pane on long-pressing the icon diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 21704a42d7c7..52a17df3b5df 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -29,32 +29,30 @@ import android.os.Bundle; import android.os.UserHandle; import android.util.Pair; import android.view.KeyEvent; -import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; -import android.widget.FrameLayout; +import android.view.ViewStub; import com.android.systemui.R; import com.android.systemui.recents.model.SpaceNode; import com.android.systemui.recents.model.TaskStack; -import com.android.systemui.recents.views.FullScreenTransitionView; +import com.android.systemui.recents.views.FullscreenTransitionOverlayView; import com.android.systemui.recents.views.RecentsView; import com.android.systemui.recents.views.SystemBarScrimViews; import com.android.systemui.recents.views.ViewAnimation; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.ArrayList; /* Activity */ public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks, RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks, - FullScreenTransitionView.FullScreenTransitionViewCallbacks { + FullscreenTransitionOverlayView.FullScreenTransitionViewCallbacks { - FrameLayout mContainerView; RecentsView mRecentsView; SystemBarScrimViews mScrimViews; + ViewStub mEmptyViewStub; View mEmptyView; - FullScreenTransitionView mFullScreenshotView; + ViewStub mFullscreenOverlayStub; + FullscreenTransitionOverlayView mFullScreenOverlayView; RecentsConfiguration mConfig; @@ -125,8 +123,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView dismissRecentsIfVisible(); } else { // If we are mid-animation into Recents, then reverse it and finish - if (mFullScreenshotView == null || - !mFullScreenshotView.cancelAnimateOnEnterRecents(mFinishRunnable)) { + if (mFullScreenOverlayView == null || + !mFullScreenOverlayView.cancelAnimateOnEnterRecents(mFinishRunnable)) { // Otherwise, either finish Recents, or launch Home directly ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(context, null, mFinishLaunchHomeRunnable, null); @@ -142,7 +140,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } else if (action.equals(RecentsService.ACTION_START_ENTER_ANIMATION)) { // Try and start the enter animation (or restart it on configuration changed) - mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(mFullScreenshotView)); + mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(mFullScreenOverlayView)); // Call our callback onEnterAnimationTriggered(); } @@ -181,9 +179,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mScrimViews.prepareEnterRecentsAnimation(); // Add the default no-recents layout + if (mEmptyView == null) { + mEmptyView = mEmptyViewStub.inflate(); + } if (mConfig.launchedWithNoRecentTasks) { mEmptyView.setVisibility(View.VISIBLE); - mEmptyView.setBackgroundColor(0x80000000); } else { mEmptyView.setVisibility(View.GONE); } @@ -266,8 +266,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView boolean dismissRecentsIfVisible() { if (mVisible) { // If we are mid-animation into Recents, then reverse it and finish - if (mFullScreenshotView == null || - !mFullScreenshotView.cancelAnimateOnEnterRecents(mFinishRunnable)) { + if (mFullScreenOverlayView == null || + !mFullScreenOverlayView.cancelAnimateOnEnterRecents(mFinishRunnable)) { // If we have a focused task, then launch that task if (!mRecentsView.launchFocusedTask()) { if (mConfig.launchedFromHome) { @@ -318,44 +318,25 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Initialize the widget host (the host id is static and does not change) mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId); - // Create the view hierarchy - mRecentsView = new RecentsView(this); + // Set the Recents layout + setContentView(R.layout.recents); + mRecentsView = (RecentsView) findViewById(R.id.recents_view); mRecentsView.setCallbacks(this); - mRecentsView.setLayoutParams(new FrameLayout.LayoutParams( - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT)); mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); - - // Create the empty view - LayoutInflater inflater = LayoutInflater.from(this); - mEmptyView = inflater.inflate(R.layout.recents_empty, mContainerView, false); - mScrimViews = new SystemBarScrimViews(mConfig); - mScrimViews.inflate(inflater, mContainerView); - if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { - mFullScreenshotView = new FullScreenTransitionView(this, this); - mFullScreenshotView.setLayoutParams(new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - } - - // Add the views to the layout - mContainerView = new FrameLayout(this); - mContainerView.addView(mScrimViews.getStatusBarScrimView()); - mContainerView.addView(mRecentsView); - mContainerView.addView(mEmptyView); - if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { - mContainerView.addView(mFullScreenshotView); - } - mContainerView.addView(mScrimViews.getNavBarScrimView()); - setContentView(mContainerView); + mEmptyViewStub = (ViewStub) findViewById(R.id.empty_view_stub); + mFullscreenOverlayStub = (ViewStub) findViewById(R.id.fullscreen_overlay_stub); + mScrimViews = new SystemBarScrimViews(this, mConfig); // Update the recent tasks updateRecentsTasks(getIntent()); // Prepare the screenshot transition if necessary if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { - mFullScreenshotView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot()); + mFullScreenOverlayView = (FullscreenTransitionOverlayView) mFullscreenOverlayStub.inflate(); + mFullScreenOverlayView.setCallbacks(this); + mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot()); } // Bind the search app widget when we first start up @@ -381,7 +362,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView void onConfigurationChange() { // Try and start the enter animation (or restart it on configuration changed) - mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(mFullScreenshotView)); + mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(mFullScreenOverlayView)); // Call our callback onEnterAnimationTriggered(); } @@ -409,7 +390,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Prepare the screenshot transition if necessary if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { - mFullScreenshotView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot()); + mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot()); } // Don't attempt to rebind the search bar widget, but just add the search bar layout @@ -544,8 +525,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView @Override public void onBackPressed() { // If we are mid-animation into Recents, then reverse it and finish - if (mFullScreenshotView == null || - !mFullScreenshotView.cancelAnimateOnEnterRecents(mFinishRunnable)) { + if (mFullScreenOverlayView == null || + !mFullScreenOverlayView.cancelAnimateOnEnterRecents(mFinishRunnable)) { // If we are currently filtering in any stacks, unfilter them first if (!mRecentsView.unfilterFilteredStacks()) { if (mConfig.launchedFromHome) { @@ -570,14 +551,14 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mScrimViews.startEnterRecentsAnimation(); } - /**** FullScreenTransitionView.FullScreenTransitionViewCallbacks Implementation ****/ + /**** FullscreenTransitionOverlayView.FullScreenTransitionViewCallbacks Implementation ****/ @Override public void onEnterAnimationComplete(boolean canceled) { if (!canceled) { // Reset the full screenshot transition view if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { - mFullScreenshotView.reset(); + mFullScreenOverlayView.reset(); } // XXX: We should clean up the screenshot in this case as well, but it needs to happen diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/FullScreenTransitionView.java b/packages/SystemUI/src/com/android/systemui/recents/views/FullscreenTransitionOverlayView.java index cadfc5604698..2c632cfe63a5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/FullScreenTransitionView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/FullscreenTransitionOverlayView.java @@ -25,10 +25,11 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; +import android.util.AttributeSet; import android.view.View; -import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; +import com.android.systemui.R; import com.android.systemui.recents.Console; import com.android.systemui.recents.Constants; import com.android.systemui.recents.RecentsConfiguration; @@ -38,9 +39,9 @@ import com.android.systemui.recents.RecentsConfiguration; * The full screen transition view that gets animated down from the full screen into a task * thumbnail view. */ -public class FullScreenTransitionView extends FrameLayout { +public class FullscreenTransitionOverlayView extends FrameLayout { - /** The FullScreenTransitionView callbacks */ + /** The FullscreenTransitionOverlayView callbacks */ public interface FullScreenTransitionViewCallbacks { void onEnterAnimationComplete(boolean canceled); } @@ -56,20 +57,37 @@ public class FullScreenTransitionView extends FrameLayout { boolean mIsAnimating; AnimatorSet mEnterAnimation; - public FullScreenTransitionView(Context context, FullScreenTransitionViewCallbacks cb) { + public FullscreenTransitionOverlayView(Context context) { super(context); + } + + public FullscreenTransitionOverlayView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public FullscreenTransitionOverlayView(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public FullscreenTransitionOverlayView(Context context, AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); mConfig = RecentsConfiguration.getInstance(); - mCb = cb; - mScreenshotView = new ImageView(context); - mScreenshotView.setScaleType(ImageView.ScaleType.FIT_XY); - mScreenshotView.setLayoutParams(new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - addView(mScreenshotView); setClipTop(getClipTop()); setClipBottom(getClipBottom()); setWillNotDraw(false); } + @Override + protected void onFinishInflate() { + mScreenshotView = (ImageView) findViewById(R.id.image); + } + + /** Sets the callbacks */ + public void setCallbacks(FullScreenTransitionViewCallbacks cb) { + mCb = cb; + } + /** Sets the top clip */ public void setClipTop(int clip) { mClipRect.top = clip; diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index d06c9d2e297d..8afc5b9f8bbe 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -28,6 +28,7 @@ import android.graphics.Rect; import android.net.Uri; import android.os.UserHandle; import android.provider.Settings; +import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.WindowInsets; @@ -44,7 +45,6 @@ import com.android.systemui.recents.model.TaskStack; import java.util.ArrayList; import java.util.Set; - /** * This view is the the top level layout that contains TaskStacks (which are laid out according * to their SpaceNode bounds. @@ -72,6 +72,18 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV public RecentsView(Context context) { super(context); + } + + public RecentsView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public RecentsView(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public RecentsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); mConfig = RecentsConfiguration.getInstance(); mInflater = LayoutInflater.from(context); } @@ -509,6 +521,34 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV isDocument); } + @Override + public void onTaskStackFilterTriggered() { + // Hide the search bar + if (mSearchBar != null) { + mSearchBar.animate() + .alpha(0f) + .setStartDelay(0) + .setInterpolator(mConfig.fastOutSlowInInterpolator) + .setDuration(mConfig.filteringCurrentViewsAnimDuration) + .withLayer() + .start(); + } + } + + @Override + public void onTaskStackUnfilterTriggered() { + // Show the search bar + if (mSearchBar != null) { + mSearchBar.animate() + .alpha(1f) + .setStartDelay(0) + .setInterpolator(mConfig.fastOutSlowInInterpolator) + .setDuration(mConfig.filteringNewViewsAnimDuration) + .withLayer() + .start(); + } + } + /**** RecentsPackageMonitor.PackageCallbacks Implementation ****/ @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java b/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java index 932c345f246a..5b17b418960a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java @@ -16,11 +16,8 @@ package com.android.systemui.recents.views; -import android.view.Gravity; -import android.view.LayoutInflater; +import android.app.Activity; import android.view.View; -import android.view.ViewGroup; -import android.widget.FrameLayout; import com.android.systemui.R; import com.android.systemui.recents.RecentsConfiguration; @@ -37,20 +34,10 @@ public class SystemBarScrimViews { boolean mHasStatusBarScrim; boolean mShouldAnimateNavBarScrim; - public SystemBarScrimViews(RecentsConfiguration config) { + public SystemBarScrimViews(Activity activity, RecentsConfiguration config) { mConfig = config; - } - - /** Inflates the scrim views */ - public void inflate(LayoutInflater inflater, ViewGroup parent) { - mStatusBarScrimView = inflater.inflate(R.layout.recents_status_bar_scrim, parent, 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, parent, false); - mNavBarScrimView.setLayoutParams(new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM)); + mStatusBarScrimView = activity.findViewById(R.id.status_bar_scrim); + mNavBarScrimView = activity.findViewById(R.id.nav_bar_scrim); } /** @@ -119,14 +106,4 @@ public class SystemBarScrimViews { .start(); } } - - /** Returns the status bar scrim view. */ - public View getStatusBarScrimView() { - return mStatusBarScrimView; - } - - /** Returns the nav bar scrim view. */ - public View getNavBarScrimView() { - return mNavBarScrimView; - } } diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java index 1ef58add7206..80f804d6c9fa 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java @@ -25,6 +25,7 @@ import android.graphics.PorterDuffXfermode; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.util.AttributeSet; +import android.view.MotionEvent; import android.view.View; import android.view.ViewPropertyAnimator; import android.widget.FrameLayout; @@ -88,6 +89,15 @@ class TaskBarView extends FrameLayout { } @Override + public boolean onTouchEvent(MotionEvent event) { + if (Constants.DebugFlags.App.EnableTaskBarTouchEvents) { + return super.onTouchEvent(event); + } + // We ignore taps on the task bar except on the filter and dismiss buttons + return true; + } + + @Override protected void onFinishInflate() { // Initialize the icon and description views mApplicationIcon = (ImageView) findViewById(R.id.application_icon); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 74bc526f5915..1cf28b998d6c 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -58,6 +58,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void onTaskLaunched(TaskStackView stackView, TaskView tv, TaskStack stack, Task t); public void onTaskAppInfoLaunched(Task t); public void onTaskRemoved(Task t); + public void onTaskStackFilterTriggered(); + public void onTaskStackUnfilterTriggered(); } RecentsConfiguration mConfig; @@ -1131,6 +1133,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Animate doFilteringAnimation(curTasks, curTaskTransforms, tasks, taskTransforms); + + // Notify any callbacks + mCb.onTaskStackFilterTriggered(); } @Override @@ -1154,6 +1159,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Clear the saved vars mStashedScroll = 0; + + // Notify any callbacks + mCb.onTaskStackUnfilterTriggered(); } /**** ViewPoolConsumer Implementation ****/ diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java b/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java index b5e8ffd7d792..13407aa13613 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java @@ -25,7 +25,7 @@ public class ViewAnimation { /* The animation context for a task view animation into Recents */ public static class TaskViewEnterContext { // The full screenshot view that we are animating down - FullScreenTransitionView fullScreenshot; + FullscreenTransitionOverlayView fullScreenshot; // The transform of the current task view TaskViewTransform transform; // The stack rect that the transform is relative to @@ -39,7 +39,7 @@ public class ViewAnimation { // Whether this is the front most task view boolean isFrontMost; - public TaskViewEnterContext(FullScreenTransitionView fss) { + public TaskViewEnterContext(FullscreenTransitionOverlayView fss) { fullScreenshot = fss; } } |