Skip to content

Commit

Permalink
fix: 无歌词也支持点击
Browse files Browse the repository at this point in the history
  • Loading branch information
石工 committed Apr 23, 2021
1 parent 33391ca commit d00707f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lrcview/src/main/java/me/wcy/lrcview/LrcView.java
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public boolean onTouchEvent(MotionEvent event) {
@Override
public boolean onDown(MotionEvent e) {
if (!hasLrc()) {
return super.onDown(e);
return mOnTapListener != null;
}
isTouching = true;
removeCallbacks(hideTimelineRunnable);
Expand Down Expand Up @@ -579,10 +579,7 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve

@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if (!hasLrc()) {
return super.onSingleTapConfirmed(e);
}
if (mOnPlayClickListener != null && isShowTimeline && mPlayDrawable.getBounds().contains((int) e.getX(), (int) e.getY())) {
if (hasLrc() && mOnPlayClickListener != null && isShowTimeline && mPlayDrawable.getBounds().contains((int) e.getX(), (int) e.getY())) {
int centerLine = getCenterLine();
long centerLineTime = mLrcEntryList.get(centerLine).getTime();
// onPlayClick 消费了才更新 UI
Expand Down

0 comments on commit d00707f

Please sign in to comment.