Removed: should _shouldDisableScroll parameter from all the file that have called it

This commit is contained in:
Muhammed Ayimen 2023-11-21 00:20:50 +09:00
parent bb93fe3c70
commit 97dfb91709
7 changed files with 15 additions and 44 deletions

View file

@ -54,14 +54,14 @@ android {
multiDexEnabled true
}
signingConfigs {
release {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : file(System.getenv("SIGNING_KEY_PATH"))
keyAlias keystoreProperties['keyAlias'] ? keystoreProperties['keyAlias'] : System.getenv("SIGNING_KEY_ALIAS")
keyPassword keystoreProperties['keyPassword'] ? keystoreProperties['keyPassword'] : System.getenv("SIGNING_KEY_PASSWORD")
storePassword keystoreProperties['storePassword'] ? keystoreProperties['storePassword'] : System.getenv("SIGNING_STORE_PASSWORD")
}
}
// signingConfigs {
// release {
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : file(System.getenv("SIGNING_KEY_PATH"))
// keyAlias keystoreProperties['keyAlias'] ? keystoreProperties['keyAlias'] : System.getenv("SIGNING_KEY_ALIAS")
// keyPassword keystoreProperties['keyPassword'] ? keystoreProperties['keyPassword'] : System.getenv("SIGNING_KEY_PASSWORD")
// storePassword keystoreProperties['storePassword'] ? keystoreProperties['storePassword'] : System.getenv("SIGNING_STORE_PASSWORD")
// }
// }
flavorDimensions "default"
productFlavors {
@ -84,7 +84,7 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
}
debug {
applicationIdSuffix '.debug'

View file

@ -327,14 +327,6 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
file,
autoPlay: false,
tagPrefix: "memories",
shouldDisableScroll: (value) {
if (value == _shouldDisableScroll) {
return;
}
setState(() {
_shouldDisableScroll = value;
});
},
backgroundDecoration: const BoxDecoration(
color: Colors.transparent,
),

View file

@ -73,7 +73,6 @@ class DetailPage extends StatefulWidget {
class _DetailPageState extends State<DetailPage> {
static const kLoadLimit = 100;
final _logger = Logger("DetailPageState");
bool _shouldDisableScroll = false;
List<EnteFile>? _files;
late PageController _pageController;
final _selectedIndexNotifier = ValueNotifier(0);
@ -172,14 +171,6 @@ class _DetailPageState extends State<DetailPage> {
file,
autoPlay: shouldAutoPlay(),
tagPrefix: widget.config.tagPrefix,
shouldDisableScroll: (value) {
if (_shouldDisableScroll != value) {
setState(() {
_logger.fine('setState $_shouldDisableScroll to $value');
_shouldDisableScroll = value;
});
}
},
playbackCallback: (isPlaying) {
Future.delayed(Duration.zero, () {
_toggleFullScreen(shouldEnable: isPlaying);
@ -222,9 +213,7 @@ class _DetailPageState extends State<DetailPage> {
}
_preloadEntries();
},
physics: _shouldDisableScroll
? const NeverScrollableScrollPhysics()
: const FastScrollPhysics(speedFactor: 4.0),
physics: const FastScrollPhysics(speedFactor: 4.0),
controller: _pageController,
itemCount: _files!.length,
);

View file

@ -8,7 +8,6 @@ import "package:photos/ui/viewer/file/zoomable_live_image_new.dart";
class FileWidget extends StatelessWidget {
final EnteFile file;
final String? tagPrefix;
final Function(bool)? shouldDisableScroll;
final Function(bool)? playbackCallback;
final BoxDecoration? backgroundDecoration;
final bool? autoPlay;
@ -16,7 +15,6 @@ class FileWidget extends StatelessWidget {
const FileWidget(
this.file, {
this.autoPlay,
this.shouldDisableScroll,
this.playbackCallback,
this.tagPrefix,
this.backgroundDecoration,
@ -32,7 +30,6 @@ class FileWidget extends StatelessWidget {
file.fileType == FileType.image) {
return ZoomableLiveImageNew(
file,
shouldDisableScroll: shouldDisableScroll,
tagPrefix: tagPrefix,
backgroundDecoration: backgroundDecoration,
key: key ?? ValueKey(fileKey),

View file

@ -26,7 +26,6 @@ import "package:photos/utils/toast_util.dart";
class ZoomableImage extends StatefulWidget {
final EnteFile photo;
final Function(bool)? shouldDisableScroll;
final String? tagPrefix;
final Decoration? backgroundDecoration;
final bool shouldCover;
@ -34,7 +33,6 @@ class ZoomableImage extends StatefulWidget {
const ZoomableImage(
this.photo, {
Key? key,
this.shouldDisableScroll,
required this.tagPrefix,
this.backgroundDecoration,
this.shouldCover = false,

View file

@ -16,14 +16,12 @@ import 'package:video_player/video_player.dart';
class ZoomableLiveImage extends StatefulWidget {
final EnteFile enteFile;
final Function(bool)? shouldDisableScroll;
final String? tagPrefix;
final Decoration? backgroundDecoration;
const ZoomableLiveImage(
this.enteFile, {
Key? key,
this.shouldDisableScroll,
required this.tagPrefix,
this.backgroundDecoration,
}) : super(key: key);
@ -45,8 +43,9 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
@override
void initState() {
_enteFile = widget.enteFile;
_logger.info('initState for ${_enteFile.generatedID} with tag ${_enteFile
.tag} and name ${_enteFile.displayName}');
_logger.info(
'initState for ${_enteFile.generatedID} with tag ${_enteFile.tag} and name ${_enteFile.displayName}',
);
super.initState();
}
@ -76,7 +75,6 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
content = ZoomableImage(
_enteFile,
tagPrefix: widget.tagPrefix,
shouldDisableScroll: widget.shouldDisableScroll,
backgroundDecoration: widget.backgroundDecoration,
);
}
@ -138,7 +136,8 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
}
Future<File?> _getLivePhotoVideo() async {
if (_enteFile.isRemoteFile && !(await isFileCached(_enteFile, liveVideo: true))) {
if (_enteFile.isRemoteFile &&
!(await isFileCached(_enteFile, liveVideo: true))) {
showShortToast(context, S.of(context).downloading);
}
@ -206,5 +205,4 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
}
});
}
}

View file

@ -16,14 +16,12 @@ import 'package:photos/utils/toast_util.dart';
class ZoomableLiveImageNew extends StatefulWidget {
final EnteFile enteFile;
final Function(bool)? shouldDisableScroll;
final String? tagPrefix;
final Decoration? backgroundDecoration;
const ZoomableLiveImageNew(
this.enteFile, {
Key? key,
this.shouldDisableScroll,
required this.tagPrefix,
this.backgroundDecoration,
}) : super(key: key);
@ -77,7 +75,6 @@ class _ZoomableLiveImageNewState extends State<ZoomableLiveImageNew>
content = ZoomableImage(
_enteFile,
tagPrefix: widget.tagPrefix,
shouldDisableScroll: widget.shouldDisableScroll,
backgroundDecoration: widget.backgroundDecoration,
);
}