Skip to content

Commit

Permalink
1. 优化长按即点击的模式下,修复禁用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjh committed Jun 4, 2024
1 parent 3465925 commit 8a75095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ public void onPictureTaken(@NonNull PictureResult result) {
public void onVideoTaken(@NonNull VideoResult result) {
Log.d(TAG, "onVideoTaken");
super.onVideoTaken(result);
// 处理视频文件,最后会解除《禁止点击》
getCameraVideoPresenter().onVideoTaken(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ public boolean onTouchEvent(MotionEvent event) {
// 进度已满,不执行任何动作
return true;
}
// 判断是否禁用模式
if (!touchable) {
mClickOrLongListener.onBanClickTips();
return true;
Expand All @@ -510,7 +511,12 @@ public boolean onTouchEvent(MotionEvent event) {
case MotionEvent.ACTION_UP:
if (mButtonState == BUTTON_STATE_CLICK_AND_HOLD) {
// 点击即长按模式
if (recordState == RECORD_NOT_STARTED) {
if (recordState != RECORD_STARTED) {
// 判断是否禁用模式
if (!touchable) {
mClickOrLongListener.onBanClickTips();
return true;
}
// 未启动状态,即立刻启动长按动画
step = STEP_ACTION_DOWN;
startTicking();
Expand Down

0 comments on commit 8a75095

Please sign in to comment.