summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-04-12 18:31:09 -0700
committerTony Wickham <twickham@google.com>2017-04-17 11:44:41 -0700
commit343a77e609382bcb9b1d69ea235a9e6d779b719e (patch)
tree774becd5e7cbd6a8057ffcdc333ac2476bc49695
parent251dabfd765cd4422ff3fd2d6a7f70834413831c (diff)
downloadandroid_packages_apps_Trebuchet-343a77e609382bcb9b1d69ea235a9e6d779b719e.tar.gz
android_packages_apps_Trebuchet-343a77e609382bcb9b1d69ea235a9e6d779b719e.tar.bz2
android_packages_apps_Trebuchet-343a77e609382bcb9b1d69ea235a9e6d779b719e.zip
Rename WidgetsAndMore to WidgetsBottomSheet
(It only contains widgets now.) Bug: 35766387 Change-Id: I5864791a9741d1c56ac6df30125fe7a4a677b4bd
-rw-r--r--res/layout/widgets_bottom_sheet.xml (renamed from res/layout/widgets_and_more.xml)4
-rw-r--r--src/com/android/launcher3/AbstractFloatingView.java6
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java9
-rw-r--r--src/com/android/launcher3/popup/SystemShortcut.java10
-rw-r--r--src/com/android/launcher3/widget/WidgetsBottomSheet.java (renamed from src/com/android/launcher3/widget/WidgetsAndMore.java)21
5 files changed, 25 insertions, 25 deletions
diff --git a/res/layout/widgets_and_more.xml b/res/layout/widgets_bottom_sheet.xml
index 6764aa7cb..826235bfb 100644
--- a/res/layout/widgets_and_more.xml
+++ b/res/layout/widgets_bottom_sheet.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<com.android.launcher3.widget.WidgetsAndMore
+<com.android.launcher3.widget.WidgetsBottomSheet
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -51,4 +51,4 @@
android:layout_marginTop="45dp"
android:layout_marginBottom="40dp"/>
-</com.android.launcher3.widget.WidgetsAndMore> \ No newline at end of file
+</com.android.launcher3.widget.WidgetsBottomSheet> \ No newline at end of file
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 1f1203498..597e93703 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -37,13 +37,13 @@ public abstract class AbstractFloatingView extends LinearLayout {
@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 abstract class AbstractFloatingView extends LinearLayout {
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 b04d5b747..14f4e6cb6 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.Folder;
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 @@ public class DragLayer extends InsettableFrameLayout {
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 fa70de911..de884996b 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.R;
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 @@ public abstract class SystemShortcut {
@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
index 401337b16..a423154f4 100644
--- a/src/com/android/launcher3/widget/WidgetsAndMore.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -53,9 +53,9 @@ import com.android.launcher3.util.TouchController;
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 @@ public class WidgetsAndMore extends AbstractFloatingView implements Insettable,
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 @@ public class WidgetsAndMore extends AbstractFloatingView implements Insettable,
}
// 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 class WidgetsAndMore extends AbstractFloatingView implements Insettable,
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 @@ public class WidgetsAndMore extends AbstractFloatingView implements Insettable,
@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 @@ public class WidgetsAndMore extends AbstractFloatingView implements Insettable,
}
/**
- * 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