mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 16:48:43 +00: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
|
return GStorage.slideDismissReplyPage
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onPanDown: (event) {
|
onPanDown: (event) {
|
||||||
|
if (event.localPosition.dx > 30) {
|
||||||
|
_isSliding = false;
|
||||||
|
} else {
|
||||||
_downPos = event.localPosition;
|
_downPos = event.localPosition;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onPanUpdate: (event) {
|
onPanUpdate: (event) {
|
||||||
if (_isSliding == false) {
|
if (_isSliding == false) {
|
||||||
return;
|
return;
|
||||||
} else if (_isSliding == null) {
|
} else if (_isSliding == null) {
|
||||||
if (_downPos != null && _downPos!.dx <= 25) {
|
if (_downPos != null) {
|
||||||
Offset cumulativeDelta = event.localPosition - _downPos!;
|
Offset cumulativeDelta = event.localPosition - _downPos!;
|
||||||
if (cumulativeDelta.dx.abs() > 3 * cumulativeDelta.dy.abs()) {
|
if (cumulativeDelta.dx.abs() >= cumulativeDelta.dy.abs()) {
|
||||||
_isSliding = true;
|
_isSliding = true;
|
||||||
setState(() {
|
setState(() {
|
||||||
padding.value = event.localPosition.dx;
|
padding.value = event.localPosition.dx;
|
||||||
|
|||||||
@@ -675,22 +675,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
videoDetailController.animationController.value == 1) {
|
videoDetailController.animationController.value == 1) {
|
||||||
videoDetailController.isExpanding = false;
|
videoDetailController.isExpanding = false;
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (videoDetailController.scrollKey.currentState?.mounted ==
|
|
||||||
true) {
|
|
||||||
videoDetailController.scrollRatio.value = 0;
|
videoDetailController.scrollRatio.value = 0;
|
||||||
videoDetailController.scrollKey.currentState
|
refreshPage();
|
||||||
?.setState(() {});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else if (videoDetailController.isCollapsing &&
|
} else if (videoDetailController.isCollapsing &&
|
||||||
videoDetailController.animationController.value == 1) {
|
videoDetailController.animationController.value == 1) {
|
||||||
videoDetailController.isCollapsing = false;
|
videoDetailController.isCollapsing = false;
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (videoDetailController.scrollKey.currentState?.mounted ==
|
refreshPage();
|
||||||
true) {
|
|
||||||
videoDetailController.scrollKey.currentState
|
|
||||||
?.setState(() {});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return height;
|
return height;
|
||||||
@@ -731,7 +723,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
showStatusBar();
|
showStatusBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (removeSafeArea && isFullScreen) {
|
if (removeSafeArea &&
|
||||||
|
isFullScreen &&
|
||||||
|
videoDetailController.direction.value ==
|
||||||
|
'vertical') {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
refreshPage();
|
refreshPage();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user