Moving AllApps device profile variables to their own class

Bug: 419264653
Flag: EXEMPT refactor
Test: DeviceProfileDumpTest
Test: All Image tests
Change-Id: I6490422d04f9f0aeaadf8271d4d11172f344660a
This commit is contained in:
Sebastian Franco
2025-05-27 18:06:08 -07:00
parent ec58354bf7
commit 136295f62a
18 changed files with 395 additions and 167 deletions
+10 -7
View File
@@ -273,15 +273,18 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setCenterVertically(mDeviceProfile.iconCenterVertically);
} else if (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW
|| mDisplay == DISPLAY_SEARCH_RESULT_APP_ROW) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, mDeviceProfile.allAppsIconTextSizePx);
setCompoundDrawablePadding(mDeviceProfile.allAppsIconDrawablePaddingPx);
defaultIconSize = mDeviceProfile.allAppsIconSizePx;
setTextSize(TypedValue.COMPLEX_UNIT_PX,
mDeviceProfile.getAllAppsProfile().getIconTextSizePx());
setCompoundDrawablePadding(
mDeviceProfile.getAllAppsProfile().getIconDrawablePaddingPx());
defaultIconSize = mDeviceProfile.getAllAppsProfile().getIconSizePx();
} else if (mDisplay == DISPLAY_FOLDER) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, mDeviceProfile.folderChildTextSizePx);
setCompoundDrawablePadding(mDeviceProfile.folderChildDrawablePaddingPx);
defaultIconSize = mDeviceProfile.folderChildIconSizePx;
} else if (mDisplay == DISPLAY_SEARCH_RESULT) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, mDeviceProfile.allAppsIconTextSizePx);
setTextSize(TypedValue.COMPLEX_UNIT_PX,
mDeviceProfile.getAllAppsProfile().getIconTextSizePx());
defaultIconSize = getResources().getDimensionPixelSize(R.dimen.search_row_icon_size);
} else if (mDisplay == DISPLAY_SEARCH_RESULT_SMALL) {
defaultIconSize = getResources().getDimensionPixelSize(
@@ -576,7 +579,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
switch (mDisplay) {
case DISPLAY_ALL_APPS, DISPLAY_PREDICTION_ROW -> {
return mDeviceProfile.maxAllAppsTextLineCount;
return mDeviceProfile.getAllAppsProfile().getMaxAllAppsTextLineCount();
}
case DISPLAY_WORKSPACE -> {
return mDeviceProfile.maxIconTextLineCount;
@@ -961,8 +964,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
// Only apply two line for all_apps and device search only if necessary.
if (shouldUseTwoLine() && (mLastOriginalText != null)) {
int allowedVerticalSpace = height - getPaddingTop() - getPaddingBottom()
- mDeviceProfile.allAppsIconSizePx
- mDeviceProfile.allAppsIconDrawablePaddingPx;
- mDeviceProfile.getAllAppsProfile().getIconSizePx()
- mDeviceProfile.getAllAppsProfile().getIconDrawablePaddingPx();
CharSequence modifiedString = modifyTitleToSupportMultiLine(
MeasureSpec.getSize(widthMeasureSpec) - getCompoundPaddingLeft()
- getCompoundPaddingRight(),