diff options
4 files changed, 31 insertions, 13 deletions
diff --git a/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml b/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml index bb8cece9203b..ad6c154692ec 100644 --- a/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml +++ b/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml @@ -14,10 +14,14 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> -<shape +<inset xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" - android:shape="rectangle"> - <solid android:color="?androidprv:attr/materialColorSurfaceBright"/> - <corners android:radius="10000dp"/> <!-- fully-rounded radius --> -</shape> + android:insetLeft="@dimen/overlay_action_container_minimum_edge_spacing" + android:insetRight="@dimen/overlay_action_container_minimum_edge_spacing"> + <shape + xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" + android:shape="rectangle"> + <solid android:color="?androidprv:attr/materialColorSurfaceBright"/> + <corners android:radius="10000dp"/> <!-- fully-rounded radius --> + </shape> +</inset>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/clipboard_overlay2.xml b/packages/SystemUI/res/layout/clipboard_overlay2.xml index 521369e56652..65005f840598 100644 --- a/packages/SystemUI/res/layout/clipboard_overlay2.xml +++ b/packages/SystemUI/res/layout/clipboard_overlay2.xml @@ -24,6 +24,16 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/clipboard_overlay_window_name"> + <!-- Min edge spacing guideline off of which the preview and actions can be anchored (without + this we'd need to express margins as the sum of two different dimens). --> + <androidx.constraintlayout.widget.Guideline + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/min_edge_guideline" + app:layout_constraintGuide_begin="@dimen/overlay_action_container_minimum_edge_spacing" + android:orientation="vertical"/> + <!-- Negative horizontal margin because this container background must render beyond the thing + it's constrained by (the actions themselves). --> <FrameLayout android:id="@+id/actions_container_background" android:visibility="gone" @@ -31,11 +41,12 @@ android:layout_width="0dp" android:elevation="4dp" android:background="@drawable/shelf_action_chip_container_background" - android:layout_marginStart="@dimen/overlay_action_container_minimum_edge_spacing" + android:layout_marginStart="@dimen/negative_overlay_action_container_minimum_edge_spacing" + android:layout_marginEnd="@dimen/negative_overlay_action_container_minimum_edge_spacing" android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/actions_container" - app:layout_constraintEnd_toEndOf="@+id/actions_container" + app:layout_constraintStart_toStartOf="@id/min_edge_guideline" + app:layout_constraintTop_toTopOf="@id/actions_container" + app:layout_constraintEnd_toEndOf="@id/actions_container" app:layout_constraintBottom_toBottomOf="parent"/> <HorizontalScrollView android:id="@+id/actions_container" @@ -76,7 +87,7 @@ android:layout_marginBottom="@dimen/overlay_preview_container_margin" android:elevation="7dp" android:background="@drawable/overlay_border" - app:layout_constraintStart_toStartOf="@id/actions_container_background" + app:layout_constraintStart_toStartOf="@id/min_edge_guideline" app:layout_constraintTop_toTopOf="@id/clipboard_preview" app:layout_constraintEnd_toEndOf="@id/clipboard_preview" app:layout_constraintBottom_toBottomOf="@id/actions_container_background"/> diff --git a/packages/SystemUI/res/layout/screenshot_shelf.xml b/packages/SystemUI/res/layout/screenshot_shelf.xml index 6b65e9c49ca6..796def369708 100644 --- a/packages/SystemUI/res/layout/screenshot_shelf.xml +++ b/packages/SystemUI/res/layout/screenshot_shelf.xml @@ -79,7 +79,6 @@ android:layout_width="wrap_content" android:elevation="4dp" android:background="@drawable/shelf_action_chip_container_background" - android:layout_marginHorizontal="@dimen/overlay_action_container_minimum_edge_spacing" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toTopOf="@id/guideline" > diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index c9abcaa1a457..f418502c4a41 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -442,8 +442,12 @@ <dimen name="overlay_preview_container_margin">8dp</dimen> <dimen name="overlay_action_container_margin_horizontal">8dp</dimen> <dimen name="overlay_action_container_margin_bottom">6dp</dimen> - <!-- minimum distance to the left, right or bottom edges. --> + <!-- + minimum distance to the left, right or bottom edges. Keep in sync with + negative_overlay_action_container_minimum_edge_spacing. --> <dimen name="overlay_action_container_minimum_edge_spacing">12dp</dimen> + <!-- Keep in sync with overlay_action_container_minimum_edge_spacing --> + <dimen name="negative_overlay_action_container_minimum_edge_spacing">-12dp</dimen> <dimen name="overlay_bg_protection_height">242dp</dimen> <dimen name="overlay_action_container_corner_radius">20dp</dimen> <dimen name="overlay_action_container_padding_vertical">8dp</dimen> |