Added function Live Activity Color change, Fixes
This commit is contained in:
@@ -261,6 +261,13 @@ class SettingsHelper {
|
||||
);
|
||||
}
|
||||
|
||||
static void liveActivityColor(BuildContext context) {
|
||||
showRoundedModalBottomSheet(
|
||||
context,
|
||||
child: const LiveActivityColorSetting(),
|
||||
);
|
||||
}
|
||||
|
||||
static void vibrate(BuildContext context) {
|
||||
showBottomSheetMenu(
|
||||
context,
|
||||
@@ -607,3 +614,67 @@ class _GradeColorsSettingState extends State<GradeColorsSetting> {
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class LiveActivityColorSetting extends StatefulWidget {
|
||||
const LiveActivityColorSetting({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LiveActivityColorSettingState createState() =>
|
||||
_LiveActivityColorSettingState();
|
||||
}
|
||||
|
||||
class _LiveActivityColorSettingState extends State<LiveActivityColorSetting> {
|
||||
late SettingsProvider settings;
|
||||
Color currentColor = const Color(0x00000000);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
settings = Provider.of<SettingsProvider>(context, listen: false);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: Column(children: [
|
||||
MaterialColorPicker(
|
||||
allowShades: false,
|
||||
selectedColor: settings.liveActivityColor,
|
||||
onMainColorChange: (k) {
|
||||
setState(() {
|
||||
currentColor = k as Color;
|
||||
settings.update(
|
||||
liveActivityColor: currentColor.withAlpha(255));
|
||||
Navigator.of(context).maybePop();
|
||||
});
|
||||
},
|
||||
elevation: 0,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0, top: 40.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
MaterialActionButton(
|
||||
onPressed: () {
|
||||
var defaultColors =
|
||||
SettingsProvider.defaultSettings().liveActivityColor;
|
||||
settings.update(liveActivityColor: defaultColors);
|
||||
Navigator.of(context).maybePop();
|
||||
},
|
||||
child: Text(SettingsLocalization("reset").i18n),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,6 +712,25 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
),
|
||||
),
|
||||
const PremiumIconPackSelector(),
|
||||
// If iOS, show the iOS specific settings
|
||||
|
||||
if (defaultTargetPlatform == TargetPlatform.iOS)
|
||||
PanelButton(
|
||||
onPressed: () {
|
||||
SettingsHelper.liveActivityColor(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: Text("live_activity_color".i18n),
|
||||
leading: const Icon(FeatherIcons.activity),
|
||||
trailing: Container(
|
||||
width: 12.0,
|
||||
height: 12.0,
|
||||
decoration: BoxDecoration(
|
||||
color: settings.liveActivityColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -25,6 +25,7 @@ extension SettingsLocalization on String {
|
||||
"theme": "Theme",
|
||||
"color": "Color",
|
||||
"grade_colors": "Grade Colors",
|
||||
"live_activity_color": "Live Activity Color",
|
||||
"notifications": "Notifications",
|
||||
"news": "News",
|
||||
"extras": "Extras",
|
||||
@@ -94,6 +95,7 @@ extension SettingsLocalization on String {
|
||||
"theme": "Téma",
|
||||
"color": "Színek",
|
||||
"grade_colors": "Jegyek színei",
|
||||
"live_activity_color": "Live Activity színe",
|
||||
"notifications": "Értesítések",
|
||||
"news": "Hírek",
|
||||
"extras": "Extrák",
|
||||
@@ -163,6 +165,7 @@ extension SettingsLocalization on String {
|
||||
"theme": "Thema",
|
||||
"color": "Farbe",
|
||||
"grade_colors": "Grad Farben",
|
||||
"live_activity_color": "Live Activity Farben",
|
||||
"notifications": "Mitteilung",
|
||||
"news": "Nachrichten",
|
||||
"extras": "Extras",
|
||||
|
||||
Reference in New Issue
Block a user