activity_review.xml: add new GUI elements to replace old ones

Before this commit, the info icon shared the same GUI element with the "Skip this image" text.
This made the Kotlin code to handle taps on the info icon difficult to write, and would crash
with a NPE when the user used a language that is read right to left and the info icon was pressed.

This commit creates new GUI elements. Notably, the info icon has it's own element. A LinearLayout
is used to place the skip button and the info icon button together. Kotlin code can now be
simplified and the NPE bug can be fixed.
This commit is contained in:
Jason Whitmore 2025-08-06 20:11:38 -07:00
parent 929711da98
commit 7318c8c273

View file

@ -24,23 +24,37 @@
android:id="@+id/toolbarBinding"
layout="@layout/toolbar" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/skip_image"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/skip_image_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableEnd="@drawable/ic_info_outline_24dp"
android:drawablePadding="@dimen/medium_height"
android:drawableTint="@color/button_blue_dark"
android:paddingLeft="@dimen/medium_height"
android:paddingRight="@dimen/medium_height"
android:text="@string/skip_image"
android:textAllCaps="true"
android:textColor="@color/button_blue_dark"
android:textStyle="bold" />
android:orientation="horizontal"
android:gravity="center">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/skip_image"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="@dimen/medium_height"
android:paddingRight="@dimen/medium_height"
android:text="@string/skip_image"
android:textAllCaps="true"
android:textColor="@color/button_blue_dark"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/skip_image_info"
style="@style/Widget.AppCompat.Button.Borderless"
android:minWidth="48dp"
android:tint="@color/button_blue_dark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_info_outline_24dp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">