本文整理汇总了Java中org.chromium.content.browser.SPenSupport类的典型用法代码示例。如果您正苦于以下问题:Java SPenSupport类的具体用法?Java SPenSupport怎么用?Java SPenSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SPenSupport类属于org.chromium.content.browser包,在下文中一共展示了SPenSupport类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setContentViewMotionEventOffsets
import org.chromium.content.browser.SPenSupport; //导入依赖的package包/类
private void setContentViewMotionEventOffsets(MotionEvent e, boolean canClear) {
// TODO(dtrainor): Factor this out to LayoutDriver.
if (e == null || mTabVisible == null) return;
ContentViewCore contentViewCore = mTabVisible.getContentViewCore();
if (contentViewCore == null) return;
int actionMasked = e.getActionMasked();
if (SPenSupport.isSPenSupported(getContext())) {
actionMasked = SPenSupport.convertSPenEventAction(actionMasked);
}
if (actionMasked == MotionEvent.ACTION_DOWN
|| actionMasked == MotionEvent.ACTION_HOVER_ENTER) {
if (mLayoutManager != null) mLayoutManager.getViewportPixel(mCacheViewport);
contentViewCore.setCurrentTouchEventOffsets(-mCacheViewport.left, -mCacheViewport.top);
} else if (canClear && (actionMasked == MotionEvent.ACTION_UP
|| actionMasked == MotionEvent.ACTION_CANCEL
|| actionMasked == MotionEvent.ACTION_HOVER_EXIT)) {
contentViewCore.setCurrentTouchEventOffsets(0.f, 0.f);
}
}
示例2: getMotionOffsets
import org.chromium.content.browser.SPenSupport; //导入依赖的package包/类
private Point getMotionOffsets(MotionEvent e) {
int actionMasked = e.getActionMasked();
if (SPenSupport.isSPenSupported(mHost.getContext())) {
actionMasked = SPenSupport.convertSPenEventAction(actionMasked);
}
if (actionMasked == MotionEvent.ACTION_DOWN
|| actionMasked == MotionEvent.ACTION_HOVER_ENTER) {
getViewportPixel(mCachedRect);
mCachedPoint.set(-mCachedRect.left, -mCachedRect.top);
return mCachedPoint;
} else if (actionMasked == MotionEvent.ACTION_UP
|| actionMasked == MotionEvent.ACTION_CANCEL
|| actionMasked == MotionEvent.ACTION_HOVER_EXIT) {
mCachedPoint.set(0, 0);
return mCachedPoint;
}
return null;
}
示例3: setContentViewMotionEventOffsets
import org.chromium.content.browser.SPenSupport; //导入依赖的package包/类
private void setContentViewMotionEventOffsets(MotionEvent e, boolean canClear) {
// TODO(dtrainor): Factor this out to LayoutDriver.
if (e == null || mTabVisible == null) return;
ContentViewCore contentViewCore = mTabVisible.getContentViewCore();
if (contentViewCore == null) return;
int actionMasked = e.getActionMasked();
if (SPenSupport.isSPenSupported(getContext())) {
actionMasked = SPenSupport.convertSPenEventAction(actionMasked);
}
if (actionMasked == MotionEvent.ACTION_DOWN
|| actionMasked == MotionEvent.ACTION_HOVER_ENTER) {
if (mLayoutManager != null) mLayoutManager.getViewportPixel(mCacheViewport);
contentViewCore.setCurrentMotionEventOffsets(-mCacheViewport.left, -mCacheViewport.top);
} else if (canClear && (actionMasked == MotionEvent.ACTION_UP
|| actionMasked == MotionEvent.ACTION_CANCEL
|| actionMasked == MotionEvent.ACTION_HOVER_EXIT)) {
contentViewCore.setCurrentMotionEventOffsets(0.f, 0.f);
}
}