Customize for S/W anti-aliasing of rounded corner on Redfin

1. H/W Camera center(77,77) and radius=39px, size(78x78)
2. Punch Edge (L,T,R,B): (42, 39, 120,39, 116)
3. Rounded corner edge 156x156 to prevent jegged edge
4. Redfin density ratio = 440 / 160 = 2.75
5. H/W corner radious are different between top & bottom

Test: manual
Bug: 143222961
Change-Id: Iad58b86101a4d5666d9aa7000d66ce33f3d40247
This commit is contained in:
Bill Lin 2020-03-24 18:35:49 +08:00 committed by Cyan_Hsieh
parent 0168963937
commit 3a3e31c0f1
4 changed files with 119 additions and 6 deletions

View File

@ -123,12 +123,43 @@
<!-- Whether or not we should show the option to show battery percentage -->
<bool name="config_battery_percentage_setting_available">true</bool>
<!-- Default radius of the software rounded corners. -->
<dimen name="rounded_corner_radius">140px</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_height_portrait">28dp</dimen>
<!-- Whether or not wcg mode should be enabled on this device -->
<bool name="config_enableWcgMode">true</bool>
<!-- Whether the display cutout region of the main built-in display should be forced to
black in software (to avoid aliasing or emulate a cutout that is not physically existent).
-->
<bool name="config_fillMainBuiltInDisplayCutout">true</bool>
<!-- Display cutout configuration -->
<string translatable="false" name="config_mainBuiltInDisplayCutout">
<!-- The hole punch dimensions are this:
M 42,77 a 39,39 0 1,0 78,0 a 39,39 0 1,0 -78,0
but using a radius 40 circle for now to see the antialiasing.
-->
M 41,77 a 40,40 0 1 0 80,0 40,40 0 1 0 -80,0 Z
@left
</string>
<string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation">
M 0.0,0.0
h 136
v 136
h -136
Z
@left
</string>
<!-- Radius of the software rounded corners. -->
<dimen name="rounded_corner_radius">108px</dimen>
<!-- Height of the status bar in portrait. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
<dimen name="status_bar_height_portrait">136px</dimen>
<dimen name="status_bar_height_landscape">28dp</dimen>
<!-- Height of area above QQS where battery/time go (equal to status bar) -->
<dimen name="quick_qs_offset_height">136px</dimen>
<!-- Total height of QQS (quick_qs_offset_height + 128) -->
<dimen name="quick_qs_total_height">488px</dimen>
</resources>

View File

@ -0,0 +1,23 @@
<!--
Copyright (C) 2020 The Android Open Source Project
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="156px"
android:height="156px"
android:viewportWidth="156.0"
android:viewportHeight="156.0">
<path
android:pathData="M 0,0 V 156 C 4,76 5,58 31,31 58,5 76,4 156,0 Z"
android:fillColor="#000000" />
</vector>

View File

@ -64,4 +64,26 @@
<item>0</item> <!-- 3: HIGH -->
<item>0</item> <!-- 4: SUN -->
</integer-array>
<!-- Default rounded corner curve (a Bezier). Must match (the curved path in) rounded.xml.
Note that while rounded.xml includes the entire path (including the horizontal and vertical
corner edges), this pulls out just the curve.
-->
<string name="config_rounded_mask" translatable="false">M156,0 C76,4 58,5 31,31 5,58 4,76 0,156</string>
<bool name="config_roundedCornerMultipleRadius">true</bool>
<!-- Configure 13px of extra protection around the front-facing camera -->
<string translatable="false" name="config_frontBuiltInDisplayCutoutProtection">
M 29,77
a 52,52 0 1 0 104,0
a 52,52 0 1 0 -104,0
Z
</string>
<!-- Camera 1 is the front camera on bramble -->
<string translatable="false" name="config_protectedCameraId">1</string>
<bool name="config_enableDisplayCutoutProtection">true</bool>
</resources>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2020, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<resources>
<!-- Don't need the left side padding due to being inset from the cutout -->
<dimen name="status_bar_padding_start">0dp</dimen>
<!-- for 20dp of padding at 3.5px/dp at default density -->
<dimen name="rounded_corner_content_padding">50px</dimen>
<!-- the padding on the top of the statusbar (usually 0) -->
<dimen name="status_bar_padding_top">1dp</dimen>
<!-- Padding for the system icons on the keyguard (when no multi user switch is showing).
The icons always have a 4dp padding in the container so we only need 56 extra px of padding
for the corners -->
<dimen name="system_icons_super_container_avatarless_margin_end">56px</dimen>
<!-- Multi user switch has some intrinsic padding to it -->
<dimen name="multi_user_switch_keyguard_margin">40px</dimen>
<dimen name="keyguard_carrier_text_margin">0px</dimen>
<dimen name="config_rounded_mask_size">156px</dimen>
<dimen name="config_rounded_mask_size_top">156px</dimen>
<dimen name="config_rounded_mask_size_bottom">156px</dimen>
</resources>