mirror of
https://gitea.winboll.cc/ZhanGSKen/MyWinBoLL.git
synced 2026-08-14 13:37:11 +08:00
e1428632e6
1. 新增 ChargeMailNotifyHelper 功能开关管理类 - 使用 SharedPreferences 持久化存储开关状态 - 提供静态方法 isEnabled() / setEnabled() 2. 新增 ChargeMailNotifyFloatWindow 悬浮窗工具类 - 单例模式(DCL双重检查锁) - show() 显示悬浮窗(带邮件图标) - dismissWindow() 静态方法供外部关闭悬浮窗 - 悬浮窗持续显示,仅在开关关闭时关闭 3. 修改 SettingsActivity 设置界面 - 新增充电邮件通知 Switch 开关(位于 SMTPConfigView 上方) - Switch 关闭时:禁用 SMTPConfigView、停止 RemindThread、关闭悬浮窗 - Switch 打开时:启用 SMTPConfigView 4. 修改 ControlCenterService 服务 - 服务启动时检查 ChargeMailNotify 功能状态 - 启用时显示悬浮窗提示充电邮件通知服务已启用 5. 修改 RemindThread 提醒线程 - 启动/停止 APPMSGMailRemindThread 前检查开关状态 - 仅在 ChargeMailNotify 启用时触发邮件提醒
237 lines
7.0 KiB
XML
237 lines
7.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<LinearLayout
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<cc.winboll.studio.libaes.views.ASupportToolbar
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/toolbar_height"
|
|
android:id="@+id/toolbar"
|
|
android:gravity="center_vertical"
|
|
style="@style/DefaultAToolbar"/>
|
|
|
|
<ScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1.0">
|
|
|
|
<LinearLayout
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<LinearLayout
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="right">
|
|
|
|
<LinearLayout
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
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="TTS语音服务设置:"
|
|
android:paddingLeft="10dp"/>
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="<仅限在切换充电状态时,发送的TTS语音提醒。用于提醒用户当前的服务设置状态。>"
|
|
android:textSize="12sp"
|
|
android:paddingLeft="10dp"
|
|
android:paddingRight="10dp"/>
|
|
|
|
<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"/>
|
|
|
|
<LinearLayout
|
|
android:orientation="horizontal"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="("
|
|
android:layout_marginLeft="10dp"/>
|
|
|
|
<CheckBox
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="用电TTS加入电量提醒"
|
|
android:onClick="onEnableUseageTtsWithBattary"
|
|
android:id="@+id/activitysettingsCheckBox3"/>
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text=")"
|
|
android:layout_marginLeft="20dp"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<CheckBox
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="充电提醒启用时的TTS贴心服务"
|
|
android:onClick="onEnableChargeTts"
|
|
android:id="@+id/activitysettingsCheckBox2"/>
|
|
|
|
<LinearLayout
|
|
android:orientation="horizontal"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="("
|
|
android:layout_marginLeft="10dp"/>
|
|
|
|
<CheckBox
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="充电TTS加入电量提醒"
|
|
android:onClick="onEnableChargeTtsWithBattary"
|
|
android:id="@+id/activitysettingsCheckBox4"/>
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text=")"
|
|
android:layout_marginLeft="20dp"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- 👉 你要的新选项:允许通知电量消息时同时播放TTS语音 -->
|
|
<CheckBox
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="允许通知电量消息时同时播放TTS语音"
|
|
android:onClick="onEnableTtsWhenNotifyBattery"
|
|
android:id="@+id/activitysettingsCheckBox5"/>
|
|
|
|
</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"
|
|
android:layout_marginRight="10dp"/>
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="10dp"
|
|
android:orientation="vertical"
|
|
android:background="@drawable/bg_frame"
|
|
android:padding="10dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical"
|
|
android:padding="5dp">
|
|
|
|
<TextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="充电邮件通知服务"
|
|
android:textSize="16sp"/>
|
|
|
|
<Switch
|
|
android:id="@+id/switchChargeMailNotify"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:onClick="onChargeMailNotifySwitchChanged"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="开启后,充电状态变化时将通过邮件发送通知"
|
|
android:textSize="12sp"
|
|
android:paddingLeft="5dp"
|
|
android:paddingBottom="5dp"/>
|
|
|
|
<cc.winboll.studio.libaes.views.SMTPConfigView
|
|
android:id="@+id/smtp_config_view"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="300dp"
|
|
android:orientation="vertical"
|
|
android:background="@drawable/bg_frame"
|
|
android:padding="10dp">
|
|
|
|
<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="电量图表绘制风格设置:"
|
|
android:paddingLeft="10dp"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<cc.winboll.studio.powerbell.views.BatteryStyleView
|
|
android:id="@+id/battery_style_view"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="1200dp"
|
|
app:batteryPreviewColor="@color/colorPrimary"
|
|
app:previewBatteryValue="100"
|
|
app:defaultSelectedStyle="zebra_style"/>
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
</ScrollView>
|
|
|
|
</LinearLayout>
|
|
|