diff --git a/res/layout/widgets_full_sheet_large_screen.xml b/res/layout/widgets_full_sheet_large_screen.xml
index 808d3eb9b6..0626e60cc5 100644
--- a/res/layout/widgets_full_sheet_large_screen.xml
+++ b/res/layout/widgets_full_sheet_large_screen.xml
@@ -41,6 +41,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center_horizontal"
+ android:layout_below="@id/collapse_handle"
android:paddingHorizontal="@dimen/widget_list_horizontal_margin_large_screen"
android:text="@string/widget_button_text"
android:textColor="?android:attr/textColorSecondary"
@@ -84,11 +85,10 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.67"
- android:paddingEnd="16dp"
- android:paddingTop="24dp"
+ android:layout_marginEnd="@dimen/widget_list_horizontal_margin_large_screen"
+ android:paddingTop="@dimen/widget_list_horizontal_margin_large_screen"
android:gravity="end"
android:layout_gravity="end"
- android:paddingStart="8dp"
android:orientation="horizontal">
-
+
+ android:gravity="center_vertical"
+ android:clipToOutline="true"
+ android:paddingBottom="36dp"
+ android:background="@drawable/widgets_surface_background"
+ android:id="@+id/right_pane">
+
+
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e62cff5a4f..70ec3a9b43 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -178,6 +178,7 @@
4dp
16dp
6dp
+ 117dp
8dp
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 4f94c92f26..cfd241c130 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -16,6 +16,7 @@
package com.android.launcher3.widget;
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
+import static com.android.launcher3.config.FeatureFlags.LARGE_SCREEN_WIDGET_PICKER;
import android.content.Context;
import android.graphics.Canvas;
@@ -187,6 +188,10 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView
int widthUsed;
if (deviceProfile.isTablet) {
int margin = deviceProfile.allAppsLeftRightMargin;
+ if (deviceProfile.isLandscape && LARGE_SCREEN_WIDGET_PICKER.get()) {
+ margin = getResources().getDimensionPixelSize(
+ R.dimen.widget_picker_landscape_tablet_left_right_margin);
+ }
widthUsed = Math.max(2 * margin, 2 * (mInsets.left + mInsets.right));
} else if (mInsets.bottom > 0) {
widthUsed = mInsets.left + mInsets.right;
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index d3be00ce3a..bd75ce6061 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -30,6 +30,7 @@ import android.content.Context;
import android.content.pm.LauncherApps;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Outline;
import android.graphics.Rect;
import android.os.Build;
import android.os.Process;
@@ -42,6 +43,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
import android.view.WindowInsets;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -187,7 +189,8 @@ public class WidgetsFullSheet extends BaseWidgetSheet
private View mSearchBarContainer;
private WidgetsSearchBar mSearchBar;
private TextView mHeaderTitle;
- private FrameLayout mRightPane;
+ private LinearLayout mRightPane;
+ private FrameLayout mRightPaneScrollView;
private WidgetsListTableViewHolderBinder mWidgetsListTableViewHolderBinder;
private DeviceProfile mDeviceProfile;
private final boolean mIsTwoPane;
@@ -197,6 +200,21 @@ public class WidgetsFullSheet extends BaseWidgetSheet
private RecyclerViewFastScroller mFastScroller;
+ private final ViewOutlineProvider mViewOutlineProviderRightPane = new ViewOutlineProvider() {
+ @Override
+ public void getOutline(View view, Outline outline) {
+ outline.setRoundRect(
+ 0,
+ 0,
+ view.getMeasuredWidth(),
+ view.getMeasuredHeight() - getResources().getDimensionPixelSize(
+ R.dimen.widget_list_horizontal_margin_large_screen),
+ view.getResources().getDimensionPixelSize(
+ R.dimen.widget_list_top_bottom_corner_radius)
+ );
+ }
+ };
+
public WidgetsFullSheet(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mDeviceProfile = Launcher.getLauncher(context).getDeviceProfile();
@@ -333,6 +351,12 @@ public class WidgetsFullSheet extends BaseWidgetSheet
? mContent.findViewById(R.id.title)
: mSearchScrollView.findViewById(R.id.title);
mRightPane = mIsTwoPane ? mContent.findViewById(R.id.right_pane) : null;
+ if (mRightPane != null) {
+ mRightPane.setOutlineProvider(mViewOutlineProviderRightPane);
+ }
+ mRightPaneScrollView = mIsTwoPane
+ ? mContent.findViewById(R.id.right_pane_scroll_view) : null;
+
mWidgetsListTableViewHolderBinder =
new WidgetsListTableViewHolderBinder(mActivityContext, layoutInflater, this, this);
onRecommendedWidgetsBound();
@@ -760,15 +784,16 @@ public class WidgetsFullSheet extends BaseWidgetSheet
mNoIntercept = false;
WidgetsRecyclerView recyclerView = getRecyclerView();
RecyclerViewFastScroller scroller = recyclerView.getScrollbar();
+
if (scroller.getThumbOffsetY() >= 0
&& getPopupContainer().isEventOverView(scroller, ev)) {
mNoIntercept = true;
} else if (getPopupContainer().isEventOverView(recyclerView, ev)) {
mNoIntercept = !recyclerView.shouldContainerScroll(ev, getPopupContainer());
- } else if (mIsTwoPane && getPopupContainer().isEventOverView(mRightPane, ev)) {
- mNoIntercept = mRightPane.getScrollY() > 0;
+ } else if (mIsTwoPane && mRightPaneScrollView != null
+ && getPopupContainer().isEventOverView(mRightPaneScrollView, ev)) {
+ mNoIntercept = mRightPaneScrollView.canScrollVertically(-1);
}
-
if (mSearchBar.isSearchBarFocused()
&& !getPopupContainer().isEventOverView(mSearchBarContainer, ev)) {
mSearchBar.clearSearchBarFocus();
@@ -1002,10 +1027,11 @@ public class WidgetsFullSheet extends BaseWidgetSheet
Collections.EMPTY_LIST);
widgetsRowViewHolder.mDataCallback = data -> {
mWidgetsListTableViewHolderBinder.bindViewHolder(widgetsRowViewHolder,
- contentEntry,
+ contentEntry.withMaxSpanSize(mMaxSpanPerRow),
ViewHolderBinder.POSITION_FIRST | ViewHolderBinder.POSITION_LAST,
Collections.singletonList(data));
};
+
mRightPane.removeAllViews();
mRightPane.addView(widgetsRowViewHolder.itemView);
}