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

Commit ae2dcf03 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge remote-tracking branch 'origin/lineage-23.2' into a16.2

parents c5fb210a 188fd0d8
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.pipeline.battery.ui.composable
import android.graphics.Rect
import android.graphics.Rect
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableFloatStateOf
@@ -427,6 +428,7 @@ fun CircleBatteryBody(
    modifier: Modifier = Modifier,
    modifier: Modifier = Modifier,
    contentDescription: String = "",
    contentDescription: String = "",
) {
) {
    val colorError = MaterialTheme.colorScheme.error
    val textMeasurer = rememberTextMeasurer()
    val textMeasurer = rememberTextMeasurer()


    Canvas(modifier = modifier, contentDescription = contentDescription) {
    Canvas(modifier = modifier, contentDescription = contentDescription) {
@@ -445,7 +447,11 @@ fun CircleBatteryBody(
        // Draw colored arc representing charge level
        // Draw colored arc representing charge level
        if (level != null && level > 0) {
        if (level != null && level > 0) {
            drawArc(
            drawArc(
                colors.attribution,
                if (level <= 20 && attr !is BatteryGlyph.Bolt && attr !is BatteryGlyph.Plus) {
                    colorError
                } else {
                    colors.attribution
                },
                270f,
                270f,
                3.6f * level,
                3.6f * level,
                useCenter = false,
                useCenter = false,