本文整理汇总了Java中org.oscim.event.Gesture类的典型用法代码示例。如果您正苦于以下问题:Java Gesture类的具体用法?Java Gesture怎么用?Java Gesture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gesture类属于org.oscim.event包,在下文中一共展示了Gesture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (!(e instanceof MotionHandler)) return false;
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
示例2: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
//noinspection SimplifiableIfStatement
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
示例3: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture gesture, MotionEvent event) {
Point point = new Point();
mMap.viewport().fromScreenPoint(event.getX(), event.getY(), point);
int tileX = (int) (point.getX() / TILE_SCALE);
int tileY = (int) (point.getY() / TILE_SCALE);
if (tileX < 0 || tileX > 127 || tileY < 0 || tileY > 127)
return false;
Index.MapStatus mapStatus = mMapIndex.getNativeMap(tileX, tileY);
if (gesture instanceof Gesture.LongPress) {
if (mapStatus.downloading != 0L)
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.CANCEL);
else if (mapStatus.created > 0)
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.REMOVE);
return true;
}
if (gesture instanceof Gesture.Tap || gesture instanceof Gesture.DoubleTap) {
if (mapStatus.downloading != 0L)
return true;
if (mMapIndex.hasDownloadSizes()) {
if (mapStatus.downloadSize == 0L)
return true;
}
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.DOWNLOAD);
return true;
}
return false;
}
示例4: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(final Gesture g, final MotionEvent e) {
if (g instanceof Gesture.Tap) {
return activateSelectedMarker(e, _activeMarker_SingleTap);
}
if (g instanceof Gesture.LongPress) {
return activateSelectedMarker(e, _ActiveMarker_LongPress);
}
return false;
}
示例5: onItemSingleTapUp_shouldNotifyListener
import org.oscim.event.Gesture; //导入依赖的package包/类
@Test
public void onItemSingleTapUp_shouldNotifyListener() throws Exception {
ItemizedLayer<MarkerItem> poiLayer = mapFragment.getPoiLayer();
poiLayer.addItem(new MarkerItem("Title", "Description", new GeoPoint(0, 0)));
poiLayer.onGesture(Gesture.TAP, new FakeMotionEvent(0, 0));
assertThat(listener.getIndex()).isEqualTo(0);
assertThat(listener.getItem().getTitle()).isEqualTo("Title");
}
示例6: handleGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
boolean handleGesture(Gesture g, MotionEvent e) {
if (mDirtyLayers)
updateLayers();
for (Layer o : mLayers)
if (o instanceof GestureListener)
if (((GestureListener) o).onGesture(g, e))
return true;
return false;
}
示例7: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g == Gesture.DOUBLE_TAP) {
mDoubleTap = true;
return true;
}
return false;
}
示例8: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
示例9: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.LongPress) {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
return mReceiver.longPressHelper(p);
}
return false;
}
示例10: handleGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
public boolean handleGesture(Gesture g, MotionEvent e) {
this.updateMap(true);
return super.handleGesture(g, e);
}
示例11: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
return mListener.onGesture(g, e);
}
示例12: onLongPress
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public void onLongPress(MotionEvent e) {
mMap.handleGesture(Gesture.LONG_PRESS, mMotionEvent.wrap(e));
}
示例13: onDown
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onDown(MotionEvent e) {
return mMap.handleGesture(Gesture.PRESS, mMotionEvent.wrap(e));
}
示例14: onSingleTapConfirmed
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
return mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
}
示例15: onDoubleTap
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onDoubleTap(MotionEvent e) {
return mMap.handleGesture(Gesture.DOUBLE_TAP, mMotionEvent.wrap(e));
}