Moving DeviceProfile properties into DeviceProperties data class
Bug: 419264653 Flag: EXEMPT refactor Test: DeviceProfileDumpTest Test: All Image tests Change-Id: I638f88cd76b926917965dbf9e70b5bdfff5971e0
This commit is contained in:
1 parent
48e7365190
commit
e1111e28c2
127 files changed
+726
-596
No files matched your search
@@ -1048,9 +1048,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
|
||||
// If SUW is on a large screen device that is landscape (or has a square aspect
|
||||
// ratio) the back button has to be placed accordingly
|
||||
if ((deviceProfile.isTablet && deviceProfile.isLandscape)
|
||||
|| (deviceProfile.aspectRatio > SQUARE_ASPECT_RATIO_BOTTOM_BOUND
|
||||
&& deviceProfile.aspectRatio < SQUARE_ASPECT_RATIO_UPPER_BOUND)) {
|
||||
if ((deviceProfile.getDeviceProperties().isTablet() && deviceProfile.getDeviceProperties().isLandscape())
|
||||
|| (deviceProfile.getDeviceProperties().getAspectRatio() > SQUARE_ASPECT_RATIO_BOTTOM_BOUND
|
||||
&& deviceProfile.getDeviceProperties().getAspectRatio() < SQUARE_ASPECT_RATIO_UPPER_BOUND)) {
|
||||
navButtonsLayoutParams.setMarginStart(
|
||||
resources.getDimensionPixelSize(R.dimen.taskbar_back_button_suw_start_margin));
|
||||
navButtonsViewLayoutParams.bottomMargin = resources.getDimensionPixelSize(
|
||||
@@ -1061,7 +1061,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
int phoneOrPortraitSetupMargin = resources.getDimensionPixelSize(
|
||||
R.dimen.taskbar_contextual_button_suw_margin);
|
||||
navButtonsLayoutParams.setMarginStart(phoneOrPortraitSetupMargin);
|
||||
navButtonsLayoutParams.bottomMargin = !deviceProfile.isLandscape
|
||||
navButtonsLayoutParams.bottomMargin = !deviceProfile.getDeviceProperties().isLandscape()
|
||||
? 0
|
||||
: phoneOrPortraitSetupMargin - (resources.getDimensionPixelSize(
|
||||
R.dimen.taskbar_nav_buttons_size) / 2);
|
||||
@@ -1427,7 +1427,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
// If the taskbar is start aligned the navigation bar is aligned to the start or end of
|
||||
// the container, depending on the bubble bar location
|
||||
if (isNavbarOnRight) {
|
||||
navBarTargetStartX = dp.widthPx - navBarSpacing - mNavButtonContainer.getWidth();
|
||||
navBarTargetStartX = dp.getDeviceProperties().getWidthPx() - navBarSpacing - mNavButtonContainer.getWidth();
|
||||
} else {
|
||||
navBarTargetStartX = navBarSpacing;
|
||||
}
|
||||
@@ -1440,7 +1440,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
if (isNavbarOnRight) {
|
||||
if (mNavButtonsView.isLayoutRtl()) {
|
||||
float taskBarEnd = taskbarBounds.right;
|
||||
navBarTargetStartX = (dp.widthPx + taskBarEnd - navbarWidth) / 2;
|
||||
navBarTargetStartX = (dp.getDeviceProperties().getWidthPx() + taskBarEnd - navbarWidth) / 2;
|
||||
} else {
|
||||
navBarTargetStartX = mNavButtonContainer.getLeft();
|
||||
}
|
||||
@@ -1458,7 +1458,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
// screen.
|
||||
Rect transientTaskbarIconLayoutBoundsInParent = mControllers.taskbarViewController
|
||||
.getTransientTaskbarIconLayoutBoundsInParent();
|
||||
if (mContext.getDeviceProfile().isPhone
|
||||
if (mContext.getDeviceProfile().getDeviceProperties().isPhone()
|
||||
|| transientTaskbarIconLayoutBoundsInParent.isEmpty()
|
||||
|| mNavButtonsView.getWidth() == 0) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user