如图,如何在触发播放drawable点击事件的时候,不触发歌词自定义view本身的点击事件?
判断是否触发播放drawable点击事件的相关代码
// 指示器图片
private Drawable mPlayDrawable;mPlayDrawable.setBounds(mPlayRect);mPlayDrawable.draw(canvas); private boolean onClickPlayButton(MotionEvent event) {
float left = mPlayRect.left;
float right = mPlayRect.right;
float top = mHeight / 2 - mIconHeight;
float bottom = top + mIconHeight * 2;
float x = event.getX();
float y = event.getY();
return x > left
&& x < right
&& y > top
&& y < bottom;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货