From d9ec195233e46656702b9ccc5e7c7956bf71df23 Mon Sep 17 00:00:00 2001 From: Kima Date: Wed, 27 Mar 2024 21:11:09 +0100 Subject: [PATCH] fix fix fix --- .../ui/flutter_colorpicker/colorpicker.dart | 3 +- .../lib/ui/flutter_colorpicker/palette.dart | 2 +- .../settings/notifications_screen.dart | 2 +- .../settings/settings_screen.i18n.dart | 6 +- .../settings/submenu/general_screen.dart | 145 +++++++++++++----- .../settings/submenu/personalize_screen.dart | 106 +++++++++---- 6 files changed, 188 insertions(+), 76 deletions(-) diff --git a/refilc/lib/ui/flutter_colorpicker/colorpicker.dart b/refilc/lib/ui/flutter_colorpicker/colorpicker.dart index 53d1661..783f363 100644 --- a/refilc/lib/ui/flutter_colorpicker/colorpicker.dart +++ b/refilc/lib/ui/flutter_colorpicker/colorpicker.dart @@ -174,7 +174,8 @@ class FilcColorPickerState extends State { fontWeight: FontWeight.w600)), backgroundColor: AppColors.of(context).background)); }, - displayThumbColor: widget.displayThumbColor, + // displayThumbColor: widget.displayThumbColor, + displayThumbColor: true, ); } diff --git a/refilc/lib/ui/flutter_colorpicker/palette.dart b/refilc/lib/ui/flutter_colorpicker/palette.dart index fd39f08..3571a86 100644 --- a/refilc/lib/ui/flutter_colorpicker/palette.dart +++ b/refilc/lib/ui/flutter_colorpicker/palette.dart @@ -275,7 +275,7 @@ class ThumbPainter extends CustomPainter { if (thumbColor != null) { canvas.drawCircle( Offset(0.0, size.height * 0.4), - size.height * (fullThumbColor ? 1.0 : 0.65), + size.height * (fullThumbColor ? 1.0 : 0.75), Paint() ..color = thumbColor! ..style = PaintingStyle.fill); diff --git a/refilc_mobile_ui/lib/screens/settings/notifications_screen.dart b/refilc_mobile_ui/lib/screens/settings/notifications_screen.dart index 5aeae16..0167da7 100644 --- a/refilc_mobile_ui/lib/screens/settings/notifications_screen.dart +++ b/refilc_mobile_ui/lib/screens/settings/notifications_screen.dart @@ -263,7 +263,7 @@ class NotificationsScreen extends StatelessWidget { ), borderRadius: const BorderRadius.vertical( top: Radius.circular(12.0), - bottom: Radius.circular(4.0)), + bottom: Radius.circular(12.0)), ) ], ) diff --git a/refilc_mobile_ui/lib/screens/settings/settings_screen.i18n.dart b/refilc_mobile_ui/lib/screens/settings/settings_screen.i18n.dart index 732f296..dcf54fa 100644 --- a/refilc_mobile_ui/lib/screens/settings/settings_screen.i18n.dart +++ b/refilc_mobile_ui/lib/screens/settings/settings_screen.i18n.dart @@ -147,9 +147,9 @@ extension SettingsLocalization on String { "privacy": "Adatvédelmi irányelvek", "licenses": "Licencek", "vibrate": "Rezgés", - "voff": "Kikapcsolás", - "vlight": "Alacsony", - "vmedium": "Közepes", + "voff": "Ki", + "vlight": "Gyenge", + "vmedium": "Normál", "vstrong": "Erős", "cancel": "Mégsem", "done": "Kész", diff --git a/refilc_mobile_ui/lib/screens/settings/submenu/general_screen.dart b/refilc_mobile_ui/lib/screens/settings/submenu/general_screen.dart index b0ac9b3..6d57780 100644 --- a/refilc_mobile_ui/lib/screens/settings/submenu/general_screen.dart +++ b/refilc_mobile_ui/lib/screens/settings/submenu/general_screen.dart @@ -3,6 +3,7 @@ import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/utils/format.dart'; import 'package:refilc_mobile_ui/common/panel/panel_button.dart'; import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart'; +import 'package:refilc_mobile_ui/common/widgets/custom_segmented_control.dart'; import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -57,13 +58,13 @@ class GeneralSettingsScreenState extends State { SettingsHelper.localizedPageTitles()[settingsProvider.startPage] ?? "?"; String languageText = SettingsHelper.langMap[settingsProvider.language] ?? "?"; - String vibrateTitle = { - VibrationStrength.off: "voff".i18n, - VibrationStrength.light: "vlight".i18n, - VibrationStrength.medium: "vmedium".i18n, - VibrationStrength.strong: "vstrong".i18n, - }[settingsProvider.vibrate] ?? - "?"; + // String vibrateTitle = { + // VibrationStrength.off: "voff".i18n, + // VibrationStrength.light: "vlight".i18n, + // VibrationStrength.medium: "vmedium".i18n, + // VibrationStrength.strong: "vstrong".i18n, + // }[settingsProvider.vibrate] ?? + // "?"; return Scaffold( appBar: AppBar( @@ -253,38 +254,38 @@ class GeneralSettingsScreenState extends State { ), ], ), - SplittedPanel( - padding: const EdgeInsets.only(top: 9.0), - cardPadding: const EdgeInsets.all(4.0), - isSeparated: true, - children: [ - PanelButton( - onPressed: () { - SettingsHelper.vibrate(context); - setState(() {}); - }, - title: Text( - "vibrate".i18n, - style: TextStyle( - color: AppColors.of(context).text.withOpacity(.95), - ), - ), - leading: Icon( - FeatherIcons.radio, - size: 22.0, - color: AppColors.of(context).text.withOpacity(.95), - ), - trailing: Text( - vibrateTitle, - style: const TextStyle(fontSize: 14.0), - ), - borderRadius: const BorderRadius.vertical( - top: Radius.circular(12.0), - bottom: Radius.circular(12.0), - ), - ), - ], - ), + // SplittedPanel( + // padding: const EdgeInsets.only(top: 9.0), + // cardPadding: const EdgeInsets.all(4.0), + // isSeparated: true, + // children: [ + // PanelButton( + // onPressed: () { + // SettingsHelper.vibrate(context); + // setState(() {}); + // }, + // title: Text( + // "vibrate".i18n, + // style: TextStyle( + // color: AppColors.of(context).text.withOpacity(.95), + // ), + // ), + // leading: Icon( + // FeatherIcons.radio, + // size: 22.0, + // color: AppColors.of(context).text.withOpacity(.95), + // ), + // trailing: Text( + // vibrateTitle, + // style: const TextStyle(fontSize: 14.0), + // ), + // borderRadius: const BorderRadius.vertical( + // top: Radius.circular(12.0), + // bottom: Radius.circular(12.0), + // ), + // ), + // ], + // ), SplittedPanel( padding: const EdgeInsets.only(top: 9.0), cardPadding: const EdgeInsets.all(4.0), @@ -362,6 +363,72 @@ class GeneralSettingsScreenState extends State { ), ], ), + // vibration option + const SizedBox( + height: 18.0, + ), + SplittedPanel( + title: Text('vibrate'.i18n), + padding: EdgeInsets.zero, + cardPadding: EdgeInsets.zero, + isTransparent: true, + children: [ + CustomSegmentedControl( + onChanged: (v) { + settingsProvider.update( + vibrate: v == 1 + ? VibrationStrength.light + : v == 2 + ? VibrationStrength.medium + : v == 3 + ? VibrationStrength.strong + : VibrationStrength.off, + ); + + setState(() {}); + }, + value: settingsProvider.vibrate == VibrationStrength.light + ? 1 + : settingsProvider.vibrate == VibrationStrength.medium + ? 2 + : settingsProvider.vibrate == + VibrationStrength.strong + ? 3 + : 0, + height: 38, + children: [ + Text( + 'voff'.i18n, + style: const TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.5, + ), + ), + Text( + 'vlight'.i18n, + style: const TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.5, + ), + ), + Text( + 'vmedium'.i18n, + style: const TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.5, + ), + ), + Text( + 'vstrong'.i18n, + style: const TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.5, + ), + ), + ], + ), + ], + ), ], ), ), diff --git a/refilc_mobile_ui/lib/screens/settings/submenu/personalize_screen.dart b/refilc_mobile_ui/lib/screens/settings/submenu/personalize_screen.dart index 3c657d2..82827c8 100644 --- a/refilc_mobile_ui/lib/screens/settings/submenu/personalize_screen.dart +++ b/refilc_mobile_ui/lib/screens/settings/submenu/personalize_screen.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:refilc/api/providers/user_provider.dart'; import 'package:refilc/helpers/subject.dart'; +import 'package:refilc/models/icon_pack.dart'; import 'package:refilc/models/settings.dart'; import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/observer.dart'; @@ -15,6 +16,7 @@ import 'package:refilc_kreta_api/providers/grade_provider.dart'; import 'package:refilc_kreta_api/providers/timetable_provider.dart'; import 'package:refilc_mobile_ui/common/panel/panel_button.dart'; import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart'; +import 'package:refilc_mobile_ui/common/widgets/custom_segmented_control.dart'; import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart'; import 'package:refilc_mobile_ui/screens/settings/submenu/edit_subject.dart'; import 'package:refilc_mobile_ui/screens/settings/submenu/paint_list.dart'; @@ -458,37 +460,37 @@ class PersonalizeSettingsScreenState extends State ], ), // change subject icons - SplittedPanel( - padding: const EdgeInsets.only(top: 9.0), - cardPadding: const EdgeInsets.all(4.0), - isSeparated: true, - children: [ - PanelButton( - onPressed: () { - SettingsHelper.iconPack(context); - }, - title: Text( - "icon_pack".i18n, - style: TextStyle( - color: AppColors.of(context).text.withOpacity(.95), - ), - ), - leading: Icon( - FeatherIcons.grid, - size: 22.0, - color: AppColors.of(context).text.withOpacity(.95), - ), - trailing: Text( - settingsProvider.iconPack.name.capital(), - style: const TextStyle(fontSize: 14.0), - ), - borderRadius: const BorderRadius.vertical( - top: Radius.circular(12.0), - bottom: Radius.circular(12.0), - ), - ), - ], - ), + // SplittedPanel( + // padding: const EdgeInsets.only(top: 9.0), + // cardPadding: const EdgeInsets.all(4.0), + // isSeparated: true, + // children: [ + // PanelButton( + // onPressed: () { + // SettingsHelper.iconPack(context); + // }, + // title: Text( + // "icon_pack".i18n, + // style: TextStyle( + // color: AppColors.of(context).text.withOpacity(.95), + // ), + // ), + // leading: Icon( + // FeatherIcons.grid, + // size: 22.0, + // color: AppColors.of(context).text.withOpacity(.95), + // ), + // trailing: Text( + // settingsProvider.iconPack.name.capital(), + // style: const TextStyle(fontSize: 14.0), + // ), + // borderRadius: const BorderRadius.vertical( + // top: Radius.circular(12.0), + // bottom: Radius.circular(12.0), + // ), + // ), + // ], + // ), // grade colors SplittedPanel( padding: const EdgeInsets.only(top: 9.0), @@ -830,6 +832,48 @@ class PersonalizeSettingsScreenState extends State ), ], ), + // subject icon shceme + const SizedBox( + height: 18.0, + ), + SplittedPanel( + title: Text('icon_pack'.i18n), + padding: EdgeInsets.zero, + cardPadding: EdgeInsets.zero, + isTransparent: true, + children: [ + CustomSegmentedControl( + onChanged: (v) { + settingsProvider.update( + iconPack: + v == 0 ? IconPack.material : IconPack.cupertino, + ); + + setState(() {}); + }, + value: settingsProvider.iconPack == IconPack.material + ? 0 + : 1, + height: 38, + children: const [ + Text( + 'Material', + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Text( + 'Cupertino', + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + ], + ), + ], + ), // custom fonts const SizedBox( height: 18.0,