Merge pull request #360 from ente-io/zoom_improvements
Zoom improvements
This commit is contained in:
commit
7307383cea
3 changed files with 19 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue