summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
index 69856151e41c..3d6cf2f9d1c1 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
@@ -187,10 +187,6 @@ object DeviceEntryIconViewBinder {
launch("$TAG#fpIconView.viewModel") {
fgViewModel.viewModel.collect { viewModel ->
Log.d(TAG, "Updating device entry icon image state $viewModel")
- fgIconView.setImageState(
- view.getIconState(viewModel.type, viewModel.useAodVariant),
- /* merge */ false,
- )
if (viewModel.type.contentDescriptionResId != -1) {
fgIconView.contentDescription =
fgIconView.resources.getString(
@@ -205,6 +201,14 @@ object DeviceEntryIconViewBinder {
viewModel.padding,
viewModel.padding,
)
+ // Set image state at the end after updating other view state. This
+ // method forces the ImageView to recompute the bounds of the drawable.
+ fgIconView.setImageState(
+ view.getIconState(viewModel.type, viewModel.useAodVariant),
+ /* merge */ false,
+ )
+ // Invalidate, just in case the padding changes just after icon changes
+ fgIconView.invalidate()
}
}
}