Compare commits
7 Commits
powerbell-
...
powerbell-
| Author | SHA1 | Date | |
|---|---|---|---|
| a98c9e4214 | |||
| cc7bbcf2a6 | |||
| 8da6162632 | |||
| 02c135fd8c | |||
| 2f42334f19 | |||
| 10348d2c8d | |||
| 21cdc219c8 |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Dec 29 21:40:10 HKT 2025
|
#Tue Dec 30 20:07:05 HKT 2025
|
||||||
stageCount=42
|
stageCount=45
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.14
|
baseVersion=15.14
|
||||||
publishVersion=15.14.41
|
publishVersion=15.14.44
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.14.42
|
baseBetaVersion=15.14.45
|
||||||
|
|||||||
@@ -36,9 +36,10 @@ public class ControlCenterServiceReceiver extends BroadcastReceiver {
|
|||||||
private static final int BROADCAST_PRIORITY = IntentFilter.SYSTEM_HIGH_PRIORITY - 10;
|
private static final int BROADCAST_PRIORITY = IntentFilter.SYSTEM_HIGH_PRIORITY - 10;
|
||||||
private static final int BATTERY_LEVEL_MIN = 0;
|
private static final int BATTERY_LEVEL_MIN = 0;
|
||||||
private static final int BATTERY_LEVEL_MAX = 100;
|
private static final int BATTERY_LEVEL_MAX = 100;
|
||||||
|
private static final int INVALID_BATTERY = -1; // 无效电量标识
|
||||||
|
|
||||||
// ====================== 静态状态标记(volatile保证多线程可见性) ======================
|
// ====================== 静态状态标记(volatile保证多线程可见性) ======================
|
||||||
private static volatile int sLastBatteryLevel = -1; // 上次电量(多线程可见)
|
private static volatile int sLastBatteryLevel = INVALID_BATTERY; // 上次电量(多线程可见)
|
||||||
private static volatile boolean sIsCharging = false; // 上次充电状态(多线程可见)
|
private static volatile boolean sIsCharging = false; // 上次充电状态(多线程可见)
|
||||||
|
|
||||||
// ====================== 成员变量区(弱引用防泄漏,按功能分层) ======================
|
// ====================== 成员变量区(弱引用防泄漏,按功能分层) ======================
|
||||||
@@ -113,7 +114,8 @@ public class ControlCenterServiceReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 在插拔充电线时,执行贴心服务
|
// 在插拔充电线时,执行贴心服务
|
||||||
if(currentCharging != sIsCharging) {
|
if(currentCharging != sIsCharging && sLastBatteryLevel != INVALID_BATTERY) {
|
||||||
|
//App.notifyMessage(TAG, String.format("sLastBatteryLevel %d", sLastBatteryLevel));
|
||||||
if(currentCharging) {
|
if(currentCharging) {
|
||||||
ThoughtfulService.startServiceWithType(service, ThoughtfulService.ServiceType.CHARGE_STATE);
|
ThoughtfulService.startServiceWithType(service, ThoughtfulService.ServiceType.CHARGE_STATE);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class ThoughtfulService extends Service {
|
|||||||
|
|
||||||
if (latestConfig.isEnableChargeReminder()) {
|
if (latestConfig.isEnableChargeReminder()) {
|
||||||
int nChargeReminderValue = latestConfig.getChargeReminderValue();
|
int nChargeReminderValue = latestConfig.getChargeReminderValue();
|
||||||
String szRemind = String.format("额定充电提醒已启用,额定值为百分之%d。", nChargeReminderValue);
|
String szRemind = String.format("限量充电提醒已启用,限量值为百分之%d。", nChargeReminderValue);
|
||||||
szRemind = szRemind + szRemind + szRemind;
|
szRemind = szRemind + szRemind + szRemind;
|
||||||
TTSPlayService.startPlayTTS(this, szRemind);
|
TTSPlayService.startPlayTTS(this, szRemind);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,55 +22,104 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="用电提醒启用时的TTS贴心服务"
|
|
||||||
android:onClick="onEnableUsePowerTts"
|
|
||||||
android:id="@+id/activitysettingsCheckBox1"/>
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="充电提醒启用时的TTS贴心服务"
|
|
||||||
android:onClick="onEnableChargeTts"
|
|
||||||
android:id="@+id/activitysettingsCheckBox2"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:background="@drawable/bg_frame"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="检查TTS语音悬浮窗权限"
|
android:text="TTS语音服务设置:"/>
|
||||||
android:padding="10dp"
|
|
||||||
android:onClick="onCheckTTSDrawOverlaysPermission"/>
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="<仅限在切换充电状态时,发送的TTS语音提醒。用于提醒用户当前的服务设置状态。>"
|
||||||
|
android:textSize="12sp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="用电提醒启用时的TTS贴心服务"
|
||||||
|
android:onClick="onEnableUsePowerTts"
|
||||||
|
android:id="@+id/activitysettingsCheckBox1"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="充电提醒启用时的TTS贴心服务"
|
||||||
|
android:onClick="onEnableChargeTts"
|
||||||
|
android:id="@+id/activitysettingsCheckBox2"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="检查TTS语音悬浮窗权限"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:onClick="onCheckTTSDrawOverlaysPermission"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ADsControlView
|
<LinearLayout
|
||||||
android:id="@+id/ads_control_view"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_frame"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="米盟广告SDK设置:"/>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.ADsControlView
|
||||||
|
android:id="@+id/ads_control_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@drawable/bg_frame"
|
||||||
|
android:padding="10dp"
|
||||||
android:layout_weight="1.0">
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="电量图表绘制风格设置:"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<cc.winboll.studio.powerbell.views.BatteryStyleView
|
<cc.winboll.studio.powerbell.views.BatteryStyleView
|
||||||
android:id="@+id/battery_style_view"
|
android:id="@+id/battery_style_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="1200dp"
|
||||||
app:batteryPreviewColor="@color/colorPrimary"
|
app:batteryPreviewColor="@color/colorPrimary"
|
||||||
app:previewBatteryValue="100"
|
app:previewBatteryValue="100"
|
||||||
app:defaultSelectedStyle="zebra_style"/>
|
app:defaultSelectedStyle="zebra_style"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user