Skip to content

Commit

Permalink
fix: Ensure caption field is always visible (#1052)
Browse files Browse the repository at this point in the history
Constrain caption image height so the caption field is always visible.
Allow for at least 4 lines of space to enter the caption.
  • Loading branch information
nikclayton authored Oct 25, 2024
1 parent d21fbc2 commit 3a18451
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/main/res/layout/dialog_image_description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
android:id="@+id/imageDescriptionView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constrainedHeight="true"
android:contentDescription="@string/post_media_image"
android:focusable="false"
app:layout_constraintBottom_toTopOf="@id/textInputLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/textInputLayout"
app:layout_constraintVertical_chainStyle="spread_inside"
tools:srcCompat="@tools:sample/backgrounds/scenic" />

Expand All @@ -24,20 +25,23 @@
style="@style/AppTextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingHorizontal="?dialogPreferredPadding"
app:counterEnabled="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toBottomOf="@id/imageDescriptionView">
app:layout_constraintTop_toBottomOf="@id/imageDescriptionView"
app:layout_constraintVertical_weight="1">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/imageDescriptionText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:hint="@string/hint_description"
android:minLines="4"
android:importantForAutofill="no"
android:inputType="textCapSentences|textMultiLine|textAutoCorrect" />

Expand Down

0 comments on commit 3a18451

Please sign in to comment.