Rename WidgetsAndMore to WidgetsBottomSheet
(It only contains widgets now.)
Bug: 35766387
Change-Id: I5864791a9741d1c56ac6df30125fe7a4a677b4bd
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 1f12034..597e937 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -37,13 +37,13 @@
@IntDef(flag = true, value = {
TYPE_FOLDER,
TYPE_POPUP_CONTAINER_WITH_ARROW,
- TYPE_WIDGETS_AND_MORE
+ TYPE_WIDGETS_BOTTOM_SHEET
})
@Retention(RetentionPolicy.SOURCE)
public @interface FloatingViewType {}
public static final int TYPE_FOLDER = 1 << 0;
public static final int TYPE_POPUP_CONTAINER_WITH_ARROW = 1 << 1;
- public static final int TYPE_WIDGETS_AND_MORE = 1 << 2;
+ public static final int TYPE_WIDGETS_BOTTOM_SHEET = 1 << 2;
protected boolean mIsOpen;
@@ -139,7 +139,7 @@
public static AbstractFloatingView getTopOpenView(Launcher launcher) {
return getOpenView(launcher, TYPE_FOLDER | TYPE_POPUP_CONTAINER_WITH_ARROW
- | TYPE_WIDGETS_AND_MORE);
+ | TYPE_WIDGETS_BOTTOM_SHEET);
}
public abstract int getLogContainerType();
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index b04d5b7..14f4e6c 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -58,10 +58,9 @@
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.logging.LoggerUtils;
-import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TouchController;
-import com.android.launcher3.widget.WidgetsAndMore;
+import com.android.launcher3.widget.WidgetsBottomSheet;
import java.util.ArrayList;
@@ -247,9 +246,9 @@
return true;
}
- WidgetsAndMore widgetsAndMore = WidgetsAndMore.getOpen(mLauncher);
- if (widgetsAndMore != null && widgetsAndMore.onControllerInterceptTouchEvent(ev)) {
- mActiveController = widgetsAndMore;
+ WidgetsBottomSheet widgetsBottomSheet = WidgetsBottomSheet.getOpen(mLauncher);
+ if (widgetsBottomSheet != null && widgetsBottomSheet.onControllerInterceptTouchEvent(ev)) {
+ mActiveController = widgetsBottomSheet;
return true;
}
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index fa70de9..de88499 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -11,7 +11,7 @@
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.Themes;
-import com.android.launcher3.widget.WidgetsAndMore;
+import com.android.launcher3.widget.WidgetsBottomSheet;
import java.util.List;
@@ -62,10 +62,10 @@
@Override
public void onClick(View view) {
PopupContainerWithArrow.getOpen(launcher).close(true);
- WidgetsAndMore widgetsAndMore =
- (WidgetsAndMore) launcher.getLayoutInflater().inflate(
- R.layout.widgets_and_more, launcher.getDragLayer(), false);
- widgetsAndMore.populateAndShow(itemInfo);
+ WidgetsBottomSheet widgetsBottomSheet =
+ (WidgetsBottomSheet) launcher.getLayoutInflater().inflate(
+ R.layout.widgets_bottom_sheet, launcher.getDragLayer(), false);
+ widgetsBottomSheet.populateAndShow(itemInfo);
}
};
}
diff --git a/src/com/android/launcher3/widget/WidgetsAndMore.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
similarity index 93%
rename from src/com/android/launcher3/widget/WidgetsAndMore.java
rename to src/com/android/launcher3/widget/WidgetsBottomSheet.java
index 401337b..a423154 100644
--- a/src/com/android/launcher3/widget/WidgetsAndMore.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -53,9 +53,9 @@
import java.util.List;
/**
- * Bottom sheet for the "Widgets & more" long-press option.
+ * Bottom sheet for the "Widgets" system shortcut in the long-press popup.
*/
-public class WidgetsAndMore extends AbstractFloatingView implements Insettable, TouchController,
+public class WidgetsBottomSheet extends AbstractFloatingView implements Insettable, TouchController,
VerticalPullDetector.Listener, View.OnClickListener, View.OnLongClickListener,
DragController.DragListener {
@@ -72,11 +72,11 @@
private boolean mWasNavBarLight;
private VerticalPullDetector mVerticalPullDetector;
- public WidgetsAndMore(Context context, AttributeSet attrs) {
+ public WidgetsBottomSheet(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
- public WidgetsAndMore(Context context, AttributeSet attrs, int defStyleAttr) {
+ public WidgetsBottomSheet(Context context, AttributeSet attrs, int defStyleAttr) {
super(new ContextThemeWrapper(context, R.style.WidgetContainerTheme), attrs, defStyleAttr);
setWillNotDraw(false);
mLauncher = Launcher.getLauncher(context);
@@ -134,7 +134,8 @@
}
// If there is only one widget, we want to center it instead of left-align.
- WidgetsAndMore.LayoutParams params = (WidgetsAndMore.LayoutParams) widgetRow.getLayoutParams();
+ WidgetsBottomSheet.LayoutParams params = (WidgetsBottomSheet.LayoutParams)
+ widgetRow.getLayoutParams();
params.gravity = widgets.size() == 1 ? Gravity.CENTER_HORIZONTAL : Gravity.START;
}
@@ -200,7 +201,7 @@
public void onAnimationEnd(Animator animation) {
mIsOpen = false;
mVerticalPullDetector.finishedScrolling();
- ((ViewGroup) getParent()).removeView(WidgetsAndMore.this);
+ ((ViewGroup) getParent()).removeView(WidgetsBottomSheet.this);
setLightNavBar(mWasNavBarLight);
}
});
@@ -220,7 +221,7 @@
@Override
protected boolean isOfType(@FloatingViewType int type) {
- return (type & TYPE_WIDGETS_AND_MORE) != 0;
+ return (type & TYPE_WIDGETS_BOTTOM_SHEET) != 0;
}
@Override
@@ -229,10 +230,10 @@
}
/**
- * Returns a WidgetsAndMore which is already open or null
+ * Returns a {@link WidgetsBottomSheet} which is already open or null
*/
- public static WidgetsAndMore getOpen(Launcher launcher) {
- return getOpenView(launcher, TYPE_WIDGETS_AND_MORE);
+ public static WidgetsBottomSheet getOpen(Launcher launcher) {
+ return getOpenView(launcher, TYPE_WIDGETS_BOTTOM_SHEET);
}
@Override