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

Commit db5cf5dc authored by d34d's avatar d34d Committed by Clark Scheff
Browse files

SysUI: Use VectorDrawable's for rendering battery

The current implementation of BatteryMeterView uses arrays of points
that are drawn programmatically.  This limits the ability to overlay
or theme the battery.  By utilizing VectorDrawables and
AnimatedVectorDrawables we can achieve the same look and feel of
stock while allowing for more unique battery meters.

Change-Id: I16a8a949a92827a9e8c1b528981031b6830e97cd
parent 548a36f4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -9,7 +9,8 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) \
LOCAL_STATIC_JAVA_LIBRARIES := Keyguard \
    org.cyanogenmod.platform.internal \
    android-support-v7-palette \
    android-support-v4
    android-support-v4 \
    uicommon

LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_FULL_LIBS_MANIFEST_FILES := $(LOCAL_PATH)/AndroidManifest_cm.xml
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The CyanogenMod 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.
-->
<objectAnimator
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:propertyName="trimPathEnd"
  android:valueFrom="0"
  android:valueTo="1"
  android:valueType="floatType"/>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The CyanogenMod 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.
-->
<objectAnimator
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:propertyName="pathData"
  android:valueFrom="@string/battery_landscape_path_empty"
  android:valueTo="@string/battery_landscape_path_full"
  android:valueType="pathType"/>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The CyanogenMod 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.
-->
<objectAnimator
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:propertyName="pathData"
  android:valueFrom="@string/battery_portrait_path_empty"
  android:valueTo="@string/battery_portrait_path_full"
  android:valueType="pathType"/>
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The CyanogenMod 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="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="@color/batterymeter_bolt_color">

    <path
        android:fillColor="#000000"
        android:pathData="M10.5,7h5l-2,4h3l-7,6l2-5H8.5L10.5,7z" />
</vector>
 No newline at end of file
Loading