mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
opt: cancel seek
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1152,27 +1152,8 @@ class PlPlayerController {
|
||||
_isSliderMoving.value = true;
|
||||
}
|
||||
|
||||
double? slideDy;
|
||||
bool? cancelSeek;
|
||||
bool? hasToast;
|
||||
void updateSlideDy(double dy) {
|
||||
slideDy ??= 0;
|
||||
slideDy = slideDy! + dy;
|
||||
if (slideDy!.abs() >= 100) {
|
||||
if (hasToast != true) {
|
||||
hasToast = true;
|
||||
SmartDialog.showToast(
|
||||
'取消${sliderPosition.value > position.value ? '快进' : '快退'}',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (hasToast == true) {
|
||||
hasToast = null;
|
||||
SmartDialog.showToast(
|
||||
sliderPosition.value > position.value ? '快进' : '快退',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void onUpdatedSliderProgress(Duration value) {
|
||||
_sliderTempPosition.value = value;
|
||||
@@ -1180,11 +1161,11 @@ class PlPlayerController {
|
||||
updateSliderPositionSecond();
|
||||
}
|
||||
|
||||
void onChangedSliderEnd([bool? isCancel]) {
|
||||
if (isCancel != true) {
|
||||
void onChangedSliderEnd() {
|
||||
if (cancelSeek != true) {
|
||||
feedBack();
|
||||
}
|
||||
slideDy = null;
|
||||
cancelSeek = null;
|
||||
hasToast = null;
|
||||
_isSliderMoving.value = false;
|
||||
_hideTaskControls();
|
||||
|
||||
Reference in New Issue
Block a user