Merge remote-tracking branch 'origin/master' into settings_tweak

This commit is contained in:
Neeraj Gupta 2022-12-07 11:22:50 +05:30
commit 0ac8408b03
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
4 changed files with 16 additions and 12 deletions

View file

@ -15,7 +15,9 @@ const int jan011981Time = 347155200000000;
const int galleryLoadStartTime = -8000000000000000; // Wednesday, March 6, 1748
const int galleryLoadEndTime = 9223372036854775807; // 2^63 -1
const int batchSize = 1000;
const defaultPhotoGridSize = 4;
const photoGridSizeDefault = 4;
const photoGridSizeMin = 2;
const photoGridSizeMax = 6;
// used to identify which ente file are available in app cache
// todo: 6Jun22: delete old media identifier after 3 months

View file

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:photos/core/constants.dart';
import 'package:photos/core/event_bus.dart';
import 'package:photos/events/force_reload_home_gallery_event.dart';
import 'package:photos/theme/ente_theme.dart';
@ -99,15 +100,16 @@ class _AdvancedSettingsScreenState extends State<AdvancedSettingsScreen> {
Future<void> _showPhotoGridSizePicker() async {
final textTheme = getEnteTextTheme(context);
final List<Text> options = [];
for (int gridSize = photoGridSizeMin;
gridSize <= photoGridSizeMax;
gridSize++) {
options.add(
Text("2", style: textTheme.body),
);
options.add(
Text("3", style: textTheme.body),
);
options.add(
Text("4", style: textTheme.body),
Text(
gridSize.toString(),
style: textTheme.body,
),
);
}
return showCupertinoModalPopup(
context: context,
builder: (context) {

View file

@ -434,7 +434,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
shouldShowLivePhotoOverlay: true,
key: Key(widget.tag + file.tag),
thumbnailSize: LocalSettings.instance.getPhotoGridSize() <
defaultPhotoGridSize
photoGridSizeDefault
? thumbnailLargeSize
: thumbnailSmallSize,
),

View file

@ -32,7 +32,7 @@ class LocalSettings {
if (_prefs.containsKey(kPhotoGridSize)) {
return _prefs.getInt(kPhotoGridSize)!;
} else {
return defaultPhotoGridSize;
return photoGridSizeDefault;
}
}