Merge "Align clipboard text editor with mocks" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b07646b6e3
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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] -->
|
||||
|
||||
@@ -702,6 +702,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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user