Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt +8 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,14 @@ object ActionButtonViewBinder { // models would remove/create separate views. drawable?.setIcon(viewModel.appearance.icon) textView.text = viewModel.appearance.label viewModel.appearance.customBackground?.also { if (it.canApplyTheme()) { it.applyTheme(view.rootView.context.theme) } view.background = it } setMargins(iconView, textView, viewModel.appearance.label?.isNotEmpty() ?: false) if (viewModel.onClicked != null) { view.setOnClickListener { viewModel.onClicked.invoke() } Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt +4 −1 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.screenshot.ui.viewmodel import android.graphics.drawable.Drawable /** Data describing how an action should be shown to the user. */ data class ActionButtonAppearance( data class ActionButtonAppearance @JvmOverloads constructor( val icon: Drawable?, val label: CharSequence?, val description: CharSequence, val customBackground: Drawable? = null, ) Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt +8 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,14 @@ object ActionButtonViewBinder { // models would remove/create separate views. drawable?.setIcon(viewModel.appearance.icon) textView.text = viewModel.appearance.label viewModel.appearance.customBackground?.also { if (it.canApplyTheme()) { it.applyTheme(view.rootView.context.theme) } view.background = it } setMargins(iconView, textView, viewModel.appearance.label?.isNotEmpty() ?: false) if (viewModel.onClicked != null) { view.setOnClickListener { viewModel.onClicked.invoke() } Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt +4 −1 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.screenshot.ui.viewmodel import android.graphics.drawable.Drawable /** Data describing how an action should be shown to the user. */ data class ActionButtonAppearance( data class ActionButtonAppearance @JvmOverloads constructor( val icon: Drawable?, val label: CharSequence?, val description: CharSequence, val customBackground: Drawable? = null, )