mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Merge changes from topic "taskbar-search-ime" into udc-qpr-dev am: c4247d85b4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24247103 Change-Id: Ib4c1aa6932ec5d76b84079e20cf38ec50f6367b1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.window.OnBackInvokedDispatcher;
|
||||
|
||||
@@ -30,6 +31,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Insettable;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.anim.AnimatorListeners;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsViewController.TaskbarAllAppsCallbacks;
|
||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext;
|
||||
@@ -64,19 +66,45 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
||||
}
|
||||
mIsOpen = true;
|
||||
attachToContainer();
|
||||
mAllAppsCallbacks.onAllAppsTransitionStart(true);
|
||||
|
||||
if (animate) {
|
||||
setUpOpenAnimation(mAllAppsCallbacks.getOpenDuration());
|
||||
Animator animator = mOpenCloseAnimation.getAnimationPlayer();
|
||||
animator.setInterpolator(EMPHASIZED);
|
||||
animator.addListener(AnimatorListeners.forEndCallback(
|
||||
() -> mAllAppsCallbacks.onAllAppsTransitionEnd(true)));
|
||||
animator.start();
|
||||
} else {
|
||||
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
||||
addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
|
||||
@Override
|
||||
public void onViewAttachedToWindow(View v) {
|
||||
removeOnAttachStateChangeListener(this);
|
||||
// Wait for view and its descendants to be fully attached before starting open.
|
||||
post(() -> showOnFullyAttachedToWindow(animate));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(View v) {
|
||||
removeOnAttachStateChangeListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showOnFullyAttachedToWindow(boolean animate) {
|
||||
mAllAppsCallbacks.onAllAppsTransitionStart(true);
|
||||
if (!animate) {
|
||||
mAllAppsCallbacks.onAllAppsTransitionEnd(true);
|
||||
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
||||
return;
|
||||
}
|
||||
|
||||
setUpOpenAnimation(mAllAppsCallbacks.getOpenDuration());
|
||||
Animator animator = mOpenCloseAnimation.getAnimationPlayer();
|
||||
animator.setInterpolator(EMPHASIZED);
|
||||
animator.addListener(AnimatorListeners.forEndCallback(() -> {
|
||||
if (mIsOpen) {
|
||||
mAllAppsCallbacks.onAllAppsTransitionEnd(true);
|
||||
}
|
||||
}));
|
||||
animator.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOpenCloseAnimationPending(PendingAnimation animation) {
|
||||
mAllAppsCallbacks.onAllAppsAnimationPending(
|
||||
animation, mToTranslationShift == TRANSLATION_SHIFT_OPENED);
|
||||
}
|
||||
|
||||
/** The apps container inside this view. */
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.allapps.AllAppsTransitionListener;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.appprediction.AppsDividerView;
|
||||
import com.android.launcher3.taskbar.NavbarButtonsViewController;
|
||||
import com.android.launcher3.taskbar.TaskbarControllers;
|
||||
@@ -125,5 +126,9 @@ final class TaskbarAllAppsViewController {
|
||||
boolean handleSearchBackInvoked() {
|
||||
return mSearchSessionController.handleBackInvoked();
|
||||
}
|
||||
|
||||
void onAllAppsAnimationPending(PendingAnimation animation, boolean toAllApps) {
|
||||
mSearchSessionController.onAllAppsAnimationPending(animation, toAllApps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.content.Context
|
||||
import android.view.View
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.allapps.AllAppsTransitionListener
|
||||
import com.android.launcher3.anim.PendingAnimation
|
||||
import com.android.launcher3.config.FeatureFlags
|
||||
import com.android.launcher3.dragndrop.DragOptions.PreDragCondition
|
||||
import com.android.launcher3.model.data.ItemInfo
|
||||
@@ -50,6 +51,8 @@ open class TaskbarSearchSessionController : ResourceBasedOverride, AllAppsTransi
|
||||
|
||||
open fun handleBackInvoked(): Boolean = false
|
||||
|
||||
open fun onAllAppsAnimationPending(animation: PendingAnimation, toAllApps: Boolean) = Unit
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(context: Context): TaskbarSearchSessionController {
|
||||
|
||||
Reference in New Issue
Block a user