Align clipboard text editor with mocks

Bug: 225355855
Test: manual (visual changes)
Change-Id: Ia0580256cb0923f9be0bf5e757c8ff4225a4c7f5
This commit is contained in:
Miranda Kephart
2022-03-24 11:55:25 -04:00
parent 4bf66d6e90
commit a2dbd10545
7 changed files with 45 additions and 26 deletions

View File

@@ -14,20 +14,27 @@
~ See the License for the specific language governing permissions and ~ See the License for the specific language governing permissions and
~ limitations under the License. ~ 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" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:color="?android:textColorPrimary"> android:color="?android:textColorPrimary">
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<inset android:insetTop="4dp" android:insetBottom="4dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="?androidprv:attr/colorAccentPrimary"/> <solid android:color="?androidprv:attr/colorAccentPrimary"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
<size android:height="40dp"/>
</shape> </shape>
</inset>
</item> </item>
<item android:id="@android:id/mask"> <item android:id="@android:id/mask">
<inset android:insetTop="4dp" android:insetBottom="4dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="?android:textColorPrimary"/> <solid android:color="?android:textColorPrimary"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
<size android:height="40dp"/>
</shape> </shape>
</inset>
</item> </item>
</ripple> </ripple>

View File

@@ -6,13 +6,14 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<Button <Button
android:id="@+id/copy_button" android:id="@+id/done_button"
style="@android:style/Widget.DeviceDefault.Button.Colored" style="@style/EditTextActivityButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp" 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_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -20,22 +21,23 @@
android:id="@+id/attribution" android:id="@+id/attribution"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="40dp"
app:layout_constraintStart_toStartOf="@+id/copy_button" android:layout_marginStart="4dp"
app:layout_constraintTop_toBottomOf="@+id/copy_button" /> app:layout_constraintStart_toStartOf="@id/done_button"
app:layout_constraintTop_toBottomOf="@id/done_button" />
<ImageButton <ImageButton
android:id="@+id/share" android:id="@+id/share"
style="@android:style/Widget.Material.Button.Borderless" style="@android:style/Widget.Material.Button.Borderless"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginEnd="8dp"
android:padding="12dp" android:padding="12dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:contentDescription="@*android:string/share" android:contentDescription="@*android:string/share"
android:tooltipText="@*android:string/share" android:tooltipText="@*android:string/share"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent" 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:tint="?android:attr/textColorPrimary"
android:src="@drawable/ic_screenshot_share" /> android:src="@drawable/ic_screenshot_share" />
@@ -43,17 +45,19 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginStart="4dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="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_constraintEnd_toEndOf="@id/share"
app:layout_constraintTop_toBottomOf="@+id/attribution"> app:layout_constraintTop_toBottomOf="@id/attribution">
<EditText <EditText
android:id="@+id/edit_text" android:id="@+id/edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null"
android:gravity="start|top" android:gravity="start|top"
android:textSize="24sp" /> android:textSize="24sp" />
</ScrollView> </ScrollView>

View File

@@ -27,7 +27,7 @@
android:id="@+id/save" android:id="@+id/save"
style="@android:style/Widget.DeviceDefault.Button.Colored" style="@android:style/Widget.DeviceDefault.Button.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="48dp"
android:text="@string/save" android:text="@string/save"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin" android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin"
@@ -41,7 +41,7 @@
android:id="@+id/cancel" android:id="@+id/cancel"
style="@android:style/Widget.DeviceDefault.Button.Colored" style="@android:style/Widget.DeviceDefault.Button.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="48dp"
android:text="@android:string/cancel" android:text="@android:string/cancel"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin" android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin"

View File

@@ -51,6 +51,10 @@
<item name="overlayButtonTextColor">?android:attr/textColorPrimaryInverse</item> <item name="overlayButtonTextColor">?android:attr/textColorPrimaryInverse</item>
</style> </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"> <style name="Theme.PeopleTileConfigActivity" parent="@style/Theme.SystemUI">
<item name="android:windowActionBar">false</item> <item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>

View File

@@ -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]--> <!-- 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> <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] --> <!-- Label for button to finish and copy edited text back to the clipboard [CHAR LIMIT=20] -->
<string name="clipboard_edit_text_copy">Copy</string> <string name="clipboard_edit_text_done">Done</string>
<!-- Text informing user that content has been copied to the system clipboard [CHAR LIMIT=NONE] --> <!-- Text informing user that content has been copied to the system clipboard [CHAR LIMIT=NONE] -->
<string name="clipboard_overlay_text_copied">Copied</string> <string name="clipboard_overlay_text_copied">Copied</string>
<!-- Text informing user where text being edited was copied from [CHAR LIMIT=NONE] --> <!-- Text informing user where text being edited was copied from [CHAR LIMIT=NONE] -->

View File

@@ -699,6 +699,10 @@
<item name="overlayButtonTextColor">?android:attr/textColorPrimary</item> <item name="overlayButtonTextColor">?android:attr/textColorPrimary</item>
</style> </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. --> <!-- Clipboard overlay's edit text activity. -->
<style name="EditTextActivity" parent="@android:style/Theme.DeviceDefault.DayNight"> <style name="EditTextActivity" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>

View File

@@ -45,7 +45,7 @@ public class EditTextActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.clipboard_edit_text_activity); 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()); findViewById(R.id.share).setOnClickListener((v) -> share());
mEditText = findViewById(R.id.edit_text); mEditText = findViewById(R.id.edit_text);
mAttribution = findViewById(R.id.attribution); mAttribution = findViewById(R.id.attribution);