Exposing some private methods to easily customize widgets popup

Change-Id: Ie7bd879200b1f14d472ff03fd64429930651a39f
This commit is contained in:
Sunny Goyal
2018-07-13 11:03:04 -07:00
parent 0b74a7fe5e
commit db6cdb07e8
7 changed files with 29 additions and 19 deletions

View File

@@ -71,7 +71,7 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
}
@Override
public final boolean onLongClick(View v) {
public boolean onLongClick(View v) {
if (!ItemLongClickListener.canStartDrag(mLauncher)) return false;
if (v instanceof WidgetCell) {
@@ -96,7 +96,7 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
}
int[] loc = new int[2];
mLauncher.getDragLayer().getLocationInDragLayer(image, loc);
getPopupContainer().getLocationInDragLayer(image, loc);
new PendingItemDragHelper(v).startDrag(
image.getBitmapBounds(), image.getBitmap().getWidth(), image.getWidth(),
@@ -119,13 +119,13 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
}
protected void clearNavBarColor() {
mLauncher.getSystemUiController().updateUiState(
getSystemUiController().updateUiState(
SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET, 0);
}
protected void setupNavBarColor() {
boolean isSheetDark = Themes.getAttrBoolean(mLauncher, R.attr.isMainColorDark);
mLauncher.getSystemUiController().updateUiState(
boolean isSheetDark = Themes.getAttrBoolean(getContext(), R.attr.isMainColorDark);
getSystemUiController().updateUiState(
SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET,
isSheetDark ? SystemUiController.FLAG_DARK_NAV : SystemUiController.FLAG_LIGHT_NAV);
}
@@ -145,4 +145,7 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
protected abstract int getElementsRowCount();
protected SystemUiController getSystemUiController() {
return mLauncher.getSystemUiController();
}
}