public static final String AnsiWhite = "\u001B[37m";
// Console enabled state
- public static final boolean Enabled = false;
+ public static boolean Enabled = false;
/** Logs a key */
public static void log(String key) {
public static final String TimeRecentsStartupKey = "startup";
public static final String TimeRecentsLaunchKey = "launchTask";
public static final String TimeRecentsScreenshotTransitionKey = "screenshot";
- public static final boolean TimeRecentsStartup = true;
- public static final boolean TimeRecentsLaunchTask = true;
- public static final boolean TimeRecentsScreenshotTransition = true;
+ public static final boolean TimeRecentsStartup = false;
+ public static final boolean TimeRecentsLaunchTask = false;
+ public static final boolean TimeRecentsScreenshotTransition = false;
public static final boolean RecentsComponent = false;
AppWidgetHostView mSearchAppWidgetHostView;
boolean mVisible;
- boolean mTaskLaunched;
// Runnables to finish the Recents activity
FinishRecentsRunnable mFinishRunnable = new FinishRecentsRunnable(true);
AlternateRecentsComponent.EXTRA_TRIGGERED_FROM_ALT_TAB, false);
mConfig.launchedWithNoRecentTasks = !root.hasTasks();
- // Show the scrim if we animate into Recents without window transitions
- mScrimViews.prepareEnterRecentsAnimation();
-
// Add the default no-recents layout
if (mEmptyView == null) {
mEmptyView = mEmptyViewStub.inflate();
} else {
mEmptyView.setVisibility(View.GONE);
}
+
+ // Show the scrim if we animate into Recents without window transitions
+ mScrimViews.prepareEnterRecentsAnimation();
}
/** Attempts to allocate and bind the search bar app widget */
// Update the recent tasks
updateRecentsTasks(getIntent());
- // Prepare the screenshot transition if necessary
- if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
- mFullScreenOverlayView = (FullscreenTransitionOverlayView) mFullscreenOverlayStub.inflate();
- mFullScreenOverlayView.setCallbacks(this);
- mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
- }
-
// Bind the search app widget when we first start up
bindSearchBarAppWidget();
// Add the search bar layout
} catch (InvocationTargetException e) {
e.printStackTrace();
}
+
+ // Prepare the screenshot transition if necessary
+ if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
+ mFullScreenOverlayView = (FullscreenTransitionOverlayView) mFullscreenOverlayStub.inflate();
+ mFullScreenOverlayView.setCallbacks(this);
+ mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
+ }
}
void onConfigurationChange() {
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
- // Reset the task launched flag if we encounter an onNewIntent() before onStop()
- mTaskLaunched = false;
if (Console.Enabled) {
Console.logDivider(Constants.Log.App.SystemUIHandshake);
if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
}
-
- // Don't attempt to rebind the search bar widget, but just add the search bar layout
- addSearchBarAppWidgetView();
}
@Override
}
mVisible = false;
- mTaskLaunched = false;
}
@Override
}
@Override
- public void onTaskLaunching() {
- mTaskLaunched = true;
-
+ public void onTaskViewClicked() {
// Mark recents as no longer visible
AlternateRecentsComponent.notifyVisibilityChanged(false);
}
@Override
- public void onLastTaskRemoved() {
+ public void onAllTaskViewsDismissed() {
mFinishLaunchHomeRunnable.run();
}
// Debug mode
debugModeEnabled = settings.getBoolean(Constants.Values.App.Key_DebugModeEnabled, false);
+ if (debugModeEnabled) {
+ Console.Enabled = true;
+ }
// Animations
animationPxMovementPerSecond =
// since that is done when we compute the animation itself in the Recents component
// Create a dummy task stack & compute the rect for the thumbnail to animate to
- TaskStack stack = new TaskStack(context);
+ TaskStack stack = new TaskStack();
TaskStackView tsv = new TaskStackView(context, stack);
TaskStackViewLayoutAlgorithm algo = tsv.getStackAlgorithm();
Bundle replyData = new Bundle();
}
thumbnail.setHasAlpha(false);
loadThumbnail = thumbnail;
- mThumbnailCache.put(t.key, thumbnail);
} else {
loadThumbnail = mDefaultThumbnail;
Console.logError(mContext,
"Failed to load task top thumbnail for: " +
t.key.baseIntent.getComponent().getPackageName());
}
+ // We put the default thumbnail in the cache anyways
+ mThumbnailCache.put(t.key, loadThumbnail);
}
}
if (!mCancelled) {
" iconCache: " + iconCacheSize);
}
+ // Create the default assets
+ Bitmap icon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
+ icon.eraseColor(0x00000000);
+ mDefaultThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
+ mDefaultThumbnail.setHasAlpha(false);
+ mDefaultThumbnail.eraseColor(0xFFffffff);
+ mLoadingThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
+ mLoadingThumbnail.setHasAlpha(false);
+ mLoadingThumbnail.eraseColor(0xFFffffff);
+ mDefaultApplicationIcon = new BitmapDrawable(context.getResources(), icon);
+
// Initialize the proxy, cache and loaders
mSystemServicesProxy = new SystemServicesProxy(context);
mPackageMonitor = new RecentsPackageMonitor();
mLoader = new TaskResourceLoader(mLoadQueue, mApplicationIconCache, mThumbnailCache,
mDefaultThumbnail);
- // Create the default assets
- Bitmap icon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
- icon.eraseColor(0x00000000);
- mDefaultThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
- mDefaultThumbnail.eraseColor(0xFFffffff);
- mLoadingThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
- mLoadingThumbnail.eraseColor(0x00000000);
- mDefaultApplicationIcon = new BitmapDrawable(context.getResources(), icon);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|defaultBitmaps]",
RecentsConfiguration config = RecentsConfiguration.getInstance();
Resources res = context.getResources();
ArrayList<Task> tasksToForceLoad = new ArrayList<Task>();
- TaskStack stack = new TaskStack(context);
+ TaskStack stack = new TaskStack();
SpaceNode root = new SpaceNode(context);
root.setStack(stack);
activityLabel = (av.getLabel() != null ? av.getLabel() : ssp.getActivityLabel(info));
activityIcon = (av.getIcon() != null) ?
ssp.getBadgedIcon(new BitmapDrawable(res, av.getIcon()), t.userId) : null;
- activityColor = av.getPrimaryColor();
+ if (av.getPrimaryColor() != 0) {
+ activityColor = av.getPrimaryColor();
+ }
} else {
activityLabel = ssp.getActivityLabel(info);
}
task.thumbnail = ssp.getTaskThumbnail(task.key.id);
if (task.thumbnail != null) {
task.thumbnail.setHasAlpha(false);
- mThumbnailCache.put(task.key, task.thumbnail);
} else {
task.thumbnail = mDefaultThumbnail;
}
+ mThumbnailCache.put(task.key, task.thumbnail);
} else {
// Either the task has updated, or we haven't cached any information for the
// task, so reload it
public void onStackUnfiltered(TaskStack newStack, ArrayList<Task> curTasks);
}
- Context mContext;
-
FilteredTaskList mTaskList = new FilteredTaskList();
TaskStackCallbacks mCb;
- public TaskStack(Context context) {
- mContext = context;
+ public TaskStack() {
}
/** Sets the callbacks for this task stack */
/** The RecentsView callbacks */
public interface RecentsViewCallbacks {
- public void onTaskLaunching();
- public void onLastTaskRemoved();
+ public void onTaskViewClicked();
+ public void onAllTaskViewsDismissed();
public void onExitToHomeAnimationTriggered();
}
public void setBSP(SpaceNode n) {
mBSP = n;
+ // Remove all TaskStackViews (but leave the search bar)
+ int childCount = getChildCount();
+ for (int i = childCount - 1; i >= 0; i--) {
+ View v = getChildAt(i);
+ if (v != mSearchBar) {
+ removeViewAt(i);
+ }
+ }
+
// Create and add all the stacks for this partition of space.
mHasTasks = false;
- removeAllViews();
ArrayList<TaskStack> stacks = mBSP.getStacks();
for (TaskStack stack : stacks) {
TaskStackView stackView = new TaskStackView(getContext(), stack);
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
TaskStack stack = stackView.mStack;
// Iterate the stack views and try and find the focused task
Console.log(Constants.Log.UI.Focus, "[RecentsView|launchFocusedTask]",
"Found focused Task");
}
- onTaskLaunched(stackView, tv, stack, task);
+ onTaskViewClicked(stackView, tv, stack, task);
return true;
}
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
TaskStack stack = stackView.mStack;
ArrayList<Task> tasks = stack.getTasks();
tv = stv;
}
}
- onTaskLaunched(stackView, tv, stack, task);
+ onTaskViewClicked(stackView, tv, stack, task);
return true;
}
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
stackView.startEnterRecentsAnimation(ctx);
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
stackView.startExitToHomeAnimation(ctx);
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView && child.getVisibility() != GONE) {
+ if (child != mSearchBar && child.getVisibility() != GONE) {
child.measure(MeasureSpec.makeMeasureSpec(childWidth, widthMode),
MeasureSpec.makeMeasureSpec(childHeight, heightMode));
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView && child.getVisibility() != GONE) {
+ if (child != mSearchBar && child.getVisibility() != GONE) {
TaskStackView tsv = (TaskStackView) child;
child.layout(left, top, left + tsv.getMeasuredWidth(), top + tsv.getMeasuredHeight());
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
stackView = (TaskStackView) child;
stackView.onUserInteraction();
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
stackView = (TaskStackView) child;
break;
}
/**** TaskStackView.TaskStackCallbacks Implementation ****/
@Override
- public void onTaskLaunched(final TaskStackView stackView, final TaskView tv,
- final TaskStack stack, final Task task) {
+ public void onTaskViewClicked(final TaskStackView stackView, final TaskView tv,
+ final TaskStack stack, final Task task) {
// Notify any callbacks of the launching of a new task
if (mCb != null) {
- mCb.onTaskLaunching();
+ mCb.onTaskViewClicked();
}
// Upfront the processing of the thumbnail
}
// And clean up the old task
- onTaskRemoved(task);
+ onTaskViewDismissed(task);
}
if (Console.Enabled) {
}
@Override
- public void onTaskAppInfoLaunched(Task t) {
+ public void onTaskViewAppInfoClicked(Task t) {
// Create a new task stack with the application info details activity
Intent baseIntent = t.key.baseIntent;
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
}
@Override
- public void onTaskRemoved(Task t) {
+ public void onTaskViewDismissed(Task t) {
// Remove any stored data from the loader. We currently don't bother notifying the views
- // that the data has been unloaded because at the point we call onTaskRemoved(), the views
+ // that the data has been unloaded because at the point we call onTaskViewDismissed(), the views
// either don't need to be updated, or have already been removed.
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
loader.deleteTaskData(t, false);
}
@Override
- public void onLastTaskRemoved() {
- mCb.onLastTaskRemoved();
+ public void onAllTaskViewsDismissed() {
+ mCb.onAllTaskViewsDismissed();
}
@Override
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
- if (child instanceof TaskStackView) {
+ if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
stackView.onComponentRemoved(cns);
}
public boolean onTouchEvent(MotionEvent event) {
// We ignore taps on the task bar except on the filter and dismiss buttons
if (!Constants.DebugFlags.App.EnableTaskBarTouchEvents) return true;
- if (mConfig.debugModeEnabled) return true;
return super.onTouchEvent(event);
}
/** The TaskView callbacks */
interface TaskStackViewCallbacks {
- public void onTaskLaunched(TaskStackView stackView, TaskView tv, TaskStack stack, Task t);
- public void onTaskAppInfoLaunched(Task t);
- public void onTaskRemoved(Task t);
- public void onLastTaskRemoved();
+ public void onTaskViewClicked(TaskStackView stackView, TaskView tv, TaskStack stack, Task t);
+ public void onTaskViewAppInfoClicked(Task t);
+ public void onTaskViewDismissed(Task t);
+ public void onAllTaskViewsDismissed();
public void onTaskStackFilterTriggered();
public void onTaskStackUnfilterTriggered();
}
TaskStackViewTouchHandler mTouchHandler;
TaskStackViewCallbacks mCb;
ViewPool<TaskView, Task> mViewPool;
- ArrayList<TaskViewTransform> mTaskTransforms = new ArrayList<TaskViewTransform>();
+ ArrayList<TaskViewTransform> mCurrentTaskTransforms = new ArrayList<TaskViewTransform>();
DozeTrigger mUIDozeTrigger;
// The virtual stack scroll that we use for the card layout
int stackScroll,
int[] visibleRangeOut,
boolean boundTranslationsToRect) {
- // XXX: Optimization: Use binary search to find the visible range
+ // XXX: We should be intelligent about where to look for the visible stack range using the
+ // current stack scroll.
int taskTransformCount = taskTransforms.size();
int taskCount = tasks.size();
- int firstVisibleIndex = -1;
- int lastVisibleIndex = -1;
+ int frontMostVisibleIndex = -1;
+ int backMostVisibleIndex = -1;
// We can reuse the task transforms where possible to reduce object allocation
if (taskTransformCount < taskCount) {
}
// Update the stack transforms
- for (int i = 0; i < taskCount; i++) {
+ for (int i = taskCount - 1; i >= 0; i--) {
TaskViewTransform transform = mStackAlgorithm.getStackTransform(i, stackScroll,
taskTransforms.get(i));
if (transform.visible) {
- if (firstVisibleIndex < 0) {
- firstVisibleIndex = i;
+ if (frontMostVisibleIndex < 0) {
+ frontMostVisibleIndex = i;
+ }
+ backMostVisibleIndex = i;
+ } else {
+ if (backMostVisibleIndex != -1) {
+ // We've reached the end of the visible range, so going down the rest of the
+ // stack, we can just reset the transforms accordingly
+ while (i >= 0) {
+ taskTransforms.get(i).reset();
+ i--;
+ }
+ break;
}
- lastVisibleIndex = i;
}
if (boundTranslationsToRect) {
}
}
if (visibleRangeOut != null) {
- visibleRangeOut[0] = firstVisibleIndex;
- visibleRangeOut[1] = lastVisibleIndex;
+ visibleRangeOut[0] = frontMostVisibleIndex;
+ visibleRangeOut[1] = backMostVisibleIndex;
}
}
int[] visibleRange = mTmpVisibleRange;
int stackScroll = getStackScroll();
ArrayList<Task> tasks = mStack.getTasks();
- updateStackTransforms(mTaskTransforms, tasks, stackScroll, visibleRange, false);
+ updateStackTransforms(mCurrentTaskTransforms, tasks, stackScroll, visibleRange, false);
// Update the visible state of all the tasks
int taskCount = tasks.size();
for (int i = 0; i < taskCount; i++) {
Task task = tasks.get(i);
- TaskViewTransform transform = mTaskTransforms.get(i);
+ TaskViewTransform transform = mCurrentTaskTransforms.get(i);
TaskView tv = getChildViewForTask(task);
if (transform.visible) {
// When we are picking up a new view from the view pool, prepare it for any
// following animation by putting it in a reasonable place
if (mStackViewsAnimationDuration > 0 && i != 0) {
- int fromIndex = (transform.t < 0) ? (visibleRange[0] - 1) :
- (visibleRange[1] + 1);
+ int fromIndex = (transform.t < 0) ?
+ Math.max(0, (visibleRange[1] - 1)) :
+ Math.min(taskCount - 1, (visibleRange[0] + 1));
tv.updateViewPropertiesToTaskTransform(
mStackAlgorithm.getStackTransform(fromIndex, stackScroll), 0);
}
TaskView tv = (TaskView) getChildAt(i);
Task task = tv.getTask();
int taskIndex = mStack.indexOfTask(task);
- if (taskIndex < 0 || !mTaskTransforms.get(taskIndex).visible) {
+ if (taskIndex < 0 || !mCurrentTaskTransforms.get(taskIndex).visible) {
mViewPool.returnViewToPool(tv);
} else {
- tv.updateViewPropertiesToTaskTransform(mTaskTransforms.get(taskIndex),
+ tv.updateViewPropertiesToTaskTransform(mCurrentTaskTransforms.get(taskIndex),
mStackViewsAnimationDuration);
}
}
if (mConfig.launchedWithAltTab) {
// When alt-tabbing, we focus the next previous task
focusTask(Math.max(0, mStack.getTaskCount() - 2), false);
- } else {
- // Normally we just focus the front task
- focusTask(Math.max(0, mStack.getTaskCount() - 1), false);
}
}
}
}
// Notify the callback that we've removed the task and it can clean up after it
- mCb.onTaskRemoved(t);
+ mCb.onTaskViewDismissed(t);
// Update the min/max scroll and animate other task views into their new positions
updateMinMaxScroll(true);
shouldFinishActivity = (mStack.getTaskCount() == 0);
}
if (shouldFinishActivity) {
- mCb.onLastTaskRemoved();
+ mCb.onAllTaskViewsDismissed();
}
}
}
/**** TaskViewCallbacks Implementation ****/
@Override
- public void onTaskIconClicked(TaskView tv) {
+ public void onTaskViewAppIconClicked(TaskView tv) {
if (Console.Enabled) {
Console.log(Constants.Log.UI.ClickEvents, "[TaskStack|Clicked|Icon]",
tv.getTask() + " is currently filtered: " + mStack.hasFilteredTasks(),
}
@Override
- public void onTaskAppInfoClicked(TaskView tv) {
+ public void onTaskViewAppInfoClicked(TaskView tv) {
if (mCb != null) {
- mCb.onTaskAppInfoLaunched(tv.getTask());
+ mCb.onTaskViewAppInfoClicked(tv.getTask());
}
}
@Override
- public void onTaskFocused(TaskView tv) {
- // Do nothing
- }
-
- @Override
- public void onTaskDismissed(TaskView tv) {
+ public void onTaskViewDismissed(TaskView tv) {
Task task = tv.getTask();
// Remove the task from the view
mStack.removeTask(task);
mUIDozeTrigger.stopDozing();
if (mCb != null) {
- mCb.onTaskLaunched(this, tv, mStack, task);
+ mCb.onTaskViewClicked(this, tv, mStack, task);
}
}
// Re-enable clipping with the stack (we will reuse this view)
tv.setClipViewInStack(true);
// Remove the task view from the stack
- mSv.onTaskDismissed(tv);
+ mSv.onTaskViewDismissed(tv);
}
@Override
public void onSnapBackCompleted(View v) {
- onDragCancelled(v);
- }
-
- @Override
- public void onDragCancelled(View v) {
TaskView tv = (TaskView) v;
// Disable HW layers on that task
if (mSv.mHwLayersTrigger.getCount() == 0) {
// Re-enable touch events from this task view
mSv.setTouchOnTaskView(tv, true);
}
+
+ @Override
+ public void onDragCancelled(View v) {
+ // Do nothing
+ }
}
View.OnLongClickListener {
/** The TaskView callbacks */
interface TaskViewCallbacks {
- public void onTaskIconClicked(TaskView tv);
- public void onTaskAppInfoClicked(TaskView tv);
- public void onTaskFocused(TaskView tv);
- public void onTaskDismissed(TaskView tv);
+ public void onTaskViewAppIconClicked(TaskView tv);
+ public void onTaskViewAppInfoClicked(TaskView tv);
+ public void onTaskViewDismissed(TaskView tv);
}
RecentsConfiguration mConfig;
boolean mTaskDataLoaded;
boolean mIsFocused;
boolean mClipViewInStack;
- Point mLastTouchDown = new Point();
- Path mRoundedRectClipPath = new Path();
Rect mTmpRect = new Rect();
Paint mLayerPaint = new Paint();
super(context, attrs, defStyleAttr, defStyleRes);
mConfig = RecentsConfiguration.getInstance();
setWillNotDraw(false);
+ setClipToOutline(true);
setDim(getDim());
}
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- // Update the rounded rect clip path
- float radius = mConfig.taskViewRoundedCornerRadiusPx;
- mRoundedRectClipPath.reset();
- mRoundedRectClipPath.addRoundRect(new RectF(0, 0, getMeasuredWidth(), getMeasuredHeight()),
- radius, radius, Path.Direction.CW);
-
// Update the outline
Outline o = new Outline();
o.setRoundRect(0, 0, getMeasuredWidth(), getMeasuredHeight() -
- mConfig.taskViewShadowOutlineBottomInsetPx, radius);
+ mConfig.taskViewShadowOutlineBottomInsetPx, mConfig.taskViewRoundedCornerRadiusPx);
setOutline(o);
}
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- switch (ev.getAction()) {
- case MotionEvent.ACTION_DOWN:
- case MotionEvent.ACTION_MOVE:
- mLastTouchDown.set((int) ev.getX(), (int) ev.getY());
- break;
- }
- return super.onInterceptTouchEvent(ev);
- }
-
/** Set callback */
void setCallbacks(TaskViewCallbacks cb) {
mCb = cb;
} else if (mConfig.launchedFromHome) {
// Move the task view off screen (below) so we can animate it in
setTranslationY(offscreenY);
- setTranslationZ(0);
+ if (Constants.DebugFlags.App.EnableShadows) {
+ setTranslationZ(0);
+ }
setScaleX(1f);
setScaleY(1f);
}
int frontIndex = (ctx.stackViewCount - ctx.stackViewIndex - 1);
int delay = mConfig.taskBarEnterAnimDelay +
frontIndex * mConfig.taskViewEnterFromHomeDelay;
+ if (Constants.DebugFlags.App.EnableShadows) {
+ animate().translationZ(transform.translationZ);
+ }
animate()
.scaleX(transform.scale)
.scaleY(transform.scale)
.translationY(transform.translationY)
- .translationZ(transform.translationZ)
.setStartDelay(delay)
.setUpdateListener(null)
.setInterpolator(mConfig.quintOutInterpolator)
})
.start();
ctx.postAnimationTrigger.increment();
+ } else {
+ // Otherwise, just enable the thumbnail clip
+ mEnableThumbnailClip.run();
}
}
@Override
public void draw(Canvas canvas) {
- int restoreCount = canvas.save(Canvas.CLIP_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG);
- // Apply the rounded rect clip path on the whole view
- canvas.clipPath(mRoundedRectClipPath);
super.draw(canvas);
- canvas.restoreToCount(restoreCount);
// Apply the dim if necessary
if (mDim > 0) {
requestFocus();
setFocusableInTouchMode(false);
invalidate();
- mCb.onTaskFocused(this);
}
/**
@Override
public void run() {
if (v == mBarView.mApplicationIcon) {
- mCb.onTaskIconClicked(tv);
+ mCb.onTaskViewAppIconClicked(tv);
} else if (v == mBarView.mDismissButton) {
// Animate out the view and call the callback
startDeleteTaskAnimation(new Runnable() {
@Override
public void run() {
- mCb.onTaskDismissed(tv);
+ mCb.onTaskViewDismissed(tv);
}
});
}
@Override
public boolean onLongClick(View v) {
if (v == mBarView.mApplicationIcon) {
- mCb.onTaskAppInfoClicked(this);
+ mCb.onTaskViewAppInfoClicked(this);
return true;
}
return false;