mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
[Search][Motion] Separate AllApps scrim and content interpolation
video: https://drive.google.com/file/d/18jTh8Lc8hf-c1GBGaWERHo4QIvAHBA8J/view?usp=sharing&resourcekey=0-RDJgw-ecOW3nnF6_tWkgCg Bug: 183001675 Test: visual Change-Id: Idb177fd3e31ac41f57379ac45b80e7246c0dd156
This commit is contained in:
@@ -43,6 +43,7 @@ import com.android.launcher3.anim.PropertySetter;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.statemanager.StateManager.StateHandler;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.views.ScrimView;
|
||||
|
||||
/**
|
||||
* Handles AllApps view transition.
|
||||
@@ -70,10 +71,11 @@ public class AllAppsTransitionController
|
||||
controller.setProgress(progress);
|
||||
}
|
||||
};
|
||||
private final Launcher mLauncher;
|
||||
|
||||
private AllAppsContainerView mAppsView;
|
||||
private ScrimView mScrimView;
|
||||
|
||||
private final Launcher mLauncher;
|
||||
private boolean mIsVerticalLayout;
|
||||
|
||||
// Animation in this class is controlled by a single variable {@link mProgress}.
|
||||
@@ -121,6 +123,8 @@ public class AllAppsTransitionController
|
||||
*/
|
||||
public void setProgress(float progress) {
|
||||
mProgress = progress;
|
||||
//Note: Take inverted progress so progress=0 maps to a transparent scrim
|
||||
mScrimView.setProgress(1 - progress);
|
||||
mAppsView.setTranslationY(mProgress * mShiftRange);
|
||||
}
|
||||
|
||||
@@ -185,8 +189,12 @@ public class AllAppsTransitionController
|
||||
return AnimationSuccessListener.forRunnable(this::onProgressAnimationEnd);
|
||||
}
|
||||
|
||||
public void setupViews(AllAppsContainerView appsView) {
|
||||
/**
|
||||
* Setup views
|
||||
*/
|
||||
public void setupViews(AllAppsContainerView appsView, ScrimView scrimView) {
|
||||
mAppsView = appsView;
|
||||
mScrimView = scrimView;
|
||||
if (FeatureFlags.ENABLE_DEVICE_SEARCH.get() && Utilities.ATLEAST_R) {
|
||||
mLauncher.getSystemUiController().updateUiState(UI_STATE_ALLAPPS,
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
|
||||
Reference in New Issue
Block a user