use of com.android.launcher3.taskbar.LauncherTaskbarUIController in project android_packages_apps_Launcher3 by crdroidandroid.
the class TaskbarManager method recreateTaskbar.
private void recreateTaskbar() {
destroyExistingTaskbar();
if (!FeatureFlags.ENABLE_TASKBAR.get()) {
return;
}
if (!mUserUnlocked) {
return;
}
DeviceProfile dp = LauncherAppState.getIDP(mContext).getDeviceProfile(mContext);
if (!dp.isTaskbarPresent) {
return;
}
mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp.copy(mContext), mNavButtonController);
mTaskbarActivityContext.init();
if (mLauncher != null) {
mTaskbarActivityContext.setUIController(new LauncherTaskbarUIController(mLauncher, mTaskbarActivityContext));
}
}
use of com.android.launcher3.taskbar.LauncherTaskbarUIController in project android_packages_apps_Launcher3 by ArrowOS.
the class LauncherActivityInterface method closeOverlay.
@Override
public void closeOverlay() {
Launcher launcher = getCreatedActivity();
if (launcher == null) {
return;
}
LauncherOverlayManager om = launcher.getOverlayManager();
if (!launcher.isStarted() || launcher.isForceInvisible()) {
om.hideOverlay(false);
} else {
om.hideOverlay(150);
}
LauncherTaskbarUIController taskbarController = getTaskbarController();
if (taskbarController != null) {
taskbarController.hideEdu();
}
}
use of com.android.launcher3.taskbar.LauncherTaskbarUIController in project android_packages_apps_Launcher3 by ArrowOS.
the class QuickstepTransitionManager method getLauncherContentAnimator.
/**
* Content is everything on screen except the background and the floating view (if any).
*
* @param isAppOpening True when this is called when an app is opening.
* False when this is called when an app is closing.
* @param startDelay Start delay duration.
* @param skipAllAppsScale True if we want to avoid scaling All Apps
*/
private Pair<AnimatorSet, Runnable> getLauncherContentAnimator(boolean isAppOpening, int startDelay, boolean skipAllAppsScale) {
AnimatorSet launcherAnimator = new AnimatorSet();
Runnable endListener;
float[] alphas = isAppOpening ? new float[] { 1, 0 } : new float[] { 0, 1 };
float[] scales = isAppOpening ? new float[] { 1, mContentScale } : new float[] { mContentScale, 1 };
if (mLauncher.isInState(ALL_APPS)) {
// All Apps in portrait mode is full screen, so we only animate AllAppsContainerView.
final View appsView = mLauncher.getAppsView();
final float startAlpha = appsView.getAlpha();
final float startScale = SCALE_PROPERTY.get(appsView);
appsView.setAlpha(alphas[0]);
ObjectAnimator alpha = ObjectAnimator.ofFloat(appsView, View.ALPHA, alphas);
alpha.setDuration(CONTENT_ALPHA_DURATION);
alpha.setInterpolator(LINEAR);
appsView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
alpha.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
appsView.setLayerType(View.LAYER_TYPE_NONE, null);
}
});
if (!skipAllAppsScale) {
SCALE_PROPERTY.set(appsView, scales[0]);
ObjectAnimator scale = ObjectAnimator.ofFloat(appsView, SCALE_PROPERTY, scales);
scale.setInterpolator(AGGRESSIVE_EASE);
scale.setDuration(CONTENT_SCALE_DURATION);
launcherAnimator.play(scale);
}
launcherAnimator.play(alpha);
endListener = () -> {
appsView.setAlpha(startAlpha);
SCALE_PROPERTY.set(appsView, startScale);
appsView.setLayerType(View.LAYER_TYPE_NONE, null);
};
} else if (mLauncher.isInState(OVERVIEW)) {
endListener = composeViewContentAnimator(launcherAnimator, alphas, scales);
} else {
List<View> viewsToAnimate = new ArrayList<>();
Workspace workspace = mLauncher.getWorkspace();
workspace.forEachVisiblePage(view -> viewsToAnimate.add(((CellLayout) view).getShortcutsAndWidgets()));
viewsToAnimate.add(mLauncher.getHotseat());
viewsToAnimate.forEach(view -> {
view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(view, SCALE_PROPERTY, scales).setDuration(CONTENT_SCALE_DURATION);
scaleAnim.setInterpolator(DEACCEL_1_5);
launcherAnimator.play(scaleAnim);
});
final boolean scrimEnabled = ENABLE_SCRIM_FOR_APP_LAUNCH.get();
if (scrimEnabled) {
boolean useTaskbarColor = mDeviceProfile.isTaskbarPresentInApps;
int scrimColor = useTaskbarColor ? mLauncher.getResources().getColor(R.color.taskbar_background) : Themes.getAttrColor(mLauncher, R.attr.overviewScrimColor);
int scrimColorTrans = ColorUtils.setAlphaComponent(scrimColor, 0);
int[] colors = isAppOpening ? new int[] { scrimColorTrans, scrimColor } : new int[] { scrimColor, scrimColorTrans };
ScrimView scrimView = mLauncher.getScrimView();
if (scrimView.getBackground() instanceof ColorDrawable) {
scrimView.setBackgroundColor(colors[0]);
ObjectAnimator scrim = ObjectAnimator.ofArgb(scrimView, VIEW_BACKGROUND_COLOR, colors);
scrim.setDuration(CONTENT_SCRIM_DURATION);
scrim.setInterpolator(DEACCEL_1_5);
if (useTaskbarColor) {
// Hide the taskbar background color since it would duplicate the scrim.
scrim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
LauncherTaskbarUIController taskbarUIController = mLauncher.getTaskbarUIController();
if (taskbarUIController != null) {
taskbarUIController.forceHideBackground(true);
}
}
@Override
public void onAnimationEnd(Animator animation) {
LauncherTaskbarUIController taskbarUIController = mLauncher.getTaskbarUIController();
if (taskbarUIController != null) {
taskbarUIController.forceHideBackground(false);
}
}
});
}
launcherAnimator.play(scrim);
}
}
// Pause page indicator animations as they lead to layer trashing.
mLauncher.getWorkspace().getPageIndicator().pauseAnimations();
endListener = () -> {
viewsToAnimate.forEach(view -> {
SCALE_PROPERTY.set(view, 1f);
view.setLayerType(View.LAYER_TYPE_NONE, null);
});
if (scrimEnabled) {
mLauncher.getScrimView().setBackgroundColor(Color.TRANSPARENT);
}
mLauncher.getWorkspace().getPageIndicator().skipAnimationsToEnd();
};
}
launcherAnimator.setStartDelay(startDelay);
return new Pair<>(launcherAnimator, endListener);
}
use of com.android.launcher3.taskbar.LauncherTaskbarUIController in project android_packages_apps_Launcher3 by ProtonAOSP.
the class LauncherActivityInterface method getParallelAnimationToLauncher.
@Override
@Nullable
public Animator getParallelAnimationToLauncher(GestureEndTarget endTarget, long duration, RecentsAnimationCallbacks callbacks) {
LauncherTaskbarUIController uiController = getTaskbarController();
Animator superAnimator = super.getParallelAnimationToLauncher(endTarget, duration, callbacks);
if (uiController == null || callbacks == null) {
return superAnimator;
}
LauncherState toState = stateFromGestureEndTarget(endTarget);
Animator taskbarAnimator = uiController.createAnimToLauncher(toState, callbacks, duration);
if (superAnimator == null) {
return taskbarAnimator;
} else {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(superAnimator, taskbarAnimator);
return animatorSet;
}
}
use of com.android.launcher3.taskbar.LauncherTaskbarUIController in project android_packages_apps_Launcher3 by ProtonAOSP.
the class LauncherActivityInterface method closeOverlay.
@Override
public void closeOverlay() {
Launcher launcher = getCreatedActivity();
if (launcher == null) {
return;
}
LauncherOverlayManager om = launcher.getOverlayManager();
if (!launcher.isStarted() || launcher.isForceInvisible()) {
om.hideOverlay(false);
} else {
om.hideOverlay(150);
}
LauncherTaskbarUIController taskbarController = getTaskbarController();
if (taskbarController != null) {
taskbarController.hideEdu();
}
}
Aggregations