Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Rally] Specify content description and role of tabs
  • Loading branch information
JolandaVerhoef committed Feb 16, 2021
commit 881c1280ccf7d5e27205abb0b9b7fadf4772130c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.example.compose.rally.RallyScreen
Expand Down Expand Up @@ -96,6 +98,7 @@ private fun RallyTab(
.selectable(
selected = selected,
onClick = onSelected,
role = Role.Tab,
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(
bounded = false,
Expand All @@ -104,10 +107,10 @@ private fun RallyTab(
)
)
) {
Icon(imageVector = icon, contentDescription = null, tint = tabTintColor)
Icon(imageVector = icon, contentDescription = text, tint = tabTintColor)
if (selected) {
Spacer(Modifier.width(12.dp))
Text(text, color = tabTintColor)
Text(text, color = tabTintColor, modifier = Modifier.clearAndSetSemantics {})
}
}
}
Expand Down