Fetch list title from second values in arguments (#3327)

Previous code was:

```
for (i in tabs.indices) {
    // ...
    if (tabs[i].id == LIST) {
        tab.contentDescription = tabs[i].arguments[1]
    } else {
        tab.setContentDescription(tabs[i].text)
    }
    // ...
```

When I converted it over, `i` was replaced with `position`, but I misread `tab.contentDescription = tabs[i].arguments[1]` as `tab.contentDescription = tabs[i].arguments[i]`.

Put the `1` back.
This commit is contained in:
Nik Clayton 2023-02-16 20:43:44 +01:00 committed by GitHub
parent ab364712fe
commit 52c98749e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -697,7 +697,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
tab: TabLayout.Tab, position: Int -> tab: TabLayout.Tab, position: Int ->
tab.icon = AppCompatResources.getDrawable(this@MainActivity, tabs[position].icon) tab.icon = AppCompatResources.getDrawable(this@MainActivity, tabs[position].icon)
tab.contentDescription = when (tabs[position].id) { tab.contentDescription = when (tabs[position].id) {
LIST -> tabs[position].arguments[position] LIST -> tabs[position].arguments[1]
else -> getString(tabs[position].text) else -> getString(tabs[position].text)
} }
}.also { it.attach() } }.also { it.attach() }