mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: slide gesture
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -125,15 +125,19 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
|
||||
return GStorage.slideDismissReplyPage
|
||||
? GestureDetector(
|
||||
onPanDown: (event) {
|
||||
_downPos = event.localPosition;
|
||||
if (event.localPosition.dx > 30) {
|
||||
_isSliding = false;
|
||||
} else {
|
||||
_downPos = event.localPosition;
|
||||
}
|
||||
},
|
||||
onPanUpdate: (event) {
|
||||
if (_isSliding == false) {
|
||||
return;
|
||||
} else if (_isSliding == null) {
|
||||
if (_downPos != null && _downPos!.dx <= 25) {
|
||||
if (_downPos != null) {
|
||||
Offset cumulativeDelta = event.localPosition - _downPos!;
|
||||
if (cumulativeDelta.dx.abs() > 3 * cumulativeDelta.dy.abs()) {
|
||||
if (cumulativeDelta.dx.abs() >= cumulativeDelta.dy.abs()) {
|
||||
_isSliding = true;
|
||||
setState(() {
|
||||
padding.value = event.localPosition.dx;
|
||||
|
||||
@@ -675,22 +675,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
videoDetailController.animationController.value == 1) {
|
||||
videoDetailController.isExpanding = false;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (videoDetailController.scrollKey.currentState?.mounted ==
|
||||
true) {
|
||||
videoDetailController.scrollRatio.value = 0;
|
||||
videoDetailController.scrollKey.currentState
|
||||
?.setState(() {});
|
||||
}
|
||||
videoDetailController.scrollRatio.value = 0;
|
||||
refreshPage();
|
||||
});
|
||||
} else if (videoDetailController.isCollapsing &&
|
||||
videoDetailController.animationController.value == 1) {
|
||||
videoDetailController.isCollapsing = false;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (videoDetailController.scrollKey.currentState?.mounted ==
|
||||
true) {
|
||||
videoDetailController.scrollKey.currentState
|
||||
?.setState(() {});
|
||||
}
|
||||
refreshPage();
|
||||
});
|
||||
}
|
||||
return height;
|
||||
@@ -731,7 +723,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
showStatusBar();
|
||||
}
|
||||
}
|
||||
if (removeSafeArea && isFullScreen) {
|
||||
if (removeSafeArea &&
|
||||
isFullScreen &&
|
||||
videoDetailController.direction.value ==
|
||||
'vertical') {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
refreshPage();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user