mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
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:
parent
7318c8c273
commit
73d6236c6d
1 changed files with 2 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue