#898 fixed viewer transition effects for RTL locales
This commit is contained in:
parent
b32f409b35
commit
c65bda181a
2 changed files with 5 additions and 4 deletions
|
@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
- motion photo detection for xml variant of google container item
|
||||
- HEIF size detection for some corrupted files
|
||||
- viewer transition direction for RTL locales
|
||||
- viewer transition direction & effects for RTL locales
|
||||
|
||||
## <a id="v1.10.3"></a>[v1.10.3] - 2024-01-29
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class PageTransitionEffects {
|
||||
|
@ -14,7 +15,7 @@ class PageTransitionEffects {
|
|||
final position = (pageController.page! - index).clamp(-1.0, 1.0);
|
||||
final width = pageController.position.viewportDimension;
|
||||
opacity = (1 - position.abs()).clamp(0, 1);
|
||||
dx = position * width;
|
||||
dx = position * width * (context.isRtl ? -1 : 1);
|
||||
if (zoomIn) {
|
||||
scale = 1 + position;
|
||||
}
|
||||
|
@ -42,7 +43,7 @@ class PageTransitionEffects {
|
|||
final position = (pageController.page! - index).clamp(-1.0, 1.0);
|
||||
final width = pageController.position.viewportDimension;
|
||||
if (parallax) {
|
||||
dx = position * width / 2;
|
||||
dx = position * width / 2 * (context.isRtl ? -1 : 1);
|
||||
}
|
||||
}
|
||||
return ClipRect(
|
||||
|
@ -64,7 +65,7 @@ class PageTransitionEffects {
|
|||
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;
|
||||
dx = position * width * (context.isRtl ? -1 : 1);
|
||||
}
|
||||
return Opacity(
|
||||
opacity: opacity,
|
||||
|
|
Loading…
Reference in a new issue