Ccb reset tint on Img src change(#328)
This commit is contained in:
Родитель
08ab38f6c6
Коммит
6ca47840f4
|
@ -198,6 +198,23 @@ class ContextualCommandBarActivity : DemoActivity() {
|
|||
)
|
||||
}
|
||||
update_item.setOnClickListener {
|
||||
val updatedItemGroup = CommandItemGroup()
|
||||
.addItem(
|
||||
DefaultCommandItem(
|
||||
R.drawable.ic_fluent_mention_24_regular,
|
||||
contentDescription = getString(R.string.contextual_command_accessibility_mention),
|
||||
enabled = false
|
||||
)
|
||||
)
|
||||
.addItem(
|
||||
DefaultCommandItem(
|
||||
bitmap = bitmap,
|
||||
contentDescription = getString(R.string.contextual_command_accessibility_add)
|
||||
)
|
||||
)
|
||||
itemGroups[0] = updatedItemGroup
|
||||
contextual_command_bar_default.setItemGroups(itemGroups)
|
||||
|
||||
(itemGroups[0].items[0] as DefaultCommandItem).setEnabled(false)
|
||||
(itemGroups[0].items[1] as DefaultCommandItem).setEnabled(true)
|
||||
(itemGroups[0].items[1] as DefaultCommandItem).setSelected(true)
|
||||
|
|
|
@ -90,6 +90,7 @@ internal class CommandItemAdapter(
|
|||
viewHolder.label.isVisible = false
|
||||
with(viewHolder.icon) {
|
||||
isVisible = true
|
||||
imageTintList = null
|
||||
setImageBitmap(bitmapIcon)
|
||||
contentDescription = description
|
||||
isEnabled = isItemEnabled
|
||||
|
|
Загрузка…
Ссылка в новой задаче