Commit 7d5197e2 authored by Mygod's avatar Mygod

Improve accessibility for service button

parent bfaf0245
......@@ -81,7 +81,9 @@ class ServiceButton @JvmOverloads constructor(context: Context, attrs: Attribute
}
checked = state == BaseService.State.Connected
refreshDrawableState()
TooltipCompat.setTooltipText(this, context.getString(if (state.canStop) R.string.stop else R.string.connect))
val description = context.getText(if (state.canStop) R.string.stop else R.string.connect)
contentDescription = description
TooltipCompat.setTooltipText(this, description)
val enabled = state.canStop || state == BaseService.State.Stopped
isEnabled = enabled
if (Build.VERSION.SDK_INT >= 24) pointerIcon = PointerIcon.getSystemIcon(context,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment