|
1 | 1 | import 'package:flutter/gestures.dart'; |
2 | 2 | import 'package:flutter/material.dart'; |
3 | 3 | import 'package:flutter_hooks/flutter_hooks.dart'; |
| 4 | +import 'package:flutter_volume_controller/flutter_volume_controller.dart'; |
4 | 5 | import 'package:iris/globals.dart' show speedStops, speedSelectorItemWidth; |
5 | 6 | import 'package:iris/hooks/use_brightness.dart'; |
6 | 7 | import 'package:iris/hooks/use_volume.dart'; |
@@ -101,16 +102,16 @@ Gesture useGesture({ |
101 | 102 | final screenWidth = MediaQuery.sizeOf(context).width; |
102 | 103 | final tapDx = details.globalPosition.dx; |
103 | 104 |
|
104 | | - if (tapDx > screenWidth * 0.7) { |
105 | | - // 右侧 30% |
| 105 | + if (tapDx > screenWidth * 0.75) { |
| 106 | + // 右侧 25% |
106 | 107 | showProgress(); |
107 | 108 | player.forward(10); |
108 | | - } else if (tapDx < screenWidth * 0.3) { |
109 | | - // 左侧 30% |
| 109 | + } else if (tapDx < screenWidth * 0.25) { |
| 110 | + // 左侧 25% |
110 | 111 | showProgress(); |
111 | 112 | player.backward(10); |
112 | 113 | } else { |
113 | | - // 中间 40% |
| 114 | + // 中间 50% |
114 | 115 | if (player.isPlaying) { |
115 | 116 | useAppStore().updateAutoPlay(false); |
116 | 117 | player.pause(); |
@@ -259,6 +260,10 @@ Gesture useGesture({ |
259 | 260 | isLeftGesture.value = |
260 | 261 | startOffset.dx < MediaQuery.sizeOf(context).width / 2; |
261 | 262 | isRightGesture.value = !isLeftGesture.value; |
| 263 | + |
| 264 | + if (isRightGesture.value) { |
| 265 | + FlutterVolumeController.updateShowSystemUI(false); |
| 266 | + } |
262 | 267 | } |
263 | 268 |
|
264 | 269 | final double dy = details.delta.dy; |
@@ -287,6 +292,8 @@ Gesture useGesture({ |
287 | 292 | }; |
288 | 293 | isLeftGesture.value = false; |
289 | 294 | isRightGesture.value = false; |
| 295 | + |
| 296 | + FlutterVolumeController.updateShowSystemUI(true); |
290 | 297 | } |
291 | 298 |
|
292 | 299 | void onPanEnd(DragEndDetails details) => _resetPanState(); |
|
0 commit comments