Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 587c3ce0 authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge changes from topic "bottomsheet-with-insets" into main

* changes:
  Align the margins between handle, text, and container with main picker.
  Update the app-specific picker to have a container like the main picker
parents 2dfe2e35 d4997cf0
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -25,11 +25,10 @@
            android:layout_width="@dimen/bottom_sheet_handle_width"
            android:layout_height="@dimen/bottom_sheet_handle_height"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="@dimen/bottom_sheet_handle_margin"
            android:layout_marginBottom="@dimen/widgets_bottom_sheet_handle_margin"
            android:visibility="gone"
            android:background="@drawable/bg_rounded_corner_bottom_sheet_handle"/>
        <TextView
            style="@style/TextHeadline"
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
@@ -41,8 +40,13 @@
            android:id="@+id/widgets_table_scroll_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fadeScrollbars="false"
            android:layout_marginTop="16dp">
            android:layout_marginTop="24dp"
            android:layout_marginBottom="24dp"
            android:layout_marginHorizontal="@dimen/widget_bottom_sheet_horizontal_margin"
            android:background="@drawable/widgets_surface_background"
            android:scrollbarThumbVertical="@drawable/widget_picker_preview_pane_scroll_thumb"
            android:clipToOutline="true"
            android:clipChildren="true">
            <include layout="@layout/widgets_table_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
+3 −0
Original line number Diff line number Diff line
@@ -209,6 +209,8 @@
    <dimen name="widget_list_left_pane_horizontal_margin">0dp</dimen>
    <dimen name="widget_list_horizontal_margin_two_pane">24dp</dimen>
    <dimen name="widget_picker_vertical_margin_right_pane">24dp</dimen>
    <!-- Margin on sides of the widgets scrollview in widgets bottom sheet -->
    <dimen name="widget_bottom_sheet_horizontal_margin">16dp</dimen>

    <dimen name="widget_preview_shadow_blur">0.5dp</dimen>
    <dimen name="widget_preview_key_shadow_distance">1dp</dimen>
@@ -476,6 +478,7 @@
    <dimen name="bottom_sheet_handle_width">32dp</dimen>
    <dimen name="bottom_sheet_handle_height">4dp</dimen>
    <dimen name="bottom_sheet_handle_margin">16dp</dimen>
    <dimen name="widgets_bottom_sheet_handle_margin">24dp</dimen>
    <dimen name="bottom_sheet_handle_corner_radius">2dp</dimen>

    <!-- State transition -->
+0 −20
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_BOTTOM_
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.IntProperty;
import android.util.Pair;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -50,22 +49,6 @@ import java.util.List;
 * Bottom sheet for the "Widgets" system shortcut in the long-press popup.
 */
public class WidgetsBottomSheet extends BaseWidgetSheet {
    private static final String TAG = "WidgetsBottomSheet";

    private static final IntProperty<View> PADDING_BOTTOM =
            new IntProperty<View>("paddingBottom") {
                @Override
                public void setValue(View view, int paddingBottom) {
                    view.setPadding(view.getPaddingLeft(), view.getPaddingTop(),
                            view.getPaddingRight(), paddingBottom);
                }

                @Override
                public Integer get(View view) {
                    return view.getPaddingBottom();
                }
            };

    private static final int DEFAULT_CLOSE_DURATION = 200;
    private static final long EDUCATION_TIP_DELAY_MS = 300;

@@ -119,9 +102,6 @@ public class WidgetsBottomSheet extends BaseWidgetSheet {
        mContent = findViewById(R.id.widgets_bottom_sheet);
        setContentBackgroundWithParent(
                getContext().getDrawable(R.drawable.bg_rounded_corner_bottom_sheet), mContent);
        View scrollView = findViewById(R.id.widgets_table_scroll_view);
        scrollView.setOutlineProvider(mViewOutlineProvider);
        scrollView.setClipToOutline(true);
    }

    @Override