本文整理了Java中android.app.Activity.dispatchTouchEvent()
方法的一些代码示例,展示了Activity.dispatchTouchEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.dispatchTouchEvent()
方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:dispatchTouchEvent
暂无
代码示例来源:origin: navasmdc/MaterialDesignLibrary
@Override
public boolean onTouchEvent(MotionEvent event) {
return activity.dispatchTouchEvent(event);
}
代码示例来源:origin: eleme/UETool
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
bindActivity.dispatchTouchEvent(event);
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: Neamar/KISS
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (mPopup != null && ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
dismissPopup();
return true;
}
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: com.uphyca/android-junit4-robolectric
/**
* @param ev
* @return
* @see android.app.Activity#dispatchTouchEvent(android.view.MotionEvent)
*/
public boolean dispatchTouchEvent(MotionEvent ev) {
return mActivity.dispatchTouchEvent(ev);
}
代码示例来源:origin: AllenCoder/Recyclerview
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: AllenCoder/Recyclerview
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: AllenCoder/Recyclerview
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: iqiyi/Neptune
@Override
public boolean dispatchTouchEvent(android.view.MotionEvent motionevent0) {
return mOriginActivity.dispatchTouchEvent(motionevent0);
}
代码示例来源:origin: GeoODK/collect
@Override
public boolean dispatchTouchEvent(MotionEvent mv) {
boolean handled = mGestureDetector.onTouchEvent(mv);
if (!handled) {
return super.dispatchTouchEvent(mv);
}
return handled; // this is always true
}
代码示例来源:origin: HenriDellal/emerald
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
gestureDetector.onTouchEvent(event);
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: Demidong/ClockView
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
System.out.println("activty dispatchTouchEvent..."+event.getAction());
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: billthefarmer/diary
@Override
public boolean dispatchTouchEvent(MotionEvent event)
{
if (event.getPointerCount() > 1)
multi = true;
gestureDetector.onTouchEvent(event);
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: geniusgithub/MediaPlayer
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
boolean flag = mVideoPlayerFragment.dispatchTouchEvent(ev);
if (flag){
return true;
}
return super.dispatchTouchEvent(ev);
}
}
代码示例来源:origin: gearvrf/GearVRf-Demos
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
if (application.dispatchTouchEvent(event)) {
return true;
}
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: googlesamples/android-SkeletonWearableApp
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
return mGestureDetector.onTouchEvent(event) || super.dispatchTouchEvent(event);
}
代码示例来源:origin: googlesamples/android-WatchViewStub
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
return mGestureDetector.onTouchEvent(event) || super.dispatchTouchEvent(event);
}
代码示例来源:origin: zendesk/belvedere
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, final MotionEvent event) {
boolean dismiss = true;
final int touchX = (int) event.getRawX();
final int touchY = (int) event.getRawY();
for(int id : touchableIds) {
View view = activity.findViewById(id);
if(view != null) {
final Rect viewRect = new Rect();
view.getGlobalVisibleRect(viewRect);
final boolean xMatch = touchX >= viewRect.left && touchX <= viewRect.right;
final boolean yMatch = touchY >= viewRect.top && touchY <= viewRect.bottom;
if(xMatch && yMatch) {
dismiss = false;
activity.dispatchTouchEvent(MotionEvent.obtain(event));
break;
}
}
}
if(dismiss) {
dismiss();
}
return true;
}
});
代码示例来源:origin: liudao01/EventCollect
/**
* @explain 重写dispatchTouchEvent
* @author liuml.
* @time 2017/6/22 15:24
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
/**
* collect view interaction data, i.e. button clicked.
*/
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss:SSS");
// String date = sdf.format(new java.util.Date());
// LogUtil.d("开始时间 : " + date);
appCollectUtil.getInstance().recognizeViewEvent(ev, this.getWindow().getDecorView(), this);
// SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss:SSS");
// String date2 = sdf2.format(new java.util.Date());
// LogUtil.d("结束时间 : " + date2);//自己项目测试大约1 - 8毫秒 可以接受
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: easilycoder/GuideView
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (bundle.isTargetViewClickAble() && isTouchOnTargetView(ev)) {
// dispatch touch event the the root activity
// make the targetView receive the touch event
if (getContext() instanceof Activity) {
((Activity) getContext()).dispatchTouchEvent(ev);
}
if (ev.getAction() == MotionEvent.ACTION_UP) {
if (targetViewClickListener != null) {
targetViewClickListener.onGuideViewClicked();
}
}
return true;
}
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: stackoverflow.com
Log.i("touch", arg0.toString() + ":" + arg1.toString());
_activity.dispatchTouchEvent(arg1);
内容来源于网络,如有侵权,请联系作者删除!