diff options
author | Tony Wickham <twickham@google.com> | 2017-04-17 18:59:05 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-17 18:59:05 +0000 |
commit | 1c2291de8682918e1556503f59b65c93f2542a1d (patch) | |
tree | 85d47179ec412d5234ce9c822e2d42d70f08c244 /src/com | |
parent | c1cac5f5541403bcad61b03cfa31458aeca40554 (diff) | |
parent | 343a77e609382bcb9b1d69ea235a9e6d779b719e (diff) | |
download | android_packages_apps_Trebuchet-1c2291de8682918e1556503f59b65c93f2542a1d.tar.gz android_packages_apps_Trebuchet-1c2291de8682918e1556503f59b65c93f2542a1d.tar.bz2 android_packages_apps_Trebuchet-1c2291de8682918e1556503f59b65c93f2542a1d.zip |
Rename WidgetsAndMore to WidgetsBottomSheet
am: 343a77e609
Change-Id: I3d0c3e3a4ec1225781421567cfd9f2ea1d676bc0
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/AbstractFloatingView.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragLayer.java | 8 | ||||
-rw-r--r-- | src/com/android/launcher3/popup/SystemShortcut.java | 10 | ||||
-rw-r--r-- | src/com/android/launcher3/widget/WidgetsBottomSheet.java (renamed from src/com/android/launcher3/widget/WidgetsAndMore.java) | 21 |
4 files changed, 23 insertions, 22 deletions
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 705262e5b..14f4e6cb6 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -60,7 +60,7 @@ import com.android.launcher3.keyboard.ViewGroupFocusHelper; import com.android.launcher3.logging.LoggerUtils; 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; @@ -246,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 a44471d6c..7d86163f0 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; @@ -60,10 +60,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 |