Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02c3dee5 authored by Gary Mai's avatar Gary Mai
Browse files

Fix adaptive shortcut icons

Use adaptive icon for the static add contact shortcut.
Add O specific shortcut icon size.
Instead of adding padding after already getting the drawable from
the letter avatars, scale the drawable down by the same percentage
to get the padding. This eliminates the extra transparent part around
the icons, which led to the launcher filling in with black.

Test: manually verified on Nexus 5X with O
(https://screenshot.googleplex.com/Pa1t37DqeNJ)
and Pixel with O
(https://screenshot.googleplex.com/qujpyze1Euz)
and Nexus 6P emulator running N
(https://screenshot.googleplex.com/1KWQPx8RZFC)
and Samsung Galaxy S7 running M
(https://screenshot.googleplex.com/J39VES1jT8o)

Bug: 37922561
Change-Id: I6573f91e5441333eda05ec2640dc5137890be317
parent f6075d02
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/ic_add_contact_shortcut_background"/>
    <foreground android:drawable="@drawable/ic_add_circle_24dp"/>
</adaptive-icon>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
        android:width="24dp"
        android:viewportHeight="192.0"
        android:viewportWidth="192.0">
  <path android:fillColor="#F5F5F5"
  <path android:fillColor="@color/ic_add_contact_shortcut_background"
        android:pathData="M96,8C47.38,8 8,47.38 8,96s39.38,88 88,88s88,-39.38 88,-88S144.62,8 96,8z"/>
  <path android:fillColor="#039BE5"
        android:pathData="M124,100h-24v24h-8v-24H68v-8h24V68h8v24h24V100z"/>
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->

<!-- A copy of ic_add_circle_24dp for use in pre O devices. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="24dp"
    android:width="24dp"
    android:viewportHeight="192.0"
    android:viewportWidth="192.0">
    <path android:fillColor="@color/ic_add_contact_shortcut_background"
        android:pathData="M96,8C47.38,8 8,47.38 8,96s39.38,88 88,88s88,-39.38 88,-88S144.62,8 96,8z"/>
    <path android:fillColor="#039BE5"
        android:pathData="M124,100h-24v24h-8v-24H68v-8h24V68h8v24h24V100z"/>
</vector>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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>
    <!-- On Android O, shortcut icons will be 108dp unmasked.
         See go/o-icons-eng for more details. -->
    <dimen name="shortcut_icon_size">108dp</dimen>
</resources>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
<resources>
    <!-- Adaptive icon background layer color -->
    <color name="ic_contacts_launcher_background">#2458CA</color>
    <color name="ic_add_contact_shortcut_background">#F5F5F5</color>

    <!-- 87% black -->
    <color name="quantum_black_text">#dd000000</color>
Loading