mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Scroll to show WidgetCell when it is tapped.
Scroll to show WidgetCell when it is tapped in a widget sheet. Otherwise, the add button may show/hide without the user seeing it if the bottom is clipped. Bug: 329861721 Test: manual- tap WidgetCell when top or bottom is scrolled out of view Flag: ACONFIG com.android.launcher3.enable_widget_tap_to_add TEAMFOOD Change-Id: Ie21730c193e845cb1c1fa447b7c0a7e719984a8f
This commit is contained in:
@@ -44,6 +44,7 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.launcher3.recyclerview.ViewHolderBinder;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
import com.android.launcher3.widget.WidgetCell;
|
||||
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
|
||||
import com.android.launcher3.widget.model.WidgetsListContentEntry;
|
||||
import com.android.launcher3.widget.model.WidgetsListHeaderEntry;
|
||||
@@ -423,6 +424,23 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHeaderTopClip(@NonNull WidgetCell cell) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void scrollCellContainerByY(WidgetCell wc, int scrollByY) {
|
||||
for (ViewParent parent = wc.getParent(); parent != null; parent = parent.getParent()) {
|
||||
if (parent instanceof ScrollView scrollView) {
|
||||
scrollView.smoothScrollBy(0, scrollByY);
|
||||
return;
|
||||
} else if (parent == this) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a listener for when the selected header gets changed in the left pane.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user