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

Unverified Commit d9c55a56 authored by LuK1337's avatar LuK1337 Committed by Michael Bestas
Browse files

SystemUI: Show bluetooth battery level



* Somewhat inspired by change committed by Gavin Ni <gisngy@gmail.com>
  back in cm-13.0 days (see commit 88e7a6c7). Since then completely
  rewritten using BluetoothDevice API introduced in Oreo, with new
  drawables meant to be used with 0-9 battery level range.

Co-authored-by: default avatarLuca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: I34344907711b7b9fc4c1d15d4516bd53bf30ebb2
parent de5eddf9
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
*/
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="20dp"
        android:height="17dp"
        android:viewportWidth="21.0"
        android:viewportHeight="18.0">
    <group
        android:scaleX="0.75"
        android:scaleY="0.75">
        <path
            android:fillColor="@android:color/white"
            android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M19,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
    </group>
    <group
        android:translateY="0.5"
        android:translateX="0.5" >
        <path
            android:pathData="M15.77,1.064V15.94h3V1.064Z"
            android:fillColor="#4DFFFFFF"/>
        <path
            android:pathData="M15.77,15.3V15.94h3V15.3Z"
            android:fillColor="#FFFFFF"/>
    </group>
</vector>
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
*/
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="20dp"
        android:height="17dp"
        android:viewportWidth="21.0"
        android:viewportHeight="18.0">
    <group
        android:scaleX="0.75"
        android:scaleY="0.75">
        <path
            android:fillColor="@android:color/white"
            android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M19,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
    </group>
    <group
        android:translateY="0.5"
        android:translateX="0.5" >
        <path
            android:pathData="M15.77,1.064V15.94h3V1.064Z"
            android:fillColor="#4DFFFFFF"/>
        <path
            android:pathData="M15.77,13.6V15.94h3V13.6Z"
            android:fillColor="#FFFFFF"/>
    </group>
</vector>
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
*/
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="20dp"
        android:height="17dp"
        android:viewportWidth="21.0"
        android:viewportHeight="18.0">
    <group
        android:scaleX="0.75"
        android:scaleY="0.75">
        <path
            android:fillColor="@android:color/white"
            android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M19,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
    </group>
    <group
        android:translateY="0.5"
        android:translateX="0.5" >
        <path
            android:pathData="M15.77,1.064V15.94h3V1.064Z"
            android:fillColor="#4DFFFFFF"/>
        <path
            android:pathData="M15.77,11.9V15.94h3V11.9Z"
            android:fillColor="#FFFFFF"/>
    </group>
</vector>
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
*/
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="20dp"
        android:height="17dp"
        android:viewportWidth="21.0"
        android:viewportHeight="18.0">
    <group
        android:scaleX="0.75"
        android:scaleY="0.75">
        <path
            android:fillColor="@android:color/white"
            android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M19,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
    </group>
    <group
        android:translateY="0.5"
        android:translateX="0.5" >
        <path
            android:pathData="M15.77,1.064V15.94h3V1.064Z"
            android:fillColor="#4DFFFFFF"/>
        <path
            android:pathData="M15.77,10.2V15.94h3V10.2Z"
            android:fillColor="#FFFFFF"/>
    </group>
</vector>
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
*/
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="20dp"
        android:height="17dp"
        android:viewportWidth="21.0"
        android:viewportHeight="18.0">
    <group
        android:scaleX="0.75"
        android:scaleY="0.75">
        <path
            android:fillColor="@android:color/white"
            android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
        <path
            android:fillColor="@android:color/white"
            android:pathData="M19,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
    </group>
    <group
        android:translateY="0.5"
        android:translateX="0.5" >
        <path
            android:pathData="M15.77,1.064V15.94h3V1.064Z"
            android:fillColor="#4DFFFFFF"/>
        <path
            android:pathData="M15.77,8.5V15.94h3V8.5Z"
            android:fillColor="#FFFFFF"/>
    </group>
</vector>
Loading