blob: 486539fa30685d30ae96bf0289213571b6e04a91 [file] [log] [blame]
Winson Chung303e1ff2014-03-07 15:06:19 -08001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.systemui.recents.views;
18
Winson Chung14926462014-04-14 18:57:14 -070019import android.animation.TimeInterpolator;
20import android.animation.ValueAnimator;
Winson Chung303e1ff2014-03-07 15:06:19 -080021import android.content.Context;
Winson Chung14926462014-04-14 18:57:14 -070022import android.graphics.Canvas;
Winson Chung96e3bc12014-05-06 16:44:12 -070023import android.graphics.Outline;
Winson Chung47a3e652014-05-21 16:03:42 -070024import android.graphics.Paint;
Winson Chung14926462014-04-14 18:57:14 -070025import android.graphics.Path;
Winson Chung9f9679d2014-04-11 16:49:09 -070026import android.graphics.Point;
Winson Chung303e1ff2014-03-07 15:06:19 -080027import android.graphics.Rect;
Winson Chung14926462014-04-14 18:57:14 -070028import android.graphics.RectF;
Winson Chung37c8d8e2014-03-24 14:53:07 -070029import android.util.AttributeSet;
Winson Chung9f9679d2014-04-11 16:49:09 -070030import android.view.MotionEvent;
Winson Chung303e1ff2014-03-07 15:06:19 -080031import android.view.View;
Winson Chung14926462014-04-14 18:57:14 -070032import android.view.animation.AccelerateInterpolator;
Winson Chung303e1ff2014-03-07 15:06:19 -080033import android.widget.FrameLayout;
Winson Chung37c8d8e2014-03-24 14:53:07 -070034import com.android.systemui.R;
Winson Chung14926462014-04-14 18:57:14 -070035import com.android.systemui.recents.Constants;
Winson Chung303e1ff2014-03-07 15:06:19 -080036import com.android.systemui.recents.RecentsConfiguration;
37import com.android.systemui.recents.model.Task;
Winson Chung303e1ff2014-03-07 15:06:19 -080038
Winson Chung303e1ff2014-03-07 15:06:19 -080039
Winson Chung37c8d8e2014-03-24 14:53:07 -070040/* A task view */
Winson Chung6cb485f2014-05-19 10:30:43 -070041public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.OnClickListener,
42 View.OnLongClickListener {
Winson Chung37c8d8e2014-03-24 14:53:07 -070043 /** The TaskView callbacks */
44 interface TaskViewCallbacks {
45 public void onTaskIconClicked(TaskView tv);
Winson Chung9f9679d2014-04-11 16:49:09 -070046 public void onTaskAppInfoClicked(TaskView tv);
Winson Chung47a3e652014-05-21 16:03:42 -070047 public void onTaskFocused(TaskView tv);
Winson Chung54e297a2014-05-09 17:15:32 -070048 public void onTaskDismissed(TaskView tv);
Winson Chung9f9679d2014-04-11 16:49:09 -070049
Winson Chung37c8d8e2014-03-24 14:53:07 -070050 // public void onTaskViewReboundToTask(TaskView tv, Task t);
51 }
52
Winson Chung14926462014-04-14 18:57:14 -070053 int mDim;
54 int mMaxDim;
55 TimeInterpolator mDimInterpolator = new AccelerateInterpolator();
56
Winson Chung303e1ff2014-03-07 15:06:19 -080057 Task mTask;
Winson Chung37c8d8e2014-03-24 14:53:07 -070058 boolean mTaskDataLoaded;
Winson Chung1e8d71b2014-05-16 17:05:22 -070059 boolean mIsFocused;
Winson Chung5a9b0b02014-05-20 17:32:03 -070060 boolean mClipViewInStack;
Winson Chung9f9679d2014-04-11 16:49:09 -070061 Point mLastTouchDown = new Point();
Winson Chung14926462014-04-14 18:57:14 -070062 Path mRoundedRectClipPath = new Path();
Winson Chung37c8d8e2014-03-24 14:53:07 -070063
64 TaskThumbnailView mThumbnailView;
65 TaskBarView mBarView;
66 TaskViewCallbacks mCb;
Winson Chung303e1ff2014-03-07 15:06:19 -080067
Winson Chung37c8d8e2014-03-24 14:53:07 -070068
69 public TaskView(Context context) {
70 this(context, null);
Winson Chung303e1ff2014-03-07 15:06:19 -080071 }
72
Winson Chung37c8d8e2014-03-24 14:53:07 -070073 public TaskView(Context context, AttributeSet attrs) {
74 this(context, attrs, 0);
75 }
Winson Chung303e1ff2014-03-07 15:06:19 -080076
Winson Chung37c8d8e2014-03-24 14:53:07 -070077 public TaskView(Context context, AttributeSet attrs, int defStyleAttr) {
78 this(context, attrs, defStyleAttr, 0);
79 }
80
81 public TaskView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
82 super(context, attrs, defStyleAttr, defStyleRes);
Winson Chung14926462014-04-14 18:57:14 -070083 setWillNotDraw(false);
Winson Chung37c8d8e2014-03-24 14:53:07 -070084 }
85
86 @Override
87 protected void onFinishInflate() {
Winson Chung14926462014-04-14 18:57:14 -070088 RecentsConfiguration config = RecentsConfiguration.getInstance();
89 mMaxDim = config.taskStackMaxDim;
90
Winson Chung5a9b0b02014-05-20 17:32:03 -070091 // By default, all views are clipped to other views in their stack
92 mClipViewInStack = true;
93
Winson Chung37c8d8e2014-03-24 14:53:07 -070094 // Bind the views
95 mThumbnailView = (TaskThumbnailView) findViewById(R.id.task_view_thumbnail);
96 mBarView = (TaskBarView) findViewById(R.id.task_view_bar);
Winson Chung9f9679d2014-04-11 16:49:09 -070097
Winson Chung37c8d8e2014-03-24 14:53:07 -070098 if (mTaskDataLoaded) {
99 onTaskDataLoaded(false);
Winson Chung303e1ff2014-03-07 15:06:19 -0800100 }
101 }
102
Winson Chung9f9679d2014-04-11 16:49:09 -0700103 @Override
Winson Chung14926462014-04-14 18:57:14 -0700104 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
105 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
106
107 // Update the rounded rect clip path
108 RecentsConfiguration config = RecentsConfiguration.getInstance();
109 float radius = config.taskViewRoundedCornerRadiusPx;
110 mRoundedRectClipPath.reset();
111 mRoundedRectClipPath.addRoundRect(new RectF(0, 0, getMeasuredWidth(), getMeasuredHeight()),
112 radius, radius, Path.Direction.CW);
Winson Chung96e3bc12014-05-06 16:44:12 -0700113
114 // Update the outline
115 Outline o = new Outline();
116 o.setRoundRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), radius);
117 setOutline(o);
Winson Chung14926462014-04-14 18:57:14 -0700118 }
119
120 @Override
Winson Chung9f9679d2014-04-11 16:49:09 -0700121 public boolean onInterceptTouchEvent(MotionEvent ev) {
122 switch (ev.getAction()) {
123 case MotionEvent.ACTION_DOWN:
124 case MotionEvent.ACTION_MOVE:
125 mLastTouchDown.set((int) ev.getX(), (int) ev.getY());
126 break;
127 }
128 return super.onInterceptTouchEvent(ev);
129 }
130
Winson Chung04dfe0d2014-03-14 14:06:29 -0700131 /** Set callback */
132 void setCallbacks(TaskViewCallbacks cb) {
Winson Chung303e1ff2014-03-07 15:06:19 -0800133 mCb = cb;
134 }
135
Winson Chung303e1ff2014-03-07 15:06:19 -0800136 /** Gets the task */
137 Task getTask() {
138 return mTask;
139 }
140
141 /** Synchronizes this view's properties with the task's transform */
Winson Chungc6a16232014-04-01 14:04:48 -0700142 void updateViewPropertiesToTaskTransform(TaskViewTransform animateFromTransform,
143 TaskViewTransform toTransform, int duration) {
Winson Chung96e3bc12014-05-06 16:44:12 -0700144 RecentsConfiguration config = RecentsConfiguration.getInstance();
145 int minZ = config.taskViewTranslationZMinPx;
146 int incZ = config.taskViewTranslationZIncrementPx;
147
Winson Chung54e297a2014-05-09 17:15:32 -0700148 // Update the bar view
149 mBarView.updateViewPropertiesToTaskTransform(animateFromTransform, toTransform, duration);
150
151 // Update this task view
Winson Chung303e1ff2014-03-07 15:06:19 -0800152 if (duration > 0) {
153 if (animateFromTransform != null) {
154 setTranslationY(animateFromTransform.translationY);
Winson Chung814086d2014-05-07 15:01:14 -0700155 if (Constants.DebugFlags.App.EnableShadows) {
156 setTranslationZ(Math.max(minZ, minZ + (animateFromTransform.t * incZ)));
157 }
Winson Chung303e1ff2014-03-07 15:06:19 -0800158 setScaleX(animateFromTransform.scale);
159 setScaleY(animateFromTransform.scale);
Winson Chungc6a16232014-04-01 14:04:48 -0700160 setAlpha(animateFromTransform.alpha);
Winson Chung303e1ff2014-03-07 15:06:19 -0800161 }
Winson Chung814086d2014-05-07 15:01:14 -0700162 if (Constants.DebugFlags.App.EnableShadows) {
163 animate().translationZ(Math.max(minZ, minZ + (toTransform.t * incZ)));
164 }
Winson Chungc6a16232014-04-01 14:04:48 -0700165 animate().translationY(toTransform.translationY)
166 .scaleX(toTransform.scale)
167 .scaleY(toTransform.scale)
168 .alpha(toTransform.alpha)
Winson Chung303e1ff2014-03-07 15:06:19 -0800169 .setDuration(duration)
Winson Chung918c0722014-05-08 15:04:23 -0700170 .setInterpolator(config.defaultBezierInterpolator)
Winson Chungc6a16232014-04-01 14:04:48 -0700171 .withLayer()
Winson Chung14926462014-04-14 18:57:14 -0700172 .setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
173 @Override
174 public void onAnimationUpdate(ValueAnimator animation) {
175 updateDimOverlayFromScale();
176 }
177 })
Winson Chung303e1ff2014-03-07 15:06:19 -0800178 .start();
179 } else {
Winson Chungc6a16232014-04-01 14:04:48 -0700180 setTranslationY(toTransform.translationY);
Winson Chung814086d2014-05-07 15:01:14 -0700181 if (Constants.DebugFlags.App.EnableShadows) {
182 setTranslationZ(Math.max(minZ, minZ + (toTransform.t * incZ)));
183 }
Winson Chungc6a16232014-04-01 14:04:48 -0700184 setScaleX(toTransform.scale);
185 setScaleY(toTransform.scale);
186 setAlpha(toTransform.alpha);
Winson Chung303e1ff2014-03-07 15:06:19 -0800187 }
Winson Chung14926462014-04-14 18:57:14 -0700188 updateDimOverlayFromScale();
189 invalidate();
Winson Chung303e1ff2014-03-07 15:06:19 -0800190 }
191
192 /** Resets this view's properties */
193 void resetViewProperties() {
194 setTranslationX(0f);
195 setTranslationY(0f);
Winson Chung814086d2014-05-07 15:01:14 -0700196 if (Constants.DebugFlags.App.EnableShadows) {
197 setTranslationZ(0f);
198 }
Winson Chung303e1ff2014-03-07 15:06:19 -0800199 setScaleX(1f);
200 setScaleY(1f);
201 setAlpha(1f);
Winson Chung14926462014-04-14 18:57:14 -0700202 invalidate();
Winson Chung303e1ff2014-03-07 15:06:19 -0800203 }
204
Winson Chung11ca76a52014-04-10 17:29:13 -0700205 /**
206 * When we are un/filtering, this method will set up the transform that we are animating to,
207 * in order to hide the task.
208 */
Winson Chungc6a16232014-04-01 14:04:48 -0700209 void prepareTaskTransformForFilterTaskHidden(TaskViewTransform toTransform) {
210 // Fade the view out and slide it away
211 toTransform.alpha = 0f;
212 toTransform.translationY += 200;
213 }
214
Winson Chung11ca76a52014-04-10 17:29:13 -0700215 /**
216 * When we are un/filtering, this method will setup the transform that we are animating from,
217 * in order to show the task.
218 */
Winson Chungc6a16232014-04-01 14:04:48 -0700219 void prepareTaskTransformForFilterTaskVisible(TaskViewTransform fromTransform) {
220 // Fade the view in
221 fromTransform.alpha = 0f;
222 }
223
Winson Chung24cf1522014-05-29 12:03:33 -0700224 /** Prepares this task view for the enter-recents animations. This is called earlier in the
225 * first layout because the actual animation into recents may take a long time. */
226 public void prepareAnimateOnEnterRecents() {
227 mBarView.setVisibility(View.INVISIBLE);
228 }
229
Winson Chung303e1ff2014-03-07 15:06:19 -0800230 /** Animates this task view as it enters recents */
231 public void animateOnEnterRecents() {
Winson Chung37c8d8e2014-03-24 14:53:07 -0700232 RecentsConfiguration config = RecentsConfiguration.getInstance();
Winson Chung24cf1522014-05-29 12:03:33 -0700233 mBarView.setVisibility(View.VISIBLE);
234 mBarView.setTranslationY(-mBarView.getMeasuredHeight());
Winson Chung37c8d8e2014-03-24 14:53:07 -0700235 mBarView.animate()
Winson Chung24cf1522014-05-29 12:03:33 -0700236 .translationY(0)
237 .setStartDelay(200)
Winson Chung918c0722014-05-08 15:04:23 -0700238 .setInterpolator(config.defaultBezierInterpolator)
Winson Chung0d767552014-04-09 14:33:23 -0700239 .setDuration(config.taskBarEnterAnimDuration)
Winson Chung37c8d8e2014-03-24 14:53:07 -0700240 .withLayer()
241 .start();
Winson Chung303e1ff2014-03-07 15:06:19 -0800242 }
243
244 /** Animates this task view as it exits recents */
245 public void animateOnLeavingRecents(final Runnable r) {
Winson Chung37c8d8e2014-03-24 14:53:07 -0700246 RecentsConfiguration config = RecentsConfiguration.getInstance();
Winson Chung37c8d8e2014-03-24 14:53:07 -0700247 mBarView.animate()
Winson Chung24cf1522014-05-29 12:03:33 -0700248 .translationY(-mBarView.getMeasuredHeight())
Winson Chung37c8d8e2014-03-24 14:53:07 -0700249 .setStartDelay(0)
Winson Chung918c0722014-05-08 15:04:23 -0700250 .setInterpolator(config.defaultBezierInterpolator)
Winson Chungf5e22e72014-05-02 18:35:35 -0700251 .setDuration(config.taskBarExitAnimDuration)
Winson Chung37c8d8e2014-03-24 14:53:07 -0700252 .withLayer()
Winson Chung0d767552014-04-09 14:33:23 -0700253 .withEndAction(new Runnable() {
254 @Override
255 public void run() {
256 post(r);
257 }
258 })
Winson Chung37c8d8e2014-03-24 14:53:07 -0700259 .start();
Winson Chung303e1ff2014-03-07 15:06:19 -0800260 }
261
Winson Chung9f49df92014-05-07 18:08:34 -0700262 /** Animates the deletion of this task view */
263 public void animateRemoval(final Runnable r) {
Winson Chung5a9b0b02014-05-20 17:32:03 -0700264 // Disabling clipping with the stack while the view is animating away
265 setClipViewInStack(false);
266
Winson Chung9f49df92014-05-07 18:08:34 -0700267 RecentsConfiguration config = RecentsConfiguration.getInstance();
268 animate().translationX(config.taskViewRemoveAnimTranslationXPx)
269 .alpha(0f)
270 .setStartDelay(0)
Winson Chung918c0722014-05-08 15:04:23 -0700271 .setInterpolator(config.defaultBezierInterpolator)
Winson Chung9f49df92014-05-07 18:08:34 -0700272 .setDuration(config.taskViewRemoveAnimDuration)
273 .withLayer()
274 .withEndAction(new Runnable() {
275 @Override
276 public void run() {
277 post(r);
Winson Chung5a9b0b02014-05-20 17:32:03 -0700278
279 // Re-enable clipping with the stack (we will reuse this view)
280 setClipViewInStack(false);
Winson Chung9f49df92014-05-07 18:08:34 -0700281 }
282 })
283 .start();
284 }
285
Winson Chung303e1ff2014-03-07 15:06:19 -0800286 /** Returns the rect we want to clip (it may not be the full rect) */
Winson Chung0d767552014-04-09 14:33:23 -0700287 Rect getClippingRect(Rect outRect) {
Winson Chung303e1ff2014-03-07 15:06:19 -0800288 getHitRect(outRect);
289 // XXX: We should get the hit rect of the thumbnail view and intersect, but this is faster
290 outRect.right = outRect.left + mThumbnailView.getRight();
291 outRect.bottom = outRect.top + mThumbnailView.getBottom();
Winson Chung303e1ff2014-03-07 15:06:19 -0800292 return outRect;
293 }
294
295 /** Enable the hw layers on this task view */
296 void enableHwLayers() {
Winson Chung303e1ff2014-03-07 15:06:19 -0800297 mThumbnailView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
298 }
299
300 /** Disable the hw layers on this task view */
301 void disableHwLayers() {
Winson Chung303e1ff2014-03-07 15:06:19 -0800302 mThumbnailView.setLayerType(View.LAYER_TYPE_NONE, null);
303 }
304
Winson Chung5a9b0b02014-05-20 17:32:03 -0700305 /**
306 * Returns whether this view should be clipped, or any views below should clip against this
307 * view.
308 */
309 boolean shouldClipViewInStack() {
310 return mClipViewInStack;
311 }
312
313 /** Sets whether this view should be clipped, or clipped against. */
314 void setClipViewInStack(boolean clip) {
315 if (clip != mClipViewInStack) {
316 mClipViewInStack = clip;
317 if (getParent() instanceof View) {
318 Rect r = new Rect();
319 getHitRect(r);
320 ((View) getParent()).invalidate(r);
321 }
322 }
323 }
324
Winson Chung14926462014-04-14 18:57:14 -0700325 /** Update the dim as a function of the scale of this view. */
326 void updateDimOverlayFromScale() {
327 float minScale = Constants.Values.TaskStackView.StackPeekMinScale;
328 float scaleRange = 1f - minScale;
329 float dim = (1f - getScaleX()) / scaleRange;
330 dim = mDimInterpolator.getInterpolation(Math.min(dim, 1f));
331 mDim = Math.max(0, Math.min(mMaxDim, (int) (dim * 255)));
Winson Chung14926462014-04-14 18:57:14 -0700332 }
333
334 @Override
335 public void draw(Canvas canvas) {
336 // Apply the rounded rect clip path on the whole view
337 canvas.clipPath(mRoundedRectClipPath);
338
339 super.draw(canvas);
340
341 // Apply the dim if necessary
342 if (mDim > 0) {
343 canvas.drawColor(mDim << 24);
344 }
345 }
346
Winson Chung1e8d71b2014-05-16 17:05:22 -0700347 /**
348 * Sets the focused task explicitly. We need a separate flag because requestFocus() won't happen
349 * if the view is not currently visible, or we are in touch state (where we still want to keep
350 * track of focus).
351 */
352 public void setFocusedTask() {
353 mIsFocused = true;
354 requestFocus();
Winson Chung47a3e652014-05-21 16:03:42 -0700355 invalidate();
356 mCb.onTaskFocused(this);
Winson Chung1e8d71b2014-05-16 17:05:22 -0700357 }
358
359 /**
360 * Updates the explicitly focused state when the view focus changes.
361 */
362 @Override
363 protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
364 super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
365 if (!gainFocus) {
366 mIsFocused = false;
Winson Chung47a3e652014-05-21 16:03:42 -0700367 invalidate();
Winson Chung1e8d71b2014-05-16 17:05:22 -0700368 }
369 }
370
371 /**
372 * Returns whether we have explicitly been focused.
373 */
374 public boolean isFocusedTask() {
375 return mIsFocused || isFocused();
376 }
377
Winson Chung4d7b0922014-03-13 17:14:17 -0700378 /**** TaskCallbacks Implementation ****/
379
Winson Chung04dfe0d2014-03-14 14:06:29 -0700380 /** Binds this task view to the task */
381 public void onTaskBound(Task t) {
382 mTask = t;
383 mTask.setCallbacks(this);
Winson Chung303e1ff2014-03-07 15:06:19 -0800384 }
385
386 @Override
Winson Chung4c71aef2014-03-21 15:15:11 -0700387 public void onTaskDataLoaded(boolean reloadingTaskData) {
Winson Chung863db8a2014-05-20 14:27:39 -0700388 if (mThumbnailView != null && mBarView != null) {
Winson Chung37c8d8e2014-03-24 14:53:07 -0700389 // Bind each of the views to the new task data
390 mThumbnailView.rebindToTask(mTask, reloadingTaskData);
391 mBarView.rebindToTask(mTask, reloadingTaskData);
Winson Chung9f9679d2014-04-11 16:49:09 -0700392 // Rebind any listeners
393 mBarView.mApplicationIcon.setOnClickListener(this);
Winson Chung54e297a2014-05-09 17:15:32 -0700394 mBarView.mDismissButton.setOnClickListener(this);
Winson Chung6cb485f2014-05-19 10:30:43 -0700395 if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
Winson Chung47a3e652014-05-21 16:03:42 -0700396 RecentsConfiguration config = RecentsConfiguration.getInstance();
397 if (config.developerOptionsEnabled) {
Winson Chung6cb485f2014-05-19 10:30:43 -0700398 mBarView.mApplicationIcon.setOnLongClickListener(this);
399 }
400 }
Winson Chung37c8d8e2014-03-24 14:53:07 -0700401 }
402 mTaskDataLoaded = true;
Winson Chung4d7b0922014-03-13 17:14:17 -0700403 }
404
405 @Override
Winson Chung04dfe0d2014-03-14 14:06:29 -0700406 public void onTaskDataUnloaded() {
Winson Chung863db8a2014-05-20 14:27:39 -0700407 if (mThumbnailView != null && mBarView != null) {
Winson Chung37c8d8e2014-03-24 14:53:07 -0700408 // Unbind each of the views from the task data and remove the task callback
409 mTask.setCallbacks(null);
410 mThumbnailView.unbindFromTask();
411 mBarView.unbindFromTask();
Winson Chung9f9679d2014-04-11 16:49:09 -0700412 // Unbind any listeners
413 mBarView.mApplicationIcon.setOnClickListener(null);
Winson Chung6cb485f2014-05-19 10:30:43 -0700414 mBarView.mDismissButton.setOnClickListener(null);
415 if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
416 mBarView.mApplicationIcon.setOnLongClickListener(null);
417 }
Winson Chung37c8d8e2014-03-24 14:53:07 -0700418 }
419 mTaskDataLoaded = false;
Winson Chung4d7b0922014-03-13 17:14:17 -0700420 }
421
422 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -0800423 public void onClick(View v) {
Winson Chung863db8a2014-05-20 14:27:39 -0700424 if (v == mBarView.mApplicationIcon) {
Winson Chung9f9679d2014-04-11 16:49:09 -0700425 mCb.onTaskIconClicked(this);
Winson Chung54e297a2014-05-09 17:15:32 -0700426 } else if (v == mBarView.mDismissButton) {
427 // Animate out the view and call the callback
428 final TaskView tv = this;
429 animateRemoval(new Runnable() {
430 @Override
431 public void run() {
432 mCb.onTaskDismissed(tv);
433 }
434 });
Winson Chung9f9679d2014-04-11 16:49:09 -0700435 }
Winson Chung303e1ff2014-03-07 15:06:19 -0800436 }
Winson Chung6cb485f2014-05-19 10:30:43 -0700437
438 @Override
439 public boolean onLongClick(View v) {
440 if (v == mBarView.mApplicationIcon) {
441 mCb.onTaskAppInfoClicked(this);
442 return true;
443 }
444 return false;
445 }
Winson Chung7bb18852014-05-20 23:25:41 +0000446}