slideshow: option for no transition
This commit is contained in:
parent
ce0a253369
commit
3261e79c78
8 changed files with 42 additions and 1 deletions
|
@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- mosaic layout
|
- mosaic layout
|
||||||
|
- slideshow: option for no transition
|
||||||
|
|
||||||
## <a id="v1.7.0"></a>[v1.7.0] - 2022-09-19
|
## <a id="v1.7.0"></a>[v1.7.0] - 2022-09-19
|
||||||
|
|
||||||
|
|
|
@ -207,6 +207,7 @@
|
||||||
"viewerTransitionParallax": "Parallax",
|
"viewerTransitionParallax": "Parallax",
|
||||||
"viewerTransitionFade": "Fade",
|
"viewerTransitionFade": "Fade",
|
||||||
"viewerTransitionZoomIn": "Zoom in",
|
"viewerTransitionZoomIn": "Zoom in",
|
||||||
|
"viewerTransitionNone": "None",
|
||||||
|
|
||||||
"wallpaperTargetHome": "Home screen",
|
"wallpaperTargetHome": "Home screen",
|
||||||
"wallpaperTargetLock": "Lock screen",
|
"wallpaperTargetLock": "Lock screen",
|
||||||
|
|
|
@ -167,6 +167,7 @@
|
||||||
"viewerTransitionParallax": "Parallaxe",
|
"viewerTransitionParallax": "Parallaxe",
|
||||||
"viewerTransitionFade": "Fondu",
|
"viewerTransitionFade": "Fondu",
|
||||||
"viewerTransitionZoomIn": "Zoom",
|
"viewerTransitionZoomIn": "Zoom",
|
||||||
|
"viewerTransitionNone": "Aucune",
|
||||||
|
|
||||||
"wallpaperTargetHome": "Écran d’accueil",
|
"wallpaperTargetHome": "Écran d’accueil",
|
||||||
"wallpaperTargetLock": "Écran de verrouillage",
|
"wallpaperTargetLock": "Écran de verrouillage",
|
||||||
|
|
|
@ -167,6 +167,7 @@
|
||||||
"viewerTransitionParallax": "시차",
|
"viewerTransitionParallax": "시차",
|
||||||
"viewerTransitionFade": "페이드",
|
"viewerTransitionFade": "페이드",
|
||||||
"viewerTransitionZoomIn": "확대",
|
"viewerTransitionZoomIn": "확대",
|
||||||
|
"viewerTransitionNone": "없음",
|
||||||
|
|
||||||
"wallpaperTargetHome": "홈 화면",
|
"wallpaperTargetHome": "홈 화면",
|
||||||
"wallpaperTargetLock": "잠금화면",
|
"wallpaperTargetLock": "잠금화면",
|
||||||
|
|
|
@ -28,6 +28,6 @@ enum VideoControls { play, playSeek, playOutside, none }
|
||||||
|
|
||||||
enum VideoLoopMode { never, shortOnly, always }
|
enum VideoLoopMode { never, shortOnly, always }
|
||||||
|
|
||||||
enum ViewerTransition { slide, parallax, fade, zoomIn }
|
enum ViewerTransition { slide, parallax, fade, zoomIn, none }
|
||||||
|
|
||||||
enum WidgetShape { rrect, circle, heart }
|
enum WidgetShape { rrect, circle, heart }
|
|
@ -15,6 +15,8 @@ extension ExtraViewerTransition on ViewerTransition {
|
||||||
return context.l10n.viewerTransitionFade;
|
return context.l10n.viewerTransitionFade;
|
||||||
case ViewerTransition.zoomIn:
|
case ViewerTransition.zoomIn:
|
||||||
return context.l10n.viewerTransitionZoomIn;
|
return context.l10n.viewerTransitionZoomIn;
|
||||||
|
case ViewerTransition.none:
|
||||||
|
return context.l10n.viewerTransitionNone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +30,8 @@ extension ExtraViewerTransition on ViewerTransition {
|
||||||
return PageTransitionEffects.fade(pageController, index, zoomIn: false);
|
return PageTransitionEffects.fade(pageController, index, zoomIn: false);
|
||||||
case ViewerTransition.zoomIn:
|
case ViewerTransition.zoomIn:
|
||||||
return PageTransitionEffects.fade(pageController, index, zoomIn: true);
|
return PageTransitionEffects.fade(pageController, index, zoomIn: true);
|
||||||
|
case ViewerTransition.none:
|
||||||
|
return PageTransitionEffects.none(pageController, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,4 +119,26 @@ class PageTransitionEffects {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static TransitionBuilder none(
|
||||||
|
PageController pageController,
|
||||||
|
int index,
|
||||||
|
) =>
|
||||||
|
(context, child) {
|
||||||
|
double opacity = 0;
|
||||||
|
double dx = 0;
|
||||||
|
if (pageController.hasClients && pageController.position.haveDimensions) {
|
||||||
|
final position = (pageController.page! - index).clamp(-1.0, 1.0);
|
||||||
|
final width = pageController.position.viewportDimension;
|
||||||
|
opacity = (1 - position.abs()).roundToDouble().clamp(0, 1);
|
||||||
|
dx = position * width;
|
||||||
|
}
|
||||||
|
return Opacity(
|
||||||
|
opacity: opacity,
|
||||||
|
child: Transform.translate(
|
||||||
|
offset: Offset(dx, 0),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
"de": [
|
"de": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
"el": [
|
"el": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@
|
||||||
"filterNoDateLabel",
|
"filterNoDateLabel",
|
||||||
"filterNoTitleLabel",
|
"filterNoTitleLabel",
|
||||||
"filterRecentlyAddedLabel",
|
"filterRecentlyAddedLabel",
|
||||||
|
"viewerTransitionNone",
|
||||||
"viewDialogReverseSortOrder",
|
"viewDialogReverseSortOrder",
|
||||||
"tileLayoutMosaic",
|
"tileLayoutMosaic",
|
||||||
"sortOrderNewestFirst",
|
"sortOrderNewestFirst",
|
||||||
|
@ -28,10 +31,12 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
"id": [
|
"id": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
"it": [
|
"it": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -40,6 +45,7 @@
|
||||||
"filterNoDateLabel",
|
"filterNoDateLabel",
|
||||||
"filterNoTitleLabel",
|
"filterNoTitleLabel",
|
||||||
"filterRecentlyAddedLabel",
|
"filterRecentlyAddedLabel",
|
||||||
|
"viewerTransitionNone",
|
||||||
"viewDialogReverseSortOrder",
|
"viewDialogReverseSortOrder",
|
||||||
"tileLayoutMosaic",
|
"tileLayoutMosaic",
|
||||||
"sortOrderNewestFirst",
|
"sortOrderNewestFirst",
|
||||||
|
@ -57,6 +63,7 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
"nl": [
|
"nl": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -64,6 +71,7 @@
|
||||||
"entryInfoActionEditTitleDescription",
|
"entryInfoActionEditTitleDescription",
|
||||||
"filterNoDateLabel",
|
"filterNoDateLabel",
|
||||||
"filterNoTitleLabel",
|
"filterNoTitleLabel",
|
||||||
|
"viewerTransitionNone",
|
||||||
"viewDialogReverseSortOrder",
|
"viewDialogReverseSortOrder",
|
||||||
"tileLayoutMosaic",
|
"tileLayoutMosaic",
|
||||||
"sortOrderNewestFirst",
|
"sortOrderNewestFirst",
|
||||||
|
@ -78,6 +86,7 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
"ru": [
|
"ru": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -96,6 +105,7 @@
|
||||||
"viewerTransitionParallax",
|
"viewerTransitionParallax",
|
||||||
"viewerTransitionFade",
|
"viewerTransitionFade",
|
||||||
"viewerTransitionZoomIn",
|
"viewerTransitionZoomIn",
|
||||||
|
"viewerTransitionNone",
|
||||||
"wallpaperTargetHome",
|
"wallpaperTargetHome",
|
||||||
"wallpaperTargetLock",
|
"wallpaperTargetLock",
|
||||||
"wallpaperTargetHomeLock",
|
"wallpaperTargetHomeLock",
|
||||||
|
@ -131,6 +141,7 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
"zh": [
|
"zh": [
|
||||||
|
"viewerTransitionNone",
|
||||||
"tileLayoutMosaic"
|
"tileLayoutMosaic"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue