Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/config_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class ConfigKey {
static const String showflashback1WeekAgo = "showflashback1WeekAgo";
static const String showflashbackGoodDay = "showflashbackGoodDay";
static const String showflashbackRandomDay = "showflashbackRandomDay";
static const String hideImagesInGallery = "hideImagesInGallery";
// Secure Configuration Values
static const String requirePassword = "requirePassword";
static const String biometricUnlock = "biometricUnlock";
Expand Down Expand Up @@ -118,6 +119,7 @@ class ConfigProvider with ChangeNotifier {
ConfigKey.showflashback1WeekAgo: true,
ConfigKey.showflashbackGoodDay: true,
ConfigKey.showflashbackRandomDay: true,
ConfigKey.hideImagesInGallery: false,
};

final Map<String, dynamic> _secureConfig = {
Expand Down
6 changes: 6 additions & 0 deletions lib/l10n/generated/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@ abstract class AppLocalizations {
/// **'Gallery View Layout'**
String get settingsGalleryViewLayout;

/// No description provided for @settingsHideImagesInGallery.
///
/// In en, this message translates to:
/// **'Hide Images In Gallery'**
String get settingsHideImagesInGallery;

/// No description provided for @viewLayoutList.
///
/// In en, this message translates to:
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ class AppLocalizationsAr extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'طريقة عرض الصور';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'قائمة';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_cs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Rozložení zobrazení galerie';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Seznam';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_da.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class AppLocalizationsDa extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Galerieansichts-Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Liste';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Vista de Galería';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Lista';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_fa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ class AppLocalizationsFa extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'فهرست';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_fi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AppLocalizationsFi extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Disposition de la gallerie';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Liste';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_he.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class AppLocalizationsHe extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_id.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsId extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Layout visualizzazione Galleria';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Elenco';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'リスト';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_nl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_oc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AppLocalizationsOc extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Widok galerii';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Lista';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_pt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Отображение галереи';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Список';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_tr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class AppLocalizationsTr extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_uk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Макет перегляду галереї';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'Список';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_vi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ class AppLocalizationsVi extends AppLocalizations {
@override
String get settingsGalleryViewLayout => 'Gallery View Layout';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => 'List';

Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/generated/app_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get settingsGalleryViewLayout => '迹忆页视图布局';

@override
String get settingsHideImagesInGallery => 'Hide Images In Gallery';

@override
String get viewLayoutList => '列表';

Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
"@settingsFlashbacksViewLayout": {},
"settingsGalleryViewLayout": "Gallery View Layout",
"@settingsGalleryViewLayout": {},
"settingsHideImagesInGallery": "Hide Images In Gallery",
"@settingsHideImagesInGallery": {},
"viewLayoutList": "List",
"@viewLayoutList": {},
"viewLayoutGrid": "Grid",
Expand Down
11 changes: 9 additions & 2 deletions lib/pages/gallery_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ class _GalleryPageState extends State<GalleryPage>
Widget buildEntries(
BuildContext context, bool listView, List<Entry> entries) {
final entryImagesProvider = Provider.of<EntryImagesProvider>(context);
final configProvider = Provider.of<ConfigProvider>(context);
return entries.isEmpty
? Center(
child: Text(
Expand Down Expand Up @@ -282,10 +283,16 @@ class _GalleryPageState extends State<GalleryPage>
child: listView
? LargeEntryCardWidget(
entry: entry,
images: entryImagesProvider.getForEntry(entry))
images: entryImagesProvider.getForEntry(entry),
hideImage:
configProvider.get(ConfigKey.hideImagesInGallery),
)
: EntryCardWidget(
entry: entry,
images: entryImagesProvider.getForEntry(entry)),
images: entryImagesProvider.getForEntry(entry),
hideImage:
configProvider.get(ConfigKey.hideImagesInGallery),
),
);
},
);
Expand Down
8 changes: 7 additions & 1 deletion lib/pages/settings/appearance_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,14 @@ class _AppearanceSettingsPageState extends State<AppearanceSettings> {
}
}),
),
SettingsToggle(
title: AppLocalizations.of(context)!.settingsHideImagesInGallery,
settingsKey: ConfigKey.hideImagesInGallery,
onChanged: (value) {
configProvider.set(ConfigKey.hideImagesInGallery, value);
}),
Padding(
padding: const EdgeInsets.only(top: 16.0, left: 16.0),
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: Text(
AppLocalizations.of(context)!.settingsChangeMoodIcons,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
Expand Down
17 changes: 9 additions & 8 deletions lib/widgets/entry_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ import 'package:markdown_widget/markdown_widget.dart';
import 'local_image_loader.dart';

class EntryCardWidget extends StatelessWidget {
const EntryCardWidget({
super.key,
this.title,
required this.entry,
required this.images,
});
const EntryCardWidget(
{super.key,
this.title,
required this.entry,
required this.images,
this.hideImage = false});

final Entry entry;
final String? title;
final List<EntryImage> images;
final bool hideImage;

@override
Widget build(BuildContext context) {
Expand All @@ -40,7 +41,7 @@ class EntryCardWidget extends StatelessWidget {
alignment: Alignment.topRight,
clipBehavior: Clip.antiAlias,
children: [
(images.isNotEmpty)
(images.isNotEmpty && !hideImage)
? LocalImageLoader(
imagePath: images.first.imgPath,
)
Expand Down Expand Up @@ -69,7 +70,7 @@ class EntryCardWidget extends StatelessWidget {
color: theme.disabledColor, fontSize: 16),
),
),
if (images.length > 1)
if (images.length > 1 && !hideImage)
Positioned(
top: 0,
right: 0,
Expand Down
15 changes: 8 additions & 7 deletions lib/widgets/large_entry_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ import 'package:markdown_widget/markdown_widget.dart';
import 'local_image_loader.dart';

class LargeEntryCardWidget extends StatelessWidget {
const LargeEntryCardWidget({
super.key,
this.title,
required this.entry,
required this.images,
});
const LargeEntryCardWidget(
{super.key,
this.title,
required this.entry,
required this.images,
this.hideImage = false});

final Entry entry;
final List<EntryImage> images;
final String? title;
final bool hideImage;

@override
Widget build(BuildContext context) {
Expand All @@ -33,7 +34,7 @@ class LargeEntryCardWidget extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (images.isNotEmpty)
if (images.isNotEmpty && !hideImage)
Expanded(
child: Stack(
fit: StackFit.expand,
Expand Down