use of com.android.quickstep.fallback.FallbackRecentsView in project Neo-Launcher by NeoApplications.
the class FallbackActivityControllerHelper method prepareRecentsUI.
@Override
public AnimationFactory prepareRecentsUI(RecentsActivity activity, boolean activityVisible, boolean animateActivity, Consumer<AnimatorPlaybackController> callback) {
if (activityVisible) {
return (transitionLength) -> {
};
}
FallbackRecentsView rv = activity.getOverviewPanel();
rv.setContentAlpha(0);
rv.getClearAllButton().setVisibilityAlpha(0);
rv.setDisallowScrollToClearAll(true);
boolean fromState = !animateActivity;
rv.setInOverviewState(fromState);
return new AnimationFactory() {
boolean isAnimatingToRecents = false;
@Override
public void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) {
isAnimatingToRecents = targets != null && targets.isAnimatingHome();
if (!isAnimatingToRecents) {
rv.setContentAlpha(1);
}
createActivityController(getSwipeUpDestinationAndLength(activity.getDeviceProfile(), activity, new Rect()));
}
@Override
public void createActivityController(long transitionLength) {
AnimatorSet animatorSet = new AnimatorSet();
if (isAnimatingToRecents) {
ObjectAnimator anim = ObjectAnimator.ofFloat(rv, CONTENT_ALPHA, 0, 1);
anim.setDuration(transitionLength).setInterpolator(LINEAR);
animatorSet.play(anim);
}
ObjectAnimator anim = ObjectAnimator.ofFloat(rv, ZOOM_PROGRESS, 1, 0);
anim.setDuration(transitionLength).setInterpolator(LINEAR);
animatorSet.play(anim);
AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(animatorSet, transitionLength);
// Since we are changing the start position of the UI, reapply the state, at the end
controller.setEndAction(() -> {
boolean endState = true;
rv.setInOverviewState(controller.getInterpolatedProgress() > 0.5 ? endState : fromState);
});
callback.accept(controller);
}
};
}
use of com.android.quickstep.fallback.FallbackRecentsView in project android_packages_apps_Launcher3 by crdroidandroid.
the class RecentsActivityTest method testRecents_showCurrentTask.
@Test
public void testRecents_showCurrentTask() {
ActivityController<RecentsActivity> controller = Robolectric.buildActivity(RecentsActivity.class);
RecentsActivity activity = controller.setup().get();
doLayout(activity);
FallbackRecentsView frv = activity.getOverviewPanel();
RunningTaskInfo placeholderTask = new RunningTaskInfo();
placeholderTask.taskId = 22;
frv.showCurrentTask(placeholderTask);
doLayout(activity);
ThumbnailData thumbnailData = new ThumbnailData();
ReflectionHelpers.setField(thumbnailData, "thumbnail", Bitmap.createBitmap(300, 500, Config.ARGB_8888));
frv.switchToScreenshot(thumbnailData, () -> {
});
ShadowLooper.idleMainLooper();
}
use of com.android.quickstep.fallback.FallbackRecentsView in project android_packages_apps_Trebuchet by LineageOS.
the class RecentsActivityTest method testRecents_showCurrentTask.
@Test
public void testRecents_showCurrentTask() {
ActivityController<RecentsActivity> controller = Robolectric.buildActivity(RecentsActivity.class);
RecentsActivity activity = controller.setup().get();
doLayout(activity);
FallbackRecentsView frv = activity.getOverviewPanel();
RunningTaskInfo dummyTask = new RunningTaskInfo();
dummyTask.taskId = 22;
frv.showCurrentTask(dummyTask);
doLayout(activity);
ThumbnailData thumbnailData = new ThumbnailData();
ReflectionHelpers.setField(thumbnailData, "thumbnail", Bitmap.createBitmap(300, 500, Config.ARGB_8888));
frv.switchToScreenshot(thumbnailData, () -> {
});
ShadowLooper.idleMainLooper();
}
Aggregations