diff options
| -rw-r--r-- | packages/SystemUI/res/layout/screenshot_static.xml | 20 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/strings.xml | 2 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java | 6 |
3 files changed, 27 insertions, 1 deletions
diff --git a/packages/SystemUI/res/layout/screenshot_static.xml b/packages/SystemUI/res/layout/screenshot_static.xml index 65983b79570e..efd683f1a97b 100644 --- a/packages/SystemUI/res/layout/screenshot_static.xml +++ b/packages/SystemUI/res/layout/screenshot_static.xml @@ -166,6 +166,7 @@ android:paddingEnd="4dp" android:src="@drawable/ic_work_app_badge" app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/screenshot_message_content" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> @@ -177,7 +178,24 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/screenshot_message_icon" - app:layout_constraintEnd_toEndOf="parent"/> + app:layout_constraintEnd_toStartOf="@id/message_dismiss_button"/> + + <FrameLayout + android:id="@+id/message_dismiss_button" + android:layout_width="@dimen/overlay_dismiss_button_tappable_size" + android:layout_height="@dimen/overlay_dismiss_button_tappable_size" + app:layout_constraintStart_toEndOf="@id/screenshot_message_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:contentDescription="@string/screenshot_dismiss_work_profile"> + <ImageView + android:id="@+id/screenshot_dismiss_image" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_margin="@dimen/overlay_dismiss_button_margin" + android:src="@drawable/overlay_cancel"/> + </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> </com.android.systemui.screenshot.DraggableConstraintLayout> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 7b1c6c6d67ce..7a8ffa1863f6 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -227,6 +227,8 @@ <string name="screenshot_scroll_label">Capture more</string> <!-- Content description indicating that tapping a button will dismiss the screenshots UI [CHAR LIMIT=NONE] --> <string name="screenshot_dismiss_description">Dismiss screenshot</string> + <!-- Content description indicating that tapping a button will dismiss the work profile first run dialog [CHAR LIMIT=NONE] --> + <string name="screenshot_dismiss_work_profile">Dismiss work profile message</string> <!-- Content description indicating that the view is a preview of the screenshot that was just taken [CHAR LIMIT=NONE] --> <string name="screenshot_preview_description">Screenshot preview</string> <!-- Content description for the top boundary of the screenshot being cropped, with the current position as a percentage. [CHAR LIMIT=NONE] --> diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 9c7718d0e001..e8ceb521b6b0 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -289,6 +289,9 @@ public class ScreenshotView extends FrameLayout implements mDismissButton.getBoundsOnScreen(tmpRect); swipeRegion.op(tmpRect, Region.Op.UNION); + mMessageContainer.findViewById(R.id.message_dismiss_button).getBoundsOnScreen(tmpRect); + swipeRegion.op(tmpRect, Region.Op.UNION); + return swipeRegion; } @@ -353,6 +356,9 @@ public class ScreenshotView extends FrameLayout implements mMessageContent.setText( mContext.getString(R.string.screenshot_work_profile_notification, appName)); mMessageContainer.setVisibility(VISIBLE); + mMessageContainer.findViewById(R.id.message_dismiss_button).setOnClickListener((v) -> { + mMessageContainer.setVisibility(View.GONE); + }); } @Override // View |