Skip to content

Commit

Permalink
Add new preferences (experimental picker filter & colorblind options)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKun committed Sep 10, 2023
1 parent f4601b4 commit 81b8f94
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 87 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## v1.5.3 - 09/2023
- Add reverse filter order button in experimental file picker
- Added option to change calendar days color for colorblind users
- Added option to disable date filter in experimental file picker
- Added reverse filter order button in experimental file picker
- Store location metadata in video when geotagging is enabled
- Autofocus and capitalize first letter of custom locale and subtitles text fields

Expand Down
6 changes: 6 additions & 0 deletions lib/lang/cs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,10 @@ const Map<String, String> cs = {
'Při nahrávání v aplikaci klepněte po nastavení telefonu na nové tlačítko, abyste zamkli orientaci a předešli neočekávaným výsledkům 📱',
'feat5v152': 'A mnohem více...',
'featDesc5v152': 'Najdete zde také některá drobná vizuální vylepšení a opravy chyb 🐛',
'useFilterInExperimentalPicker': 'Použijte filtr datumu pro výběr videí',
'useFilterInExperimentalPickerDescription':
'Pokud je aktivní, výběr minulých dat filtruje videa podle toho data. Pokud je deaktivováno, zobrazí se všechna videa. Funguje pouze s experimentálním výběrem souborů.',
'useAlternativeCalendarColors': 'Použijte alternativní barvy kalendáře',
'useAlternativeCalendarColorsDescription':
'Změní zelenou a červenou v kalendáři na modrou a žlutou. Užitečné pro barvoslepé.'
};
6 changes: 6 additions & 0 deletions lib/lang/de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,10 @@ const Map<String, String> de = {
'feat5v152': 'Und mehr...',
'featDesc5v152':
'Sie finden auch einige kleinere visuelle Verbesserungen und Fehlerbehebungen 🐛',
'useFilterInExperimentalPicker': 'Verwenden Sie das Datumsfilter, um Videos auszuwählen',
'useFilterInExperimentalPickerDescription':
'Wenn aktiviert, filtern die Auswahl vergangener Daten die Videos nach diesem Datum. Wenn deaktiviert, werden alle Videos angezeigt. Funktioniert nur mit dem experimentellen Dateiauswähler.',
'useAlternativeCalendarColors': 'Alternative Kalenderfarben verwenden',
'useAlternativeCalendarColorsDescription':
'Ändert grün und rot im Kalender zu blau und gelb. Nützlich für farbenblinde Menschen.'
};
6 changes: 6 additions & 0 deletions lib/lang/en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,10 @@ const Map<String, String> en = {
'When recording in the app, tap the new button after positioning your phone to lock the orientation and avoid unexpected results 📱',
'feat5v152': 'And more...',
'featDesc5v152': 'You will also find some small visual improvements and bug fixes 🐛',
'useFilterInExperimentalPicker': 'Use date filter to pick videos',
'useFilterInExperimentalPickerDescription':
'When enabled, selecting past dates will filter the videos by that date. When disabled, all videos will be shown. Works only with the experimental file picker.',
'useAlternativeCalendarColors': 'Use alternative calendar colors',
'useAlternativeCalendarColorsDescription':
'Changes green and red in calendar to blue and yellow. Useful for colorblind people.',
};
6 changes: 6 additions & 0 deletions lib/lang/es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,10 @@ const Map<String, String> es = {
'feat5v152': 'Y más...',
'featDesc5v152':
'También encontrarás algunas pequeñas mejoras visuales y correcciones de errores 🐛',
'useFilterInExperimentalPicker': 'Use el filtro de fecha para seleccionar vídeos',
'useFilterInExperimentalPickerDescription':
'Cuando está activado, seleccionar fechas pasadas filtrará los vídeos por esa fecha. Si está desactivado, se mostrarán todos los vídeos. Funciona solo con el selector de archivos experimental.',
'useAlternativeCalendarColors': 'Use colores alternativos para el calendario',
'useAlternativeCalendarColorsDescription':
'Cambia el verde y el rojo en el calendario a azul y amarillo. Útil para personas con daltonismo.'
};
6 changes: 6 additions & 0 deletions lib/lang/fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,10 @@ const Map<String, String> fr = {
'feat5v152': 'Et plus encore...',
'featDesc5v152':
'Vous trouverez également quelques petites améliorations visuelles et corrections de bugs 🐛',
'useFilterInExperimentalPicker': 'Utilisez le filtre de date pour choisir des vidéos',
'useFilterInExperimentalPickerDescription':
'Lorsqu\'il est activé, sélectionner des dates passées filtrera les vidéos par cette date. Lorsqu\'il est désactivé, toutes les vidéos seront affichées. Fonctionne uniquement avec le sélecteur de fichiers expérimental.',
'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.'
};
6 changes: 6 additions & 0 deletions lib/lang/id.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,10 @@ const Map<String, String> id = {
'Saat merekam di aplikasi, ketuk tombol baru setelah menempatkan ponsel Anda untuk mengunci orientasi dan menghindari hasil yang tidak diinginkan 📱',
'feat5v152': 'Dan lainnya...',
'featDesc5v152': 'Anda juga akan menemukan beberapa perbaikan visual kecil dan perbaikan bug 🐛',
'useFilterInExperimentalPicker': 'Gunakan filter tanggal untuk memilih video',
'useFilterInExperimentalPickerDescription':
'Ketika diaktifkan, memilih tanggal sebelumnya akan memfilter video berdasarkan tanggal tersebut. Ketika dinonaktifkan, semua video akan ditampilkan. Hanya bekerja dengan pemilih file eksperimental.',
'useAlternativeCalendarColors': 'Gunakan warna kalender alternatif',
'useAlternativeCalendarColorsDescription':
'Mengubah hijau dan merah di kalender menjadi biru dan kuning. Berguna untuk orang buta warna.'
};
6 changes: 6 additions & 0 deletions lib/lang/pt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,10 @@ const Map<String, String> pt = {
'feat5v152': 'E mais...',
'featDesc5v152':
'Você também encontrará algumas pequenas melhorias visuais e correções de erros 🐛',
'useFilterInExperimentalPicker': 'Filtrar data para escolher vídeos',
'useFilterInExperimentalPickerDescription':
'Quando ativado, selecionar datas passadas filtrará os vídeos por essa data. Quando desativado, todos os vídeos serão mostrados. Funciona apenas com o seletor de arquivos experimental.',
'useAlternativeCalendarColors': 'Usar cores alternativas para o calendário',
'useAlternativeCalendarColorsDescription':
'Muda as cores verde e vermelho no calendário para azul e amarelo. Útil para pessoas daltônicas.'
};
6 changes: 6 additions & 0 deletions lib/lang/ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,10 @@ const Map<String, String> ru = {
'feat5v152': 'И многое другое...',
'featDesc5v152':
'Вы также найдете некоторые небольшие визуальные улучшения и исправления ошибок 🐛',
'useFilterInExperimentalPicker': 'Используйте фильтр по дате для выбора видео',
'useFilterInExperimentalPickerDescription':
'Когда включено, выбор прошедших дат будет фильтровать видео по этой дате. Когда выключено, будут показаны все видео. Работает только с экспериментальным выбором файлов.',
'useAlternativeCalendarColors': 'Используйте альтернативные цвета календаря',
'useAlternativeCalendarColorsDescription':
'Меняет зеленый и красный в календаре на синий и желтый. Полезно для людей с цветовым слепотой.'
};
4 changes: 4 additions & 0 deletions lib/lang/zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,8 @@ const Map<String, String> zh = {
'featDesc4v152': '在应用中录制时,调整手机位置后点击新按钮以锁定方向,避免意外的结果 📱',
'feat5v152': '还有更多...',
'featDesc5v152': '您还会发现一些小的视觉改进和错误修复 🐛',
'useFilterInExperimentalPicker': '使用日期过滤器选择视频',
'useFilterInExperimentalPickerDescription': '启用后,选择过去的日期将按该日期过滤视频。禁用后,将显示所有视频。仅适用于实验性文件选择器。',
'useAlternativeCalendarColors': '使用备用日历颜色',
'useAlternativeCalendarColorsDescription': '将日历中的绿色和红色更改为蓝色和黄色。对色盲者有用。'
};
17 changes: 15 additions & 2 deletions lib/pages/home/calendar_editor/calendar_editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
VideoPlayerController? _controller;
final UniqueKey _videoPlayerKey = UniqueKey();
final mediaStore = MediaStore();
late final bool useCalendarAlternativeColors =
SharedPrefsUtil.getBool('useAlternativeCalendarColors') ?? false;

@override
void initState() {
Expand Down Expand Up @@ -175,6 +177,7 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
/// Picks video from gallery
Future<void> selectVideoFromGallery() async {
final isExperimentalPicker = SharedPrefsUtil.getBool('useExperimentalPicker') ?? true;
final useFilter = SharedPrefsUtil.getBool('useFilterInExperimentalPicker') ?? true;

if (isExperimentalPicker) {
final bool shouldIgnoreFilter = shouldIgnoreExperimentalFilter();
Expand All @@ -198,7 +201,7 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
pickerConfig: AssetPickerConfig(
maxAssets: 1,
requestType: RequestType.video,
filterOptions: filterOptionGroup,
filterOptions: useFilter ? filterOptionGroup : null,
sortPathsByModifiedDate: true,
specialItemPosition: SpecialItemPosition.prepend,
specialItemBuilder: (context, path, length) {
Expand Down Expand Up @@ -364,7 +367,10 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
child: Text(
date.day.toString(),
style: TextStyle(
color: hasVideo ? AppColors.green : AppColors.mainColor,
color: getDayColor(hasVideo),
fontWeight: useCalendarAlternativeColors
? FontWeight.w900
: FontWeight.normal,
fontFamily: 'Magic',
),
),
Expand Down Expand Up @@ -644,6 +650,13 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
});
}
}

Color getDayColor(bool hasVideo) {
if (hasVideo) {
return useCalendarAlternativeColors ? Colors.blue : AppColors.green;
}
return useCalendarAlternativeColors ? AppColors.yellow : AppColors.mainColor;
}
}

/// Pause or Resume videoplayback
Expand Down
Loading

0 comments on commit 81b8f94

Please sign in to comment.