Loading packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -917,6 +917,8 @@ <dimen name="edge_margin">8dp</dimen> <dimen name="rounded_corner_radius">0dp</dimen> <dimen name="rounded_corner_radius_top">0dp</dimen> <dimen name="rounded_corner_radius_bottom">0dp</dimen> <dimen name="rounded_corner_content_padding">0dp</dimen> <dimen name="nav_content_padding">0dp</dimen> <dimen name="nav_quick_scrub_track_edge_padding">42dp</dimen> Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +32 −9 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ public class ScreenDecorations extends SystemUI implements Tunable { SystemProperties.getBoolean("debug.screenshot_rounded_corners", false); private int mRoundedDefault; private int mRoundedDefaultTop; private int mRoundedDefaultBottom; private View mOverlay; private View mBottomOverlay; private float mDensity; Loading @@ -89,9 +91,14 @@ public class ScreenDecorations extends SystemUI implements Tunable { mWindowManager = mContext.getSystemService(WindowManager.class); mRoundedDefault = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius); if (mRoundedDefault != 0 || shouldDrawCutout()) { mRoundedDefaultTop = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius_top); mRoundedDefaultBottom = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius_bottom); if (hasRoundedCorners() || shouldDrawCutout()) { setupDecorations(); } int padding = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_content_padding); if (padding != 0) { Loading Loading @@ -208,11 +215,15 @@ public class ScreenDecorations extends SystemUI implements Tunable { private void updateWindowVisibility(View overlay) { boolean visibleForCutout = shouldDrawCutout() && overlay.findViewById(R.id.display_cutout).getVisibility() == View.VISIBLE; boolean visibleForRoundedCorners = mRoundedDefault > 0; boolean visibleForRoundedCorners = hasRoundedCorners(); overlay.setVisibility(visibleForCutout || visibleForRoundedCorners ? View.VISIBLE : View.GONE); } private boolean hasRoundedCorners() { return mRoundedDefault > 0 || mRoundedDefaultBottom > 0 || mRoundedDefaultTop > 0; } private boolean shouldDrawCutout() { return shouldDrawCutout(mContext); } Loading Loading @@ -284,14 +295,26 @@ public class ScreenDecorations extends SystemUI implements Tunable { if (mOverlay == null) return; if (SIZE.equals(key)) { int size = mRoundedDefault; int sizeTop = mRoundedDefaultTop; int sizeBottom = mRoundedDefaultBottom; if (newValue != null) { try { size = (int) (Integer.parseInt(newValue) * mDensity); } catch (Exception e) { } setSize(mOverlay.findViewById(R.id.left), size); setSize(mOverlay.findViewById(R.id.right), size); setSize(mBottomOverlay.findViewById(R.id.left), size); setSize(mBottomOverlay.findViewById(R.id.right), size); } if (sizeTop == 0) { sizeTop = size; } if (sizeBottom == 0) { sizeBottom = size; } setSize(mOverlay.findViewById(R.id.left), sizeTop); setSize(mOverlay.findViewById(R.id.right), sizeTop); setSize(mBottomOverlay.findViewById(R.id.left), sizeBottom); setSize(mBottomOverlay.findViewById(R.id.right), sizeBottom); } } Loading Loading
packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -917,6 +917,8 @@ <dimen name="edge_margin">8dp</dimen> <dimen name="rounded_corner_radius">0dp</dimen> <dimen name="rounded_corner_radius_top">0dp</dimen> <dimen name="rounded_corner_radius_bottom">0dp</dimen> <dimen name="rounded_corner_content_padding">0dp</dimen> <dimen name="nav_content_padding">0dp</dimen> <dimen name="nav_quick_scrub_track_edge_padding">42dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +32 −9 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ public class ScreenDecorations extends SystemUI implements Tunable { SystemProperties.getBoolean("debug.screenshot_rounded_corners", false); private int mRoundedDefault; private int mRoundedDefaultTop; private int mRoundedDefaultBottom; private View mOverlay; private View mBottomOverlay; private float mDensity; Loading @@ -89,9 +91,14 @@ public class ScreenDecorations extends SystemUI implements Tunable { mWindowManager = mContext.getSystemService(WindowManager.class); mRoundedDefault = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius); if (mRoundedDefault != 0 || shouldDrawCutout()) { mRoundedDefaultTop = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius_top); mRoundedDefaultBottom = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_radius_bottom); if (hasRoundedCorners() || shouldDrawCutout()) { setupDecorations(); } int padding = mContext.getResources().getDimensionPixelSize( R.dimen.rounded_corner_content_padding); if (padding != 0) { Loading Loading @@ -208,11 +215,15 @@ public class ScreenDecorations extends SystemUI implements Tunable { private void updateWindowVisibility(View overlay) { boolean visibleForCutout = shouldDrawCutout() && overlay.findViewById(R.id.display_cutout).getVisibility() == View.VISIBLE; boolean visibleForRoundedCorners = mRoundedDefault > 0; boolean visibleForRoundedCorners = hasRoundedCorners(); overlay.setVisibility(visibleForCutout || visibleForRoundedCorners ? View.VISIBLE : View.GONE); } private boolean hasRoundedCorners() { return mRoundedDefault > 0 || mRoundedDefaultBottom > 0 || mRoundedDefaultTop > 0; } private boolean shouldDrawCutout() { return shouldDrawCutout(mContext); } Loading Loading @@ -284,14 +295,26 @@ public class ScreenDecorations extends SystemUI implements Tunable { if (mOverlay == null) return; if (SIZE.equals(key)) { int size = mRoundedDefault; int sizeTop = mRoundedDefaultTop; int sizeBottom = mRoundedDefaultBottom; if (newValue != null) { try { size = (int) (Integer.parseInt(newValue) * mDensity); } catch (Exception e) { } setSize(mOverlay.findViewById(R.id.left), size); setSize(mOverlay.findViewById(R.id.right), size); setSize(mBottomOverlay.findViewById(R.id.left), size); setSize(mBottomOverlay.findViewById(R.id.right), size); } if (sizeTop == 0) { sizeTop = size; } if (sizeBottom == 0) { sizeBottom = size; } setSize(mOverlay.findViewById(R.id.left), sizeTop); setSize(mOverlay.findViewById(R.id.right), sizeTop); setSize(mBottomOverlay.findViewById(R.id.left), sizeBottom); setSize(mBottomOverlay.findViewById(R.id.right), sizeBottom); } } Loading