diff options
| author | 2022-03-24 11:55:25 -0400 | |
|---|---|---|
| committer | 2022-03-24 16:00:46 -0400 | |
| commit | a2dbd1054511b2bcf7fa67ecf36eefe0bc2ec107 (patch) | |
| tree | db2001f1f918b444b48a21e12cc83c380d3e6446 | |
| parent | 4bf66d6e90fc181ebc26a0942b71744adbf47b25 (diff) | |
Align clipboard text editor with mocks
Bug: 225355855
Test: manual (visual changes)
Change-Id: Ia0580256cb0923f9be0bf5e757c8ff4225a4c7f5
7 files changed, 45 insertions, 26 deletions
diff --git a/packages/SystemUI/res/drawable/overlay_button_background.xml b/packages/SystemUI/res/drawable/overlay_button_background.xml index 3c39fe2ecb06..0e8438c8a11d 100644 --- a/packages/SystemUI/res/drawable/overlay_button_background.xml +++ b/packages/SystemUI/res/drawable/overlay_button_background.xml @@ -14,20 +14,27 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> -<!-- Long screenshot save/cancel button background --> +<!-- Button background for activities downstream of overlays + (clipboard text editor, long screenshots) --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" android:color="?android:textColorPrimary"> <item android:id="@android:id/background"> - <shape android:shape="rectangle"> - <solid android:color="?androidprv:attr/colorAccentPrimary"/> - <corners android:radius="20dp"/> - </shape> + <inset android:insetTop="4dp" android:insetBottom="4dp"> + <shape android:shape="rectangle"> + <solid android:color="?androidprv:attr/colorAccentPrimary"/> + <corners android:radius="20dp"/> + <size android:height="40dp"/> + </shape> + </inset> </item> <item android:id="@android:id/mask"> - <shape android:shape="rectangle"> - <solid android:color="?android:textColorPrimary"/> - <corners android:radius="20dp"/> - </shape> + <inset android:insetTop="4dp" android:insetBottom="4dp"> + <shape android:shape="rectangle"> + <solid android:color="?android:textColorPrimary"/> + <corners android:radius="20dp"/> + <size android:height="40dp"/> + </shape> + </inset> </item> </ripple>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/clipboard_edit_text_activity.xml b/packages/SystemUI/res/layout/clipboard_edit_text_activity.xml index 0d32f73a49c9..1122ca6bd4dc 100644 --- a/packages/SystemUI/res/layout/clipboard_edit_text_activity.xml +++ b/packages/SystemUI/res/layout/clipboard_edit_text_activity.xml @@ -6,13 +6,14 @@ android:layout_height="match_parent"> <Button - android:id="@+id/copy_button" - style="@android:style/Widget.DeviceDefault.Button.Colored" + android:id="@+id/done_button" + style="@style/EditTextActivityButton" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" + android:layout_height="48dp" android:layout_marginTop="8dp" - android:text="@string/clipboard_edit_text_copy" + android:layout_marginStart="12dp" + android:background="@drawable/overlay_button_background" + android:text="@string/clipboard_edit_text_done" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -20,22 +21,23 @@ android:id="@+id/attribution" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dp" - app:layout_constraintStart_toStartOf="@+id/copy_button" - app:layout_constraintTop_toBottomOf="@+id/copy_button" /> + android:layout_marginTop="40dp" + android:layout_marginStart="4dp" + app:layout_constraintStart_toStartOf="@id/done_button" + app:layout_constraintTop_toBottomOf="@id/done_button" /> <ImageButton android:id="@+id/share" style="@android:style/Widget.Material.Button.Borderless" android:layout_width="48dp" android:layout_height="48dp" - android:layout_marginEnd="8dp" android:padding="12dp" android:scaleType="fitCenter" android:contentDescription="@*android:string/share" android:tooltipText="@*android:string/share" + android:layout_marginEnd="16dp" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="@+id/copy_button" + app:layout_constraintTop_toTopOf="@id/done_button" android:tint="?android:attr/textColorPrimary" android:src="@drawable/ic_screenshot_share" /> @@ -43,17 +45,19 @@ android:layout_width="0dp" android:layout_height="0dp" android:layout_marginTop="8dp" + android:layout_marginStart="4dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" - app:layout_constraintStart_toStartOf="@+id/copy_button" + app:layout_constraintStart_toStartOf="@id/done_button" app:layout_constraintEnd_toEndOf="@id/share" - app:layout_constraintTop_toBottomOf="@+id/attribution"> + app:layout_constraintTop_toBottomOf="@id/attribution"> <EditText android:id="@+id/edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@null" android:gravity="start|top" android:textSize="24sp" /> </ScrollView> diff --git a/packages/SystemUI/res/layout/long_screenshot.xml b/packages/SystemUI/res/layout/long_screenshot.xml index cdf61036e2b7..2927d6ba7f3c 100644 --- a/packages/SystemUI/res/layout/long_screenshot.xml +++ b/packages/SystemUI/res/layout/long_screenshot.xml @@ -27,7 +27,7 @@ android:id="@+id/save" style="@android:style/Widget.DeviceDefault.Button.Colored" android:layout_width="wrap_content" - android:layout_height="40dp" + android:layout_height="48dp" android:text="@string/save" android:layout_marginStart="8dp" android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin" @@ -41,7 +41,7 @@ android:id="@+id/cancel" style="@android:style/Widget.DeviceDefault.Button.Colored" android:layout_width="wrap_content" - android:layout_height="40dp" + android:layout_height="48dp" android:text="@android:string/cancel" android:layout_marginStart="6dp" android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin" diff --git a/packages/SystemUI/res/values-night/styles.xml b/packages/SystemUI/res/values-night/styles.xml index f7261e70a610..cf4972805e25 100644 --- a/packages/SystemUI/res/values-night/styles.xml +++ b/packages/SystemUI/res/values-night/styles.xml @@ -51,6 +51,10 @@ <item name="overlayButtonTextColor">?android:attr/textColorPrimaryInverse</item> </style> + <style name="EditTextActivityButton" parent="@android:style/Widget.DeviceDefault.Button.Colored"> + <item name="android:textColor">?android:attr/textColorPrimaryInverse</item> + </style> + <style name="Theme.PeopleTileConfigActivity" parent="@style/Theme.SystemUI"> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index d3b76d90d09f..fc1290c26a81 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -2372,8 +2372,8 @@ <!-- Label of the button to stop an app from running but the app is already stopped and the button is disabled [CHAR LIMIT=12]--> <string name="fgs_manager_app_item_stop_button_stopped_label">Stopped</string> - <!-- Label for button to copy edited text back to the clipboard [CHAR LIMIT=20] --> - <string name="clipboard_edit_text_copy">Copy</string> + <!-- Label for button to finish and copy edited text back to the clipboard [CHAR LIMIT=20] --> + <string name="clipboard_edit_text_done">Done</string> <!-- Text informing user that content has been copied to the system clipboard [CHAR LIMIT=NONE] --> <string name="clipboard_overlay_text_copied">Copied</string> <!-- Text informing user where text being edited was copied from [CHAR LIMIT=NONE] --> diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index a61eda8f0e09..b14c7f906ff1 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -699,6 +699,10 @@ <item name="overlayButtonTextColor">?android:attr/textColorPrimary</item> </style> + <style name="EditTextActivityButton" parent="@android:style/Widget.DeviceDefault.Button.Colored"> + <item name="android:textColor">?android:attr/textColorPrimary</item> + </style> + <!-- Clipboard overlay's edit text activity. --> <style name="EditTextActivity" parent="@android:style/Theme.DeviceDefault.DayNight"> <item name="android:windowNoTitle">true</item> diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java index a57a1351779f..1621cbc0be72 100644 --- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java +++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java @@ -45,7 +45,7 @@ public class EditTextActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.clipboard_edit_text_activity); - findViewById(R.id.copy_button).setOnClickListener((v) -> saveToClipboard()); + findViewById(R.id.done_button).setOnClickListener((v) -> saveToClipboard()); findViewById(R.id.share).setOnClickListener((v) -> share()); mEditText = findViewById(R.id.edit_text); mAttribution = findViewById(R.id.attribution); |