Convert TaskViewTouchController to Kotlin.
Flag the change to use the previous class. Fix: 391107339 Test: Manual. Flag: com.android.launcher3.enable_expressive_dismiss_task_motion Change-Id: Icf139fc0d6744766da548f2137597b2b020863c1
This commit is contained in:
1 parent
508112dc94
commit
b426809ced
6 files changed
+494
-84
No files matched your search
@@ -15,9 +15,15 @@
|
||||
*/
|
||||
package com.android.quickstep.fallback;
|
||||
|
||||
import static com.android.launcher3.Flags.enableExpressiveDismissTaskMotion;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.android.launcher3.statemanager.StatefulContainer;
|
||||
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewRecentsTouchContext;
|
||||
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController;
|
||||
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchControllerDeprecated;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
import com.android.quickstep.views.RecentsViewContainer;
|
||||
@@ -25,16 +31,33 @@ import com.android.quickstep.views.RecentsViewContainer;
|
||||
/**
|
||||
* Drag layer for fallback recents activity
|
||||
*/
|
||||
public class RecentsDragLayer<T extends Context & RecentsViewContainer> extends BaseDragLayer<T> {
|
||||
public class RecentsDragLayer<T extends Context & RecentsViewContainer
|
||||
& StatefulContainer<RecentsState>> extends BaseDragLayer<T> {
|
||||
|
||||
private final TaskViewRecentsTouchContext mTaskViewRecentsTouchContext =
|
||||
new TaskViewRecentsTouchContext() {
|
||||
@Override
|
||||
public boolean isRecentsInteractive() {
|
||||
return mContainer.getRootView().hasWindowFocus()
|
||||
|| mContainer.getStateManager().getState().hasLiveTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecentsModal() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public RecentsDragLayer(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 1 /* alphaChannelCount */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateControllers() {
|
||||
mControllers = new TouchController[] {
|
||||
new RecentsTaskController(mContainer),
|
||||
new FallbackNavBarTouchController(mContainer),
|
||||
};
|
||||
mControllers = new TouchController[]{
|
||||
enableExpressiveDismissTaskMotion() ? new TaskViewTouchController<>(mContainer,
|
||||
mTaskViewRecentsTouchContext) : new TaskViewTouchControllerDeprecated<>(
|
||||
mContainer, mTaskViewRecentsTouchContext),
|
||||
new FallbackNavBarTouchController(mContainer)};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user