Skip to content
Snippets Groups Projects
Commit 931b3fa4 authored by Chenyang Zhong's avatar Chenyang Zhong Committed by FlowerSea0208
Browse files

mars: re-draw rounded corner vector assets


The current vector drawable was generated from an auto-traced svg
that was based on screen_round_corner_{top,bottom}.png in MIUI's
product/overlay/DevicesOverlay.apk. The problem is that the curve
edge in the png file is rasterized, which results in a vector asset
with jagged edges.

Here is what I did to re-draw the curve in native vectorized format:
- Open the png in PhotoShop and crop a corner with 1:1 square ratio
- Use the pen tool in shape mode to trace the black mask
- The corners on Mi 11 series are not perfect arcs. I had to add at
  least two adjust points to fit the original curve of the png file
- Fill the path with black
- Export as .svg. I had to convert the color mode to RGB without
  merging layers because PhotoShop wouldn't let me export svg in
  grayscale
- Import the svg in Android Studio as a vector asset
- Grab the content of the drawable .xml

Signed-off-by: default avatarChenyang Zhong <zhongcy95@gmail.com>
Change-Id: I2b5e8257e0987f6a975a4bf4cc7d971587510c08
parent d1f3740c
No related branches found
No related tags found
No related merge requests found
......@@ -5,13 +5,16 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<!-- Default radius of the software rounded corners. -->
<dimen name="rounded_corner_radius">194px</dimen>
<!-- Radius of the software rounded corners at the top of the display in its natural
orientation. If zero, the value of rounded_corner_radius is used. -->
<dimen name="rounded_corner_radius_top">196px</dimen>
<dimen name="rounded_corner_radius_top">243px</dimen>
<!-- Radius of the software rounded corners at the bottom of the display in its natural
orientation. If zero, the value of rounded_corner_radius is used. -->
<dimen name="rounded_corner_radius_bottom">172px</dimen>
<dimen name="rounded_corner_radius_bottom">194px</dimen>
<!-- Height of the status bar.
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
......
<!--
Copyright (C) 2016 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="194px"
android:height="194px"
android:viewportWidth="194"
android:viewportHeight="194">
<path
android:fillColor="#000000"
android:pathData="M0,0H194S123.711,-1.438 85,24C69.437,34.227 47.5,44.815 22,87 -2.227,127.084 0,194 0,194" />
</vector>
<!--
Copyright (C) 2016 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="194px"
android:height="194px"
android:viewportWidth="194"
android:viewportHeight="194">
<path
android:fillColor="#000000"
android:pathData="M0,0H194S123.711,-1.438 85,24C69.437,34.227 47.5,44.815 22,87 -2.227,127.084 0,194 0,194" />
</vector>
<!--
Copyright (C) 2016 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="243px"
android:height="243px"
android:viewportWidth="243"
android:viewportHeight="243">
<path
android:fillColor="#000000"
android:pathData="M0,0H243S159.3,-3.232 115,18C93.7,28.211 63.574,43.96 31,91 -5.328,143.462 0,243 0,243" />
</vector>
......@@ -6,6 +6,23 @@
-->
<resources>
<!-- 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">
M0,0H194S123.711,-1.438 85,24C69.437,34.227 47.5,44.815 22,87 -2.227,127.084 0,194 0,194
</string>
<!-- Respect drawable/rounded.xml intrinsic size for multiple radius corner path customization -->
<bool name="config_roundedCornerMultipleRadius">true</bool>
<!-- Allow CornerHandleView and PathSpecCornerPathRenderer to decouple from corner-radius -->
<dimen name="config_rounded_mask_size">194px</dimen>
<dimen name="config_rounded_mask_size_top">243px</dimen>
<dimen name="config_rounded_mask_size_bottom">194px</dimen>
<!-- The radius of the enrollment progress bar, in dp -->
<integer name="config_udfpsEnrollProgressBar" translatable="false">137</integer>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment