Merge pull request #360 from ente-io/zoom_improvements

Zoom improvements
This commit is contained in:
Neeraj Gupta 2022-06-27 09:09:50 +05:30 committed by GitHub
commit 7307383cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View file

@ -141,9 +141,11 @@ class _DetailPageState extends State<DetailPage> {
autoPlay: !_hasPageChanged,
tagPrefix: widget.config.tagPrefix,
shouldDisableScroll: (value) {
setState(() {
_shouldDisableScroll = value;
});
if (_shouldDisableScroll != value) {
setState(() {
_shouldDisableScroll = value;
});
}
},
playbackCallback: (isPlaying) {
_shouldHideAppBar = isPlaying;

View file

@ -48,11 +48,13 @@ class _ZoomableImageState extends State<ZoomableImage>
@override
void initState() {
_photo = widget.photo;
debugPrint('initState for ${_photo.toString()}');
_scaleStateChangedCallback = (value) {
if (widget.shouldDisableScroll != null) {
widget.shouldDisableScroll(value != PhotoViewScaleState.initial);
}
_isZooming = value != PhotoViewScaleState.initial;
debugPrint("isZooming = $_isZooming, currentState $value");
// _logger.info('is reakky zooming $_isZooming with state $value');
};
super.initState();
@ -68,15 +70,18 @@ class _ZoomableImageState extends State<ZoomableImage>
Widget content;
if (_imageProvider != null) {
content = PhotoView(
imageProvider: _imageProvider,
scaleStateChangedCallback: _scaleStateChangedCallback,
minScale: PhotoViewComputedScale.contained,
gaplessPlayback: true,
heroAttributes: PhotoViewHeroAttributes(
tag: widget.tagPrefix + _photo.tag(),
content = PhotoViewGestureDetectorScope(
axis: Axis.vertical,
child: PhotoView(
imageProvider: _imageProvider,
scaleStateChangedCallback: _scaleStateChangedCallback,
minScale: PhotoViewComputedScale.contained,
gaplessPlayback: true,
heroAttributes: PhotoViewHeroAttributes(
tag: widget.tagPrefix + _photo.tag(),
),
backgroundDecoration: widget.backgroundDecoration,
),
backgroundDecoration: widget.backgroundDecoration,
);
} else {
content = loadWidget;

View file

@ -11,7 +11,7 @@ description: ente photos application
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.6.7+337
version: 0.6.8+338
environment:
sdk: ">=2.10.0 <3.0.0"