forked from firka/firka
firka(android): add Wear OS support toggle in settings
This commit is contained in:
@@ -39,6 +39,7 @@ const liveActivityPrivacyEverDeclined = 1020;
|
|||||||
const morningNotificationEnabled = 1021;
|
const morningNotificationEnabled = 1021;
|
||||||
const morningNotificationTime = 1022;
|
const morningNotificationTime = 1022;
|
||||||
const ttToastABTimetable = 1023;
|
const ttToastABTimetable = 1023;
|
||||||
|
const wearOsSupport = 1024;
|
||||||
|
|
||||||
bool always() {
|
bool always() {
|
||||||
return true;
|
return true;
|
||||||
@@ -77,6 +78,14 @@ bool isMorningNotificationEnabled() {
|
|||||||
.boolean("morning_notification_enabled");
|
.boolean("morning_notification_enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isWearOsSupportEnabled() {
|
||||||
|
return Platform.isAndroid &&
|
||||||
|
initData.settings
|
||||||
|
.group("settings")
|
||||||
|
.subGroup("wear")
|
||||||
|
.boolean("wear_os_support");
|
||||||
|
}
|
||||||
|
|
||||||
bool isDebug() {
|
bool isDebug() {
|
||||||
return kDebugMode;
|
return kDebugMode;
|
||||||
}
|
}
|
||||||
@@ -346,6 +355,30 @@ class SettingsStore {
|
|||||||
always,
|
always,
|
||||||
null,
|
null,
|
||||||
),
|
),
|
||||||
|
"wear": SettingsSubGroup(
|
||||||
|
0,
|
||||||
|
FirkaIconType.majesticons,
|
||||||
|
Majesticon.clockSolid,
|
||||||
|
l10n.s_wear,
|
||||||
|
LinkedHashMap.of({
|
||||||
|
"back": SettingsBackHeader(0, l10n.s_settings, always),
|
||||||
|
"settings_header": SettingsHeader(0, l10n.s_wear, always),
|
||||||
|
"settings_padding": SettingsPadding(0, 23, always),
|
||||||
|
"wear_os_support": SettingsBoolean(
|
||||||
|
wearOsSupport,
|
||||||
|
FirkaIconType.majesticons,
|
||||||
|
Majesticon.clockSolid,
|
||||||
|
l10n.s_wear_os_support,
|
||||||
|
false,
|
||||||
|
always,
|
||||||
|
() async {
|
||||||
|
// Start/stop Wear sync service wired in WearSyncHelper task
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
isAndroid,
|
||||||
|
null,
|
||||||
|
),
|
||||||
"notifications": SettingsSubGroup(
|
"notifications": SettingsSubGroup(
|
||||||
0,
|
0,
|
||||||
FirkaIconType.majesticons,
|
FirkaIconType.majesticons,
|
||||||
|
|||||||
Reference in New Issue
Block a user