Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKun committed Jan 1, 2024
1 parent d64f745 commit f032fd2
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 89 deletions.
9 changes: 5 additions & 4 deletions lib/lang/en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ const Map<String, String> en = {
'useAlternativeCalendarColors': 'Use alternative calendar colors',
'useAlternativeCalendarColorsDescription':
'Changes green and red in calendar to blue and yellow. Useful for colorblind people.',
'mixedResolutionAlert' : 'Mixed Resolutions detected',
'mixedResolutionAlertDescription' : 'At least one snippet seems to have a different resolution.\n\n'
'This can cause unexpected results when using your film.\n\n'
'Try to delete theses files or move them to a different profile.'
'mixedResolutionAlert': 'Mixed Resolutions detected',
'mixedResolutionAlertDescription':
'At least one snippet seems to have a different resolution.\n\n'
'This can cause unexpected results when using your film.\n\n'
'Try to delete theses files or move them to a different profile.'
};
8 changes: 4 additions & 4 deletions lib/lang/fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ const Map<String, String> fr = {
'useAlternativeCalendarColors': 'Utilisez des couleurs de calendrier alternatives',
'useAlternativeCalendarColorsDescription':
'Change le vert et le rouge dans le calendrier en bleu et jaune. Utile pour les personnes daltoniennes.',
'mixedResolutionAlert' : 'Mix de résolutions détecté.',
'mixedResolutionAlertDescription' : 'Au moins une vidéo semble avoir un mix de résolutions.\n\n'
'Cela peut produire des résultats innatendus lorsque vous utilisez votre film.\n\n'
'Essayez de supprimer ces fichiers ou de les déplacer dans un autre profil.'
'mixedResolutionAlert': 'Mix de résolutions détecté.',
'mixedResolutionAlertDescription': 'Au moins une vidéo semble avoir un mix de résolutions.\n\n'
'Cela peut produire des résultats innatendus lorsque vous utilisez votre film.\n\n'
'Essayez de supprimer ces fichiers ou de les déplacer dans un autre profil.'
};
4 changes: 1 addition & 3 deletions lib/pages/home/base/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class HomePage extends GetView<BottomAppBarIndexController> {
body: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Center(
child: Obx(() => _getSelectedPage(controller.activeIndex.value)),
),
child: Obx(() => _getSelectedPage(controller.activeIndex.value)),
),
);
}
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/home/base/widgets/bottom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:salomon_bottom_bar/salomon_bottom_bar.dart';

import '../../../../controllers/bottom_app_bar_index_controller.dart';
import '../../../../utils/constants.dart';
import '../../../../utils/theme.dart';

SalomonBottomBarItem _bottomBarItem({
required IconData icon,
Expand All @@ -28,7 +27,7 @@ class CustomBottomAppBar extends GetView<BottomAppBarIndexController> {
Widget build(BuildContext context) {
return Obx(
() => SalomonBottomBar(
backgroundColor: ThemeService().isDarkTheme() ? AppColors.dark : AppColors.light,
backgroundColor: Colors.black12.withOpacity(0.05),
currentIndex: controller.activeIndex.value,
onTap: controller.setBottomAppBarIndex,
items: [
Expand Down
10 changes: 4 additions & 6 deletions lib/pages/home/calendar_editor/calendar_editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
}

bool shouldIgnoreExperimentalFilter() {
final useFilter = SharedPrefsUtil.getBool('useFilterInExperimentalPicker') ?? false;
final useFilter = SharedPrefsUtil.getBool('useFilterInExperimentalPicker') ?? true;
if (!useFilter) return true;
if (_selectedDate.day == DateTime.now().day &&
_selectedDate.month == DateTime.now().month &&
Expand Down Expand Up @@ -435,7 +435,7 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: AspectRatio(
aspectRatio: 16/9,
aspectRatio: 16 / 9,
child: Stack(
children: [
Center(
Expand Down Expand Up @@ -466,13 +466,11 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
WidgetsBinding.instance.addPostFrameCallback((_) {
_controller?.dispose();
});
Get.offAllNamed(Routes.HOME)
?.then((_) => setState(() {}));
Get.offAllNamed(Routes.HOME)?.then((_) => setState(() {}));
}

// VideoPlayer
if (_controller != null &&
_controller!.value.isInitialized) {
if (_controller != null && _controller!.value.isInitialized) {
return Align(
alignment: Alignment.center,
child: Stack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ class _VideoSubtitlesEditorPageState extends State<VideoSubtitlesEditorPage> {
onTap: () => videoPlay(),
// ConstrainedBox to fit vertical videos without overflowing
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.7
),
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.7),
child: AspectRatio(
aspectRatio: _videoController.value.aspectRatio,
child: Stack(
Expand Down Expand Up @@ -224,7 +222,7 @@ class _VideoSubtitlesEditorPageState extends State<VideoSubtitlesEditorPage> {
hintText: 'enterSubtitles'.tr.split('(').first,
fillColor: ThemeService().isDarkTheme() ? Colors.black : Colors.white,
hintStyle: TextStyle(
color: ThemeService().isDarkTheme() ? Colors.black : Colors.white,
color: ThemeService().isDarkTheme() ? Colors.white : Colors.black,
),
filled: true,
border: const OutlineInputBorder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class _SelectVideoFromStorageState extends State<SelectVideoFromStorage> {
Widget build(BuildContext context) {
// Count all true in isSelected and return quantity
final int totalSelected = isSelected?.where((element) => element).length ?? 0;
final aspectRatio = allVideos?.first.contains('_vertical') == true ? 0.5 : 1.0;
return Scaffold(
appBar: AppBar(
iconTheme: const IconThemeData(
Expand Down Expand Up @@ -115,9 +116,9 @@ class _SelectVideoFromStorageState extends State<SelectVideoFromStorage> {
cacheExtent: 99999,
shrinkWrap: true,
controller: scrollController,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 1.12,
childAspectRatio: aspectRatio,
),
itemCount: allVideos!.length,
itemBuilder: (context, index) {
Expand Down
1 change: 1 addition & 0 deletions lib/pages/home/create_movie/widgets/view_movies_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class _ViewMoviesState extends State<ViewMovies> {
alignment: Alignment.center,
child: Image.memory(
snapshot.data![index] as Uint8List,
height: MediaQuery.sizeOf(context).height * 0.27,
),
),
Align(
Expand Down
32 changes: 9 additions & 23 deletions lib/pages/home/notification/widgets/switch_notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import '../../../../utils/theme.dart';

class SwitchNotificationsComponent extends StatefulWidget {
@override
_SwitchNotificationsComponentState createState() =>
_SwitchNotificationsComponentState();
_SwitchNotificationsComponentState createState() => _SwitchNotificationsComponentState();
}

class _SwitchNotificationsComponentState
extends State<SwitchNotificationsComponent> {
class _SwitchNotificationsComponentState extends State<SwitchNotificationsComponent> {
late bool isNotificationSwitchToggled;
TimeOfDay scheduledTimeOfDay = const TimeOfDay(hour: 20, minute: 00);
late bool isPersistentSwitchToggled;
Expand Down Expand Up @@ -58,10 +56,7 @@ class _SwitchNotificationsComponentState
await notificationService.turnOnNotifications();

await notificationService.scheduleNotification(
scheduledTimeOfDay.hour,
scheduledTimeOfDay.minute,
DateTime.now()
);
scheduledTimeOfDay.hour, scheduledTimeOfDay.minute, DateTime.now());
} else {
await notificationService.turnOffNotifications();
}
Expand Down Expand Up @@ -139,22 +134,17 @@ class _SwitchNotificationsComponentState
});
}

notificationService.setScheduledTime(newTimeOfDay.hour,
newTimeOfDay.minute);
notificationService.setScheduledTime(newTimeOfDay.hour, newTimeOfDay.minute);

setState(() {
scheduledTimeOfDay = newTimeOfDay;
});

await notificationService.scheduleNotification(
scheduledTimeOfDay.hour,
scheduledTimeOfDay.minute,
DateTime.now()
);
scheduledTimeOfDay.hour, scheduledTimeOfDay.minute, DateTime.now());
},
child: Container(
padding:
const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down Expand Up @@ -196,19 +186,16 @@ class _SwitchNotificationsComponentState
}

/// Schedule notification if switch in ON
if(isNotificationSwitchToggled && !isNotificationSwitchToggled){
if (isNotificationSwitchToggled && !isNotificationSwitchToggled) {
await notificationService.turnOnNotifications();
setState(() {
isNotificationSwitchToggled = true;
});
}

if(isNotificationSwitchToggled){
if (isNotificationSwitchToggled) {
await notificationService.scheduleNotification(
scheduledTimeOfDay.hour,
scheduledTimeOfDay.minute,
DateTime.now()
);
scheduledTimeOfDay.hour, scheduledTimeOfDay.minute, DateTime.now());
}

/// Update switch value
Expand All @@ -222,7 +209,6 @@ class _SwitchNotificationsComponentState
],
),
),
const Divider(),
],
);
}
Expand Down
42 changes: 26 additions & 16 deletions lib/pages/home/profiles/profiles_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ class _ProfilesPageState extends State<ProfilesPage> {
if (!storedProfiles.contains('Default')) {
profiles.insert(
0,
const Profile(label: 'Default', storageString: 'Default', isDefault: true, isVertical: false),
const Profile(
label: 'Default', storageString: 'Default', isDefault: true, isVertical: false),
);
} else {
// Profiles strings ending with '_vertical' creates an Profile object with isVertical value true, as other not.
profiles = storedProfiles.map(
(e) {
if (e == 'Default') return Profile(label: e, storageString: e, isDefault: true, isVertical: false);
if (e == 'Default')
return Profile(label: e, storageString: e, isDefault: true, isVertical: false);
if (e.endsWith('_vertical'))
return Profile(label: e.replaceAll('_vertical', ''), storageString: e, isVertical: true);
return Profile(
label: e.replaceAll('_vertical', ''), storageString: e, isVertical: true);
else
return Profile(label: e, storageString: e, isVertical: false);
},
Expand Down Expand Up @@ -206,7 +209,8 @@ class _ProfilesPageState extends State<ProfilesPage> {
profiles.length,
Profile(
label: _profileNameController.text.trim(),
storageString: _verticalModeSwitch? '${_profileNameController.text.trim()}_vertical'
storageString: _verticalModeSwitch
? '${_profileNameController.text.trim()}_vertical'
: _profileNameController.text.trim(),
isVertical: _verticalModeSwitch),
);
Expand All @@ -215,8 +219,7 @@ class _ProfilesPageState extends State<ProfilesPage> {

// Add the modified profile list to persistence
// Adds the string '_vertical' at the end of vertical profiles to keep this parameter persistent.
final profileNamesToStringList = profiles
.map((e) => e.storageString).toList();
final profileNamesToStringList = profiles.map((e) => e.storageString).toList();

SharedPrefsUtil.putStringList('profiles', profileNamesToStringList);

Expand Down Expand Up @@ -371,18 +374,25 @@ class _ProfilesPageState extends State<ProfilesPage> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
title: Text(
profiles[index].isDefault ? 'default'.tr : profiles[index].label,
style: TextStyle(
color: ThemeService().isDarkTheme() ? Colors.white : Colors.black,
),
title: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
profiles[index].isDefault ? 'default'.tr : profiles[index].label,
style: TextStyle(
color: ThemeService().isDarkTheme() ? Colors.white : Colors.black,
),
),
const SizedBox(
width: 5.0,
),
RotatedBox(
quarterTurns: profiles[index].isVertical ? 0 : -1,
child: const Icon(Icons.phone_android),
),
],
),
secondary: Row(mainAxisSize: MainAxisSize.min, children: [
Icon(
profiles[index].isVertical
? Icons.stay_current_portrait
: Icons.stay_current_landscape,
),
if (!profiles[index].isDefault)
IconButton(
onPressed: () async {
Expand Down
1 change: 0 additions & 1 deletion lib/pages/home/settings/widgets/backup_tutorial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class BackupTutorial extends StatelessWidget {
),
),
),
const Divider(),
],
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/pages/home/settings/widgets/contact_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class ContactButton extends StatelessWidget {
),
),
),
const Divider(),
],
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/pages/home/settings/widgets/github_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class GithubButton extends StatelessWidget {
),
),
),
const Divider(),
],
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/pages/home/settings/widgets/language_chooser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class _LanguageChooserState extends State<LanguageChooser> {
],
),
),
const Divider(),
],
);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/pages/home/settings/widgets/notifications_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class NotificationsButton extends StatelessWidget {
InkWell(
onTap: () => Get.toNamed(Routes.NOTIFICATION),
child: Ink(
padding:
const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand All @@ -29,7 +28,6 @@ class NotificationsButton extends StatelessWidget {
),
),
),
const Divider(),
],
);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/pages/home/settings/widgets/preferences_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class _PreferencesButtonState extends State<PreferencesButton> {
InkWell(
onTap: () => Get.toNamed(Routes.PREFERENCES),
child: Ink(
padding: const EdgeInsets.symmetric(
horizontal: 15.0, vertical: 10.0),
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand All @@ -38,7 +37,6 @@ class _PreferencesButtonState extends State<PreferencesButton> {
),
),
),
const Divider(),
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home/settings/widgets/preferences_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class _PreferencesPageState extends State<PreferencesPage> {
super.initState();
isCameraSwitchToggled = SharedPrefsUtil.getBool('forceNativeCamera') ?? false;
isPickerSwitchToggled = SharedPrefsUtil.getBool('useExperimentalPicker') ?? true;
isPickerFilterSwitchToggled = SharedPrefsUtil.getBool('useFilterInExperimentalPicker') ?? false;
isPickerFilterSwitchToggled = SharedPrefsUtil.getBool('useFilterInExperimentalPicker') ?? true;
isColorsSwitchToggled = SharedPrefsUtil.getBool('useAlternativeCalendarColors') ?? false;
}

Expand Down
4 changes: 1 addition & 3 deletions lib/pages/home/settings/widgets/profiles_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class ProfilesButton extends StatelessWidget {
InkWell(
onTap: () => Get.toNamed(Routes.PROFILES),
child: Ink(
padding:
const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand All @@ -29,7 +28,6 @@ class ProfilesButton extends StatelessWidget {
),
),
),
const Divider(),
],
);
}
Expand Down
Loading

0 comments on commit f032fd2

Please sign in to comment.