mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Update KeyboardQuickSwitch for TAPL testing
- Added a res id to KeyboardQuickSwitchView for TAPL testing - Updated KeyboardQuickSwitch focus and scroll initialization - Logging KeyEvents for TAPL testing - Updated scrolling logic to wait for initial layout - Fixed activity leak in KeyboardQuickSwitchViewController Flag: ENABLE_KEYBOARD_QUICK_SWITCH Bug: 267520665 Test: TaplTestsKeyboardQuickSwitch Change-Id: I1d45d948c0e185504d994f7ef1d34f173c2243a9
This commit is contained in:
@@ -24,7 +24,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.AnimatorListeners;
|
||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext;
|
||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayDragLayer;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
@@ -92,27 +92,19 @@ public class KeyboardQuickSwitchViewController {
|
||||
|
||||
protected void closeQuickSwitchView(boolean animate) {
|
||||
if (mCloseAnimation != null) {
|
||||
if (animate) {
|
||||
// Let currently-running animation finish.
|
||||
return;
|
||||
} else {
|
||||
mCloseAnimation.cancel();
|
||||
// Let currently-running animation finish.
|
||||
if (!animate) {
|
||||
mCloseAnimation.end();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!animate) {
|
||||
mCloseAnimation = null;
|
||||
onCloseComplete();
|
||||
return;
|
||||
}
|
||||
mCloseAnimation = mKeyboardQuickSwitchView.getCloseAnimation();
|
||||
|
||||
mCloseAnimation.addListener(new AnimationSuccessListener() {
|
||||
@Override
|
||||
public void onAnimationSuccess(Animator animator) {
|
||||
mCloseAnimation = null;
|
||||
onCloseComplete();
|
||||
}
|
||||
});
|
||||
mCloseAnimation.addListener(AnimatorListeners.forEndCallback(this::onCloseComplete));
|
||||
mCloseAnimation.start();
|
||||
}
|
||||
|
||||
@@ -160,6 +152,7 @@ public class KeyboardQuickSwitchViewController {
|
||||
}
|
||||
|
||||
private void onCloseComplete() {
|
||||
mCloseAnimation = null;
|
||||
mOverlayContext.getDragLayer().removeView(mKeyboardQuickSwitchView);
|
||||
mControllerCallbacks.onCloseComplete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user