Set iconsSizePx of Taskbar's DeviceProfile directly

- After ag/20691430, iconScale no longer scale app icons (I should rename it later, after QPR2), so we'll need to set the desired iconSize directly for Taskbar's DeviceProfile
- Extracted setting iconSizePx and testSizePx out of updateIconSize, as they are no longer affected by scaling. This allows TaskbarActivityContext to set desired iconsize and then call updateIconSize

Bug: 256976071
Test: Test Taskbar icon size in different density
Change-Id: I741c178b59e0d8ecb4c63689e68767622329379c
This commit is contained in:
Alex Chau committed 2022-12-15 17:05:12 +00:00
1 parent 3ad5eef4b8
commit a68164d89e
2 files changed
+12 -14

No files matched your search

@@ -270,14 +270,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
}
private void updateIconSize(Resources resources) {
float taskbarIconSize = resources.getDimension(DisplayController.isTransientTaskbar(this)
? mDeviceProfile.isTwoPanels
? R.dimen.transient_taskbar_two_panels_icon_size
: R.dimen.transient_taskbar_icon_size
: R.dimen.taskbar_icon_size);
mDeviceProfile.updateIconSize(1, resources);
float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx;
mDeviceProfile.updateIconSize(iconScale, resources);
mDeviceProfile.iconSizePx = resources.getDimensionPixelSize(
DisplayController.isTransientTaskbar(this)
? mDeviceProfile.isTwoPanels
? R.dimen.transient_taskbar_two_panels_icon_size
: R.dimen.transient_taskbar_icon_size
: R.dimen.taskbar_icon_size);
mDeviceProfile.updateIconSize(1f, resources);
}
/**