summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author 1 <mrcasey@google.com> 2023-03-29 20:10:45 +0000
committer 1 <mrcasey@google.com> 2023-03-31 19:15:48 +0000
commit180ac4f8932a130278f0d2f1b58d10ecd3bd15fb (patch)
tree46a5ede552e560e92b2d9159d25b24816bb07287 /java
parent3fb79ddddd491d2960ebc90414b976345ef70a15 (diff)
Allow for longer headlines
Constraint on headline length was too short for some languages. Also need to ensure that longer strings work within the layout. Switched to ConstraintLayout for that, with a Barrier to ensure that the modify share and text toggle UI elements don't collide with the headline. Test: Visual verification in a variety of configurations (diff share payloads, modify share action, etc) Bug: 275755230 Change-Id: I2c2f1d9f9acaebd4f41d8d6f0791b58a26175100
Diffstat (limited to 'java')
-rw-r--r--java/res/layout/chooser_headline_row.xml23
-rw-r--r--java/res/values/strings.xml14
2 files changed, 24 insertions, 13 deletions
diff --git a/java/res/layout/chooser_headline_row.xml b/java/res/layout/chooser_headline_row.xml
index 9dfab892..d7429ddf 100644
--- a/java/res/layout/chooser_headline_row.xml
+++ b/java/res/layout/chooser_headline_row.xml
@@ -15,9 +15,10 @@
~ limitations under the License.
-->
-<RelativeLayout
+<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/chooser_edge_margin_normal"
@@ -27,18 +28,28 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- android:layout_alignParentStart="true"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/barrier"
+ app:layout_constraintHorizontal_bias="0.0"
+ app:layout_constrainedWidth="true"
android:textColor="?android:attr/textColorPrimary"
android:fontFamily="@androidprv:string/config_headlineFontFamily"
android:textSize="18sp"
android:paddingBottom="16dp"
/>
+ <androidx.constraintlayout.widget.Barrier
+ android:id="@+id/barrier"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:barrierDirection="start"
+ app:constraint_referenced_ids="reselection_action,include_text_action" />
+
<TextView
android:id="@+id/reselection_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
+ app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"
android:paddingBottom="16dp"
style="@style/ReselectionAction" />
@@ -49,9 +60,9 @@
android:id="@+id/include_text_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_below="@id/reselection_action"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/reselection_action"
android:layout_alignWithParentIfMissing="true"
android:visibility="gone" />
-</RelativeLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index f38666e4..546ef249 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -137,34 +137,34 @@
}
</string>
- <!-- Title atop a sharing UI indicating that text is being shared [CHAR_LIMIT=25] -->
+ <!-- Title atop a sharing UI indicating that text is being shared [CHAR_LIMIT=50] -->
<string name="sharing_text">Sharing text</string>
- <!-- Title atop a sharing UI indicating that a link (URL) is being shared [CHAR_LIMIT=25] -->
+ <!-- Title atop a sharing UI indicating that a link (URL) is being shared [CHAR_LIMIT=50] -->
<string name="sharing_link">Sharing link</string>
- <!-- Title atop a sharing UI indicating that some images are being shared [CHAR_LIMIT=25] -->
+ <!-- Title atop a sharing UI indicating that some images are being shared [CHAR_LIMIT=50] -->
<string name="sharing_images">{count, plural,
=1 {Sharing image}
other {Sharing # images}
}
</string>
- <!-- Title atop a sharing UI indicating that some videos are being shared [CHAR_LIMIT=25] -->
+ <!-- Title atop a sharing UI indicating that some videos are being shared [CHAR_LIMIT=50] -->
<string name="sharing_videos">{count, plural,
=1 {Sharing video}
other {Sharing # videos}
}
</string>
<!-- Title atop a sharing UI indicating that some number of items are being shared
- (for example: sharing a mixture of photos and videos [CHAR_LIMIT=25] -->
+ (for example: sharing a mixture of photos and videos [CHAR_LIMIT=50] -->
<string name="sharing_items">{count, plural,
=1 {Sharing # item}
other {Sharing # items}
}
</string>
<!-- Title atop a sharing UI indicating that an image is being shared with text attached.
- [CHAR_LIMIT=25] -->
+ [CHAR_LIMIT=50] -->
<string name="sharing_image_with_text">Sharing image with text</string>
<!-- Title atop a sharing UI indicating that an image is being shared with a link (URL)
- attached. [CHAR_LIMIT=25] -->
+ attached. [CHAR_LIMIT=50] -->
<string name="sharing_image_with_link">Sharing image with link</string>
<!-- ChooserActivity - No direct share targets are available. [CHAR LIMIT=NONE] -->