Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Make faces timeline slider drive real-time playback

laurenspriem17a11a8f7262
diff --git a/mobile/apps/photos/lib/ui/viewer/people/faces_timeline_page.dart b/mobile/apps/photos/lib/ui/viewer/people/faces_timeline_page.dart
index 8d5d626181..a962cf8a05 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/faces_timeline_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/faces_timeline_page.dart
@@ -518,13 +518,37 @@ class _FacesTimelinePageState extends State<FacesTimelinePage>
value: sliderValue.toDouble(),
min: 0.0,
max: frameCount > 1 ? maxValue : 0.0,
- divisions: frameCount > 1 ? frameCount - 1 : null,
- onChangeStart: frameCount > 1 ? (value) => _pausePlayback() : null,
+ divisions: frameCount > 1 ? (frameCount - 1) * 4 : null,
+ onChangeStart: frameCount > 1
+ ? (value) {
+ _pausePlayback();
+ _isAnimatingCard = false;
+ _cardTransitionController.stop();
+ }
+ : null,
onChanged: frameCount > 1
? (value) {
- final index =
+ final clamped = value.clamp(0.0, maxValue);
+ setState(() {
+ _sliderValue = clamped;
+ _stackProgress = clamped;
+ _currentIndex = clamped.round().clamp(0, frameCount - 1);
+ final frame = _frames[_currentIndex];
+ _previousCaptionValue = _currentCaptionValue;
+ _currentCaptionValue = frame.captionValue;
+ _currentCaptionType = frame.captionType;
+ });
+ }
+ : null,
+ onChangeEnd: frameCount > 1
+ ? (value) {
+ final target =
value.round().clamp(0, frameCount - 1).toInt();
- _setCurrentFrame(index);
+ setState(() {
+ _currentIndex = target;
+ _sliderValue = target.toDouble();
+ _stackProgress = _sliderValue;
+ });
}
: null,
),