Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical Mode #113

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Harry Schiller (@waitingwittykitty)
- David Coker (@daoxve)
- Adrasteon (@AdrasteonDev)
- Philéas (@phileas_imt)

## Testing & Feedback
- Augusto Vesco
Expand Down
3 changes: 3 additions & 0 deletions lib/lang/de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ const Map<String, String> de = {
'profileNameCannotBeEmpty': 'Profilname kann nicht leer sein',
'reservedProfileName': 'Dies ist ein reservierter Profilname',
'creatingMovie': 'Verarbeitung... Bitte warten.\nDies kann mehrere Minuten dauern.',
'verticalProfileName': 'Vertikales Profil',
'verticalProfileActivated': 'Dieses Profil enthält nur Snippets im Hochformat.',
'verticalProfileDisabled': 'Dieses Profil enthält nur Snippets im Querformat.',
'doNotCloseTheApp': 'Bitte schließen Sie die\nApp nicht',
'cancelMovieCreation': 'Film erstellen abbrechen',
'cancelMovieDesc': 'Möchtest Du wirklich abbrechen?',
Expand Down
8 changes: 8 additions & 0 deletions lib/lang/en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ const Map<String, String> en = {
'All videos associated with this profile will also be permanently deleted. Are you sure to continue?',
'profileNameCannotBeEmpty': 'Profile name cannot be empty',
'reservedProfileName': 'This is a reserved profile name',
'verticalProfileName': 'Vertical Profile',
'verticalProfileActivated': 'This profile will contain portrait snippets only.',
'verticalProfileDisabled': 'This profile will contain landscape snippets only.',
'creatingMovie': 'Processing... Please wait.\nThis can take several minutes.',
'doNotCloseTheApp': 'Do not close the app',
'cancelMovieCreation': 'Cancel movie creation',
Expand Down Expand Up @@ -209,4 +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.'
};
3 changes: 3 additions & 0 deletions lib/lang/es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ const Map<String, String> es = {
'Todos los videos asociados con este perfil también se eliminarán permanentemente.¿Estás seguro de continuar?',
'profileNameCannotBeEmpty': 'El nombre del perfil no puede estar vacío',
'reservedProfileName': 'Este es un nombre de perfil reservado',
'verticalProfileName': 'Perfil vertical',
'verticalProfileActivated': 'Este perfil sólo contendrá fragmentos verticales',
'verticalProfileDisabled': 'Este perfil sólo contendrá fragmentos apaisados',
'creatingMovie': 'Procesando... Por favor espera.\nEsto puede tomar varios minutos.',
'doNotCloseTheApp': 'No cierres la aplicación',
'cancelMovieCreation': 'Cancelar creación de película',
Expand Down
9 changes: 8 additions & 1 deletion lib/lang/fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ const Map<String, String> fr = {
'Toutes les vidéos associées à ce profil seront également supprimées en permanence. Êtes-vous sûr de continuer?',
'profileNameCannotBeEmpty': 'Le nom du profil ne peut pas être vide',
'reservedProfileName': 'Ceci est un nom de profil réservé',
'verticalProfileName': 'Profil Vertical',
'verticalProfileActivated': 'Ce profil contiendra uniquement des vidéos au format portrait.',
'verticalProfileDisabled': 'Ce profil contiendra uniquement des vidéos au format paysage',
'creatingMovie': 'Traitement... Veuillez patienter.\nCela peut prendre quelques minutes.',
'doNotCloseTheApp': 'Ne fermez pas l\'application',
'cancelMovieCreation': 'Annuler la création du film',
Expand Down Expand Up @@ -210,5 +213,9 @@ const Map<String, String> fr = {
'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.'
'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.'
};
7 changes: 4 additions & 3 deletions lib/models/profile.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:flutter/material.dart';

@immutable
class Profile {
const Profile({
required this.label,
required this.storageString,
this.isDefault = false,
this.isVertical = false,
});

final String label;
final String storageString;
final bool isDefault;
final bool isVertical;
}
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
126 changes: 63 additions & 63 deletions lib/pages/home/calendar_editor/calendar_editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
}

void setMediaStorePath() {
final currentProfile = Utils.getCurrentProfile();
final currentProfile = Utils.getCurrentProfile().storageString;
if (currentProfile.isEmpty || currentProfile == 'Default') {
MediaStore.appFolder = 'OneSecondDiary';
} else {
Expand Down 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 @@ -436,78 +436,78 @@ class _CalendarEditorPageState extends State<CalendarEditorPage> {
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: AspectRatio(
aspectRatio: 16 / 9,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: mainColor),
),
child: Stack(
children: [
Center(
child: SizedBox(
height: 30,
width: 30,
child: Icon(
Icons.hourglass_bottom,
color: mainColor,
),
child: Stack(
children: [
Center(
child: SizedBox(
height: 30,
width: 30,
child: Icon(
Icons.hourglass_bottom,
color: mainColor,
),
),
FutureBuilder(
future: initializeVideoPlayback(currentVideo),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const SizedBox.shrink();
}

if (snapshot.hasError) {
return Text(
'"Error loading video: " + ${snapshot.error}',
);
}

// Not sure if it works but if the videoController fails we try to restart the page
if (_controller?.value.hasError == true) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_controller?.dispose();
});
Get.offAllNamed(Routes.HOME)
?.then((_) => setState(() {}));
}

// VideoPlayer
if (_controller != null &&
_controller!.value.isInitialized) {
return Align(
alignment: Alignment.center,
child: Stack(
fit: StackFit.passthrough,
children: [
Align(
alignment: Alignment.center,
child: ClipRect(
),
FutureBuilder(
future: initializeVideoPlayback(currentVideo),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const SizedBox.shrink();
}

if (snapshot.hasError) {
return Text(
'"Error loading video: " + ${snapshot.error}',
);
}

// Not sure if it works but if the videoController fails we try to restart the page
if (_controller?.value.hasError == true) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_controller?.dispose();
});
Get.offAllNamed(Routes.HOME)?.then((_) => setState(() {}));
}

// VideoPlayer
if (_controller != null && _controller!.value.isInitialized) {
return Align(
alignment: Alignment.center,
child: Stack(
fit: StackFit.passthrough,
children: [
Align(
alignment: Alignment.center,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: mainColor),
),
child: AspectRatio(
aspectRatio: _controller!.value.aspectRatio,
child: VideoPlayer(
key: _videoPlayerKey,
_controller!,
),
),
),
Controls(
controller: _controller,
),
],
),
);
} else {
return const SizedBox.shrink();
}
},
),
],
),
),
Controls(
controller: _controller,
),
],
),
);
} else {
return const SizedBox.shrink();
}
},
),
],
),
),
),
Flexible(
Padding(
padding: const EdgeInsets.only(top: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expand Down
56 changes: 30 additions & 26 deletions lib/pages/home/calendar_editor/video_subtitles_editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,35 +170,39 @@ class _VideoSubtitlesEditorPageState extends State<VideoSubtitlesEditorPage> {
children: [
GestureDetector(
onTap: () => videoPlay(),
child: AspectRatio(
aspectRatio: 16 / 9,
child: Stack(
children: [
VideoPlayer(
key: UniqueKey(),
_videoController,
),
Center(
child: Opacity(
opacity: _opacity,
child: Container(
width: MediaQuery.of(context).size.width * 0.25,
height: MediaQuery.of(context).size.width * 0.25,
decoration: const BoxDecoration(
color: Colors.black45,
shape: BoxShape.circle,
),
child: const Center(
child: Icon(
Icons.play_arrow,
size: 72.0,
color: Colors.white,
// ConstrainedBox to fit vertical videos without overflowing
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.7),
child: AspectRatio(
aspectRatio: _videoController.value.aspectRatio,
child: Stack(
children: [
VideoPlayer(
key: UniqueKey(),
_videoController,
),
Center(
child: Opacity(
opacity: _opacity,
child: Container(
width: MediaQuery.of(context).size.width * 0.25,
height: MediaQuery.of(context).size.width * 0.25,
decoration: const BoxDecoration(
color: Colors.black45,
shape: BoxShape.circle,
),
child: const Center(
child: Icon(
Icons.play_arrow,
size: 72.0,
color: Colors.white,
),
),
),
),
),
),
],
],
),
),
),
),
Expand All @@ -218,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
Loading