mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Allow BaseState.getTransitionDuration to read DeviceProfile am: a717d1621d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18185502 Change-Id: I3634028c5a4870e1e755a310954f630af4bbc404 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -62,7 +62,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp
|
||||
PropertyValuesHolder.ofFloat(TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED));
|
||||
mOpenCloseAnimator.setInterpolator(AGGRESSIVE_EASE);
|
||||
mOpenCloseAnimator.setDuration(
|
||||
ALL_APPS.getTransitionDuration(mContext, true /* isToState */)).start();
|
||||
ALL_APPS.getTransitionDuration(mActivityContext, true /* isToState */)).start();
|
||||
} else {
|
||||
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
||||
}
|
||||
@@ -81,7 +81,8 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp
|
||||
@Override
|
||||
protected void handleClose(boolean animate) {
|
||||
Optional.ofNullable(mOnCloseBeginListener).ifPresent(OnCloseListener::onSlideInViewClosed);
|
||||
handleClose(animate, ALL_APPS.getTransitionDuration(mContext, false /* isToState */));
|
||||
handleClose(animate,
|
||||
ALL_APPS.getTransitionDuration(mActivityContext, false /* isToState */));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
@@ -38,8 +39,11 @@ public class AllAppsState extends LauncherState {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransitionDuration(Context context, boolean isToState) {
|
||||
return isToState ? 500 : 300;
|
||||
public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
|
||||
int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
|
||||
return !context.getDeviceProfile().isTablet && isToState
|
||||
? 600
|
||||
: isToState ? 500 : 300;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4051,7 +4051,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
// TODO(194414938) starting bounds seem slightly off, investigate
|
||||
Rect firstTaskStartingBounds = new Rect();
|
||||
Rect firstTaskEndingBounds = mTempRect;
|
||||
int duration = mActivity.getStateManager().getState().getTransitionDuration(getContext(),
|
||||
int duration = mActivity.getStateManager().getState().getTransitionDuration(mActivity,
|
||||
false /* isToState */);
|
||||
PendingAnimation pendingAnimation = new PendingAnimation(duration);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.launcher3.statemanager;
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
|
||||
|
||||
/**
|
||||
* Interface representing a state of a StatefulActivity
|
||||
@@ -36,7 +37,8 @@ public interface BaseState<T extends BaseState> {
|
||||
/**
|
||||
* @return How long the animation to this state should take (or from this state to NORMAL).
|
||||
*/
|
||||
int getTransitionDuration(Context context, boolean isToState);
|
||||
<DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
|
||||
int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState);
|
||||
|
||||
/**
|
||||
* Returns the state to go back to from this state
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
@@ -39,8 +40,11 @@ public class AllAppsState extends LauncherState {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransitionDuration(Context context, boolean isToState) {
|
||||
return isToState ? 500 : 300;
|
||||
public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
|
||||
int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
|
||||
return !context.getDeviceProfile().isTablet && isToState
|
||||
? 600
|
||||
: isToState ? 500 : 300;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user