ReviewActivity.kt: simplify info icon code to work with some languages

Before this commit, if the language was set to a language that is read right to left,
pressing the info icon would crash the app with a NPE. This was because the Kotlin
code assumed that the icon would always be on the right of the skip button
(index 2 in the drawable array). When a right to left language was used, the icon
would be on the left and index 2 would be null.

This commit builds upon prior GUI changes. The info icon now has its own button.
Kotlin changes now remove the use of the drawable array to find the info icon and
instead directly references the new info icon button. The info icon button now works
properly for both left-to-right and right-to-left languages while maintaining correct
positioning.
This commit is contained in:
Jason Whitmore 2025-08-06 20:32:30 -07:00
parent 7318c8c273
commit 73d6236c6d

View file

@ -107,10 +107,8 @@ class ReviewActivity : BaseActivity() {
setUpMediaDetailFragment()
}
binding.skipImage.setOnTouchListener { _, event ->
if (event.action == MotionEvent.ACTION_UP &&
event.rawX >= (binding.skipImage.right - binding.skipImage.compoundDrawables[2].bounds.width())
) {
binding.skipImageInfo?.setOnTouchListener { _, event ->
if (event.action == MotionEvent.ACTION_UP) {
showSkipImageInfo()
true
} else {