use of com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent in project android_frameworks_base by ResurrectionRemix.
the class RecentsView method onBusEvent.
public final void onBusEvent(final DragEndEvent event) {
// Handle the case where we drop onto a dock region
if (event.dropTarget instanceof TaskStack.DockState) {
final TaskStack.DockState dockState = (TaskStack.DockState) event.dropTarget;
// Hide the dock region
updateVisibleDockRegions(null, false, /* isDefaultDockState */
-1, -1, false, /* animateAlpha */
false);
// We translated the view but we need to animate it back from the current layout-space
// rect to its final layout-space rect
Utilities.setViewFrameFromTranslation(event.taskView);
// Dock the task and launch it
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.startTaskInDockedMode(event.task.key.id, dockState.createMode)) {
final OnAnimationStartedListener startedListener = new OnAnimationStartedListener() {
@Override
public void onAnimationStarted() {
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
// Remove the task and don't bother relaying out, as all the tasks will be
// relaid out when the stack changes on the multiwindow change event
getStack().removeTask(event.task, null, true);
}
};
final Rect taskRect = getTaskRect(event.taskView);
IAppTransitionAnimationSpecsFuture future = mTransitionHelper.getAppTransitionFuture(new AnimationSpecComposer() {
@Override
public List<AppTransitionAnimationSpec> composeSpecs() {
return mTransitionHelper.composeDockAnimationSpec(event.taskView, taskRect);
}
});
ssp.overridePendingAppTransitionMultiThumbFuture(future, mTransitionHelper.wrapStartedListener(startedListener), true);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP, event.task.getTopComponent().flattenToShortString());
} else {
EventBus.getDefault().send(new DragEndCancelledEvent(getStack(), event.task, event.taskView));
}
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true, /* isDefaultDockState */
-1, -1, true, /* animateAlpha */
false);
}
// Show the stack action button again without changing visibility
if (mStackActionButton != null) {
mStackActionButton.animate().alpha(1f).setDuration(SHOW_STACK_ACTION_BUTTON_DURATION).setInterpolator(Interpolators.ALPHA_IN).start();
}
}
use of com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent in project platform_frameworks_base by android.
the class RecentsView method onBusEvent.
public final void onBusEvent(final DragEndEvent event) {
// Handle the case where we drop onto a dock region
if (event.dropTarget instanceof TaskStack.DockState) {
final TaskStack.DockState dockState = (TaskStack.DockState) event.dropTarget;
// Hide the dock region
updateVisibleDockRegions(null, false, /* isDefaultDockState */
-1, -1, false, /* animateAlpha */
false);
// We translated the view but we need to animate it back from the current layout-space
// rect to its final layout-space rect
Utilities.setViewFrameFromTranslation(event.taskView);
// Dock the task and launch it
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.startTaskInDockedMode(event.task.key.id, dockState.createMode)) {
final OnAnimationStartedListener startedListener = new OnAnimationStartedListener() {
@Override
public void onAnimationStarted() {
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
// Remove the task and don't bother relaying out, as all the tasks will be
// relaid out when the stack changes on the multiwindow change event
mTaskStackView.getStack().removeTask(event.task, null, true);
}
};
final Rect taskRect = getTaskRect(event.taskView);
IAppTransitionAnimationSpecsFuture future = mTransitionHelper.getAppTransitionFuture(new AnimationSpecComposer() {
@Override
public List<AppTransitionAnimationSpec> composeSpecs() {
return mTransitionHelper.composeDockAnimationSpec(event.taskView, taskRect);
}
});
ssp.overridePendingAppTransitionMultiThumbFuture(future, mTransitionHelper.wrapStartedListener(startedListener), true);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP, event.task.getTopComponent().flattenToShortString());
} else {
EventBus.getDefault().send(new DragEndCancelledEvent(mStack, event.task, event.taskView));
}
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true, /* isDefaultDockState */
-1, -1, true, /* animateAlpha */
false);
}
// Show the stack action button again without changing visibility
if (mStackActionButton != null) {
mStackActionButton.animate().alpha(1f).setDuration(SHOW_STACK_ACTION_BUTTON_DURATION).setInterpolator(Interpolators.ALPHA_IN).start();
}
}
use of com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent in project android_frameworks_base by crdroidandroid.
the class RecentsView method onBusEvent.
public final void onBusEvent(final DragEndEvent event) {
// Handle the case where we drop onto a dock region
if (event.dropTarget instanceof TaskStack.DockState) {
final TaskStack.DockState dockState = (TaskStack.DockState) event.dropTarget;
// Hide the dock region
updateVisibleDockRegions(null, false, /* isDefaultDockState */
-1, -1, false, /* animateAlpha */
false);
// We translated the view but we need to animate it back from the current layout-space
// rect to its final layout-space rect
Utilities.setViewFrameFromTranslation(event.taskView);
// Dock the task and launch it
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.startTaskInDockedMode(event.task.key.id, dockState.createMode)) {
final OnAnimationStartedListener startedListener = new OnAnimationStartedListener() {
@Override
public void onAnimationStarted() {
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
// Remove the task and don't bother relaying out, as all the tasks will be
// relaid out when the stack changes on the multiwindow change event
getStack().removeTask(event.task, null, true);
}
};
final Rect taskRect = getTaskRect(event.taskView);
IAppTransitionAnimationSpecsFuture future = mTransitionHelper.getAppTransitionFuture(new AnimationSpecComposer() {
@Override
public List<AppTransitionAnimationSpec> composeSpecs() {
return mTransitionHelper.composeDockAnimationSpec(event.taskView, taskRect);
}
});
ssp.overridePendingAppTransitionMultiThumbFuture(future, mTransitionHelper.wrapStartedListener(startedListener), true);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP, event.task.getTopComponent().flattenToShortString());
} else {
EventBus.getDefault().send(new DragEndCancelledEvent(getStack(), event.task, event.taskView));
}
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true, /* isDefaultDockState */
-1, -1, true, /* animateAlpha */
false);
}
// Show the stack action button again without changing visibility
if (mStackActionButton != null) {
mStackActionButton.animate().alpha(1f).setDuration(SHOW_STACK_ACTION_BUTTON_DURATION).setInterpolator(Interpolators.ALPHA_IN).start();
}
}
use of com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent in project android_frameworks_base by AOSPA.
the class RecentsView method onBusEvent.
public final void onBusEvent(final DragEndEvent event) {
// Handle the case where we drop onto a dock region
if (event.dropTarget instanceof TaskStack.DockState) {
final TaskStack.DockState dockState = (TaskStack.DockState) event.dropTarget;
// Hide the dock region
updateVisibleDockRegions(null, false, /* isDefaultDockState */
-1, -1, false, /* animateAlpha */
false);
// We translated the view but we need to animate it back from the current layout-space
// rect to its final layout-space rect
Utilities.setViewFrameFromTranslation(event.taskView);
// Dock the task and launch it
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.startTaskInDockedMode(event.task.key.id, dockState.createMode)) {
final OnAnimationStartedListener startedListener = new OnAnimationStartedListener() {
@Override
public void onAnimationStarted() {
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
// Remove the task and don't bother relaying out, as all the tasks will be
// relaid out when the stack changes on the multiwindow change event
getStack().removeTask(event.task, null, true);
}
};
final Rect taskRect = getTaskRect(event.taskView);
IAppTransitionAnimationSpecsFuture future = mTransitionHelper.getAppTransitionFuture(new AnimationSpecComposer() {
@Override
public List<AppTransitionAnimationSpec> composeSpecs() {
return mTransitionHelper.composeDockAnimationSpec(event.taskView, taskRect);
}
});
ssp.overridePendingAppTransitionMultiThumbFuture(future, mTransitionHelper.wrapStartedListener(startedListener), true);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP, event.task.getTopComponent().flattenToShortString());
} else {
EventBus.getDefault().send(new DragEndCancelledEvent(getStack(), event.task, event.taskView));
}
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true, /* isDefaultDockState */
-1, -1, true, /* animateAlpha */
false);
}
// Show the stack action button again without changing visibility
if (mStackActionButton != null) {
mStackActionButton.animate().alpha(1f).setDuration(SHOW_STACK_ACTION_BUTTON_DURATION).setInterpolator(Interpolators.ALPHA_IN).start();
}
}
use of com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent in project android_frameworks_base by DirtyUnicorns.
the class RecentsView method onBusEvent.
public final void onBusEvent(final DragEndEvent event) {
// Handle the case where we drop onto a dock region
if (event.dropTarget instanceof TaskStack.DockState) {
final TaskStack.DockState dockState = (TaskStack.DockState) event.dropTarget;
// Hide the dock region
updateVisibleDockRegions(null, false, /* isDefaultDockState */
-1, -1, false, /* animateAlpha */
false);
// We translated the view but we need to animate it back from the current layout-space
// rect to its final layout-space rect
Utilities.setViewFrameFromTranslation(event.taskView);
// Dock the task and launch it
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.startTaskInDockedMode(event.task.key.id, dockState.createMode)) {
final OnAnimationStartedListener startedListener = new OnAnimationStartedListener() {
@Override
public void onAnimationStarted() {
EventBus.getDefault().send(new DockedFirstAnimationFrameEvent());
// Remove the task and don't bother relaying out, as all the tasks will be
// relaid out when the stack changes on the multiwindow change event
getStack().removeTask(event.task, null, true);
}
};
final Rect taskRect = getTaskRect(event.taskView);
IAppTransitionAnimationSpecsFuture future = mTransitionHelper.getAppTransitionFuture(new AnimationSpecComposer() {
@Override
public List<AppTransitionAnimationSpec> composeSpecs() {
return mTransitionHelper.composeDockAnimationSpec(event.taskView, taskRect);
}
});
ssp.overridePendingAppTransitionMultiThumbFuture(future, mTransitionHelper.wrapStartedListener(startedListener), true);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP, event.task.getTopComponent().flattenToShortString());
} else {
EventBus.getDefault().send(new DragEndCancelledEvent(getStack(), event.task, event.taskView));
}
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true, /* isDefaultDockState */
-1, -1, true, /* animateAlpha */
false);
}
// Show the stack action button again without changing visibility
if (mStackActionButton != null) {
mStackActionButton.animate().alpha(1f).setDuration(SHOW_STACK_ACTION_BUTTON_DURATION).setInterpolator(Interpolators.ALPHA_IN).start();
}
}
Aggregations