mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-17 09:38:19 +00:00
Fix janky Alt+Tab through overview animation
Flag: not needed Fixes: 282172884 Test: used alt+tab in overview; also launched overview through keyboard quick switch view Change-Id: I3d1e54cda317ee8f8d2b2d698480cd3ca01dfc85
This commit is contained in:
@@ -5975,6 +5975,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
dispatchScrollChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldHandleRequestChildFocus() {
|
||||
// If we are already scrolling to a task view, then the focus request has already been
|
||||
// handled
|
||||
return mScroller.isFinished();
|
||||
}
|
||||
|
||||
private void dispatchScrollChanged() {
|
||||
runActionOnRemoteHandles(remoteTargetHandle ->
|
||||
remoteTargetHandle.getTaskViewSimulator().setScroll(getScrollOffset()));
|
||||
|
||||
@@ -1573,7 +1573,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
@Override
|
||||
public void requestChildFocus(View child, View focused) {
|
||||
super.requestChildFocus(child, focused);
|
||||
|
||||
if (!shouldHandleRequestChildFocus()) {
|
||||
return;
|
||||
}
|
||||
// In case the device is controlled by a controller, mCurrentPage isn't updated properly
|
||||
// which results in incorrect navigation
|
||||
int nextPage = getNextPage();
|
||||
@@ -1587,6 +1589,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldHandleRequestChildFocus() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getDestinationPage() {
|
||||
return getDestinationPage(mOrientationHandler.getPrimaryScroll(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user