mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
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:
parent
929711da98
commit
7318c8c273
1 changed files with 29 additions and 15 deletions
|
|
@ -24,6 +24,12 @@
|
|||
android:id="@+id/toolbarBinding"
|
||||
layout="@layout/toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/skip_image_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/skip_image"
|
||||
|
|
@ -31,9 +37,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
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"
|
||||
|
|
@ -41,6 +44,17 @@
|
|||
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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue