本文整理了Java中android.view.MotionEvent.getFlags()
方法的一些代码示例,展示了MotionEvent.getFlags()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MotionEvent.getFlags()
方法的具体详情如下:
包路径:android.view.MotionEvent
类名称:MotionEvent
方法名:getFlags
暂无
代码示例来源:origin: TonicArtos/StickyGridHeaders
private MotionEvent transformEvent(MotionEvent e, int headerPosition) {
if (headerPosition == MATCHED_STICKIED_HEADER) {
return e;
}
long downTime = e.getDownTime();
long eventTime = e.getEventTime();
int action = e.getAction();
int pointerCount = e.getPointerCount();
int[] pointerIds = getPointerIds(e);
MotionEvent.PointerCoords[] pointerCoords = getPointerCoords(e);
int metaState = e.getMetaState();
float xPrecision = e.getXPrecision();
float yPrecision = e.getYPrecision();
int deviceId = e.getDeviceId();
int edgeFlags = e.getEdgeFlags();
int source = e.getSource();
int flags = e.getFlags();
View headerHolder = getChildAt(headerPosition);
for (int i = 0; i < pointerCount;i++) {
pointerCoords[i].y -= headerHolder.getTop();
}
MotionEvent n = MotionEvent.obtain(downTime, eventTime, action,
pointerCount, pointerIds, pointerCoords, metaState, xPrecision,
yPrecision, deviceId, edgeFlags, source, flags);
return n;
}
代码示例来源:origin: robolectric/robolectric
check("buttonState()").that(actual().getButtonState()).isEqualTo(other.getButtonState());
check("deviceId()").that(actual().getDeviceId()).isEqualTo(other.getDeviceId());
check("getFlags()").that(actual().getFlags()).isEqualTo(other.getFlags());
check("getEdgeFlags()").that(actual().getEdgeFlags()).isEqualTo(other.getEdgeFlags());
check("getXPrecision()").that(actual().getXPrecision()).isEqualTo(other.getXPrecision());
代码示例来源:origin: stackoverflow.com
@Override
public boolean onFilterTouchEventForSecurity(MotionEvent event) {
if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) == MotionEvent.FLAG_WINDOW_IS_OBSCURED){
// show error message
return false;
}
return super.onFilterTouchEventForSecurity(event);
代码示例来源:origin: Calsign/APDE
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
/*
* See comments for isTouchObscured above.
*/
isTouchObscured = (event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0;
return super.dispatchTouchEvent(event);
}
代码示例来源:origin: THEONE10211024/ApiDemos
public boolean onTouch(View v, MotionEvent event) {
if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) {
if (event.getAction() == MotionEvent.ACTION_UP) {
new AlertDialog.Builder(SecureView.this)
.setTitle(R.string.secure_view_caught_dialog_title)
.setMessage(R.string.secure_view_caught_dialog_message)
.setNeutralButton(getResources().getString(
R.string.secure_view_caught_dialog_dismiss), null)
.show();
}
// Return true to prevent the button from processing the touch.
return true;
}
return false;
}
});
代码示例来源:origin: qiubiteme/android_api_demos
public boolean onTouch(View v, MotionEvent event) {
if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) {
if (event.getAction() == MotionEvent.ACTION_UP) {
new AlertDialog.Builder(SecureView.this)
.setTitle(R.string.secure_view_caught_dialog_title)
.setMessage(R.string.secure_view_caught_dialog_message)
.setNeutralButton(getResources().getString(
R.string.secure_view_caught_dialog_dismiss), null)
.show();
}
// Return true to prevent the button from processing the touch.
return true;
}
return false;
}
});
代码示例来源:origin: Unity-Technologies/unity-ads-android
@TargetApi(14)
public boolean onInterceptTouchEvent(MotionEvent e) {
super.onInterceptTouchEvent(e);
if (_shouldCapture) {
if (_motionEvents.size() < _maxEvents) {
boolean isObscured = (e.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0;
synchronized (_motionEvents) {
_motionEvents.add(new AdUnitMotionEvent(e.getActionMasked(), isObscured, e.getToolType(0), e.getSource(), e.getDeviceId(), e.getX(0), e.getY(0), e.getEventTime(), e.getPressure(0), e.getSize(0)));
}
}
}
return false;
}
代码示例来源:origin: gqjjqg/android-extend
ev.getEdgeFlags(), ev.getSource(), ev.getFlags());
代码示例来源:origin: stackoverflow.com
.getXPrecision(), event.getYPrecision(), event
.getDeviceId(), event.getEdgeFlags(),
event.getSource(), event.getFlags());
代码示例来源:origin: canqihe/TmallSale
private MotionEvent transformEvent(MotionEvent e, int headerPosition) {
if (headerPosition == MATCHED_STICKIED_HEADER) {
return e;
}
long downTime = e.getDownTime();
long eventTime = e.getEventTime();
int action = e.getAction();
int pointerCount = e.getPointerCount();
int[] pointerIds = getPointerIds(e);
MotionEvent.PointerCoords[] pointerCoords = getPointerCoords(e);
int metaState = e.getMetaState();
float xPrecision = e.getXPrecision();
float yPrecision = e.getYPrecision();
int deviceId = e.getDeviceId();
int edgeFlags = e.getEdgeFlags();
int source = e.getSource();
int flags = e.getFlags();
View headerHolder = getChildAt(headerPosition);
for (int i = 0; i < pointerCount; i++) {
pointerCoords[i].y -= headerHolder.getTop();
}
MotionEvent n = MotionEvent.obtain(downTime, eventTime, action,
pointerCount, pointerIds, pointerCoords, metaState, xPrecision,
yPrecision, deviceId, edgeFlags, source, flags);
return n;
}
代码示例来源:origin: GcsSloop/ViewSupport
int edgeFlags = e.getEdgeFlags();
int source = e.getSource();
int flags = e.getFlags();
内容来源于网络,如有侵权,请联系作者删除!