Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/canary' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
siavash79 committed Jan 28, 2024
2 parents b6380cf + 5f732b1 commit 482f8b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,15 @@ private static void setPercentageColor(Object meterView, boolean updateLastColor
{
setAdditionalInstanceField(meterView, "lastPCTColor", mBatteryPercentView.getTextColors().getDefaultColor());
}
int lastPCTColor = getAdditionalInstanceField(meterView, "lastPCTColor") == null
? Color.BLACK
: (int) getAdditionalInstanceField(meterView, "lastPCTColor");

int color = BatteryDataProvider.isCharging()
? isDark(mBatteryPercentView.getTextColors().getDefaultColor())
? 0xFF048800 //dark green
: Color.GREEN
: (int) getAdditionalInstanceField(meterView, "lastPCTColor");
: lastPCTColor;

mBatteryPercentView.setTextColor(color);
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<string name="BB_batteryChargingColor">Charging color</string>
<string name="BB_batteryFastChargingColor">Fast charging color</string>
<string name="BB_transit_colors">Shade colors between this range</string>
<string name="colored_battery_percentage_title">Colored battery percentage while charging</string>

<string name="nt_stat_mode_today">Today</string>
<string name="nt_stat_mode_week">Current week</string>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/xml/statusbar_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@
app:tickInterval=".5"
app:valueCount="2" />

<sh.siava.pixelxpert.ui.preferences.MaterialSwitchPreference
android:defaultValue="false"
android:key="BatteryPercentIndicateCharging"
android:summaryOff="@string/general_off"
android:summaryOn="@string/general_on"
android:title="@string/colored_battery_percentage_title"
app:iconSpaceReserved="false" />

<sh.siava.pixelxpert.ui.preferences.MaterialSwitchPreference
android:defaultValue="false"
android:key="combinedSignalEnabled"
Expand Down

0 comments on commit 482f8b8

Please sign in to comment.