本文整理了Java中android.widget.ImageButton.onTouchEvent()
方法的一些代码示例,展示了ImageButton.onTouchEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageButton.onTouchEvent()
方法的具体详情如下:
包路径:android.widget.ImageButton
类名称:ImageButton
方法名:onTouchEvent
暂无
代码示例来源:origin: Clans/FloatingActionButton
@Override
public boolean onTouchEvent(MotionEvent event) {
if (mClickListener != null && isEnabled()) {
Label label = (Label) getTag(R.id.fab_label);
if (label == null) return super.onTouchEvent(event);
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
if (label != null) {
label.onActionUp();
}
onActionUp();
break;
case MotionEvent.ACTION_CANCEL:
if (label != null) {
label.onActionUp();
}
onActionUp();
break;
}
mGestureDetector.onTouchEvent(event);
}
return super.onTouchEvent(event);
}
代码示例来源:origin: WiInputMethod/VE
@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
return super.onTouchEvent(event);
}
代码示例来源:origin: souch/SMP
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
// remove the repeater, but call the hook one more time
removeCallbacks(mRepeater);
if (mStartTime != 0) {
doRepeat(true);
mStartTime = 0;
}
}
return super.onTouchEvent(event);
}
代码示例来源:origin: douzifly/clear-todolist
@Override
public boolean onTouchEvent(MotionEvent event) {
if (mClickListener != null && isEnabled()) {
Label label = (Label) getTag(R.id.fab_label);
if (label == null) return super.onTouchEvent(event);
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
if (label != null) {
label.onActionUp();
}
break;
}
mGestureDetector.onTouchEvent(event);
}
return super.onTouchEvent(event);
}
代码示例来源:origin: xiangtailiang/FakeGPS
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
mIsPressDown = true;
postDelayed(mLongPressDetectorRunnable, 1000);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
removeCallbacks(mLongPressDetectorRunnable);
mIsPressDown = false;
break;
}
return super.onTouchEvent(event);
}
代码示例来源:origin: Blankeer/MDWechat
@Override
public boolean onTouchEvent(MotionEvent event) {
if (mClickListener != null && isEnabled()) {
Label label = (Label) getTag(R.id.fab_label);
if (label == null) return super.onTouchEvent(event);
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
if (label != null) {
label.onActionUp();
}
onActionUp();
break;
case MotionEvent.ACTION_CANCEL:
if (label != null) {
label.onActionUp();
}
onActionUp();
break;
}
mGestureDetector.onTouchEvent(event);
}
return super.onTouchEvent(event);
}
内容来源于网络,如有侵权,请联系作者删除!