comment out all InputLayer stuff
This commit is contained in:
parent
4e01de31f7
commit
0f52eff9c9
@ -1,228 +1,228 @@
|
||||
/*
|
||||
* Copyright 2012 osmdroid authors
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.layers;
|
||||
|
||||
import org.oscim.event.KeyEvent;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.map.Map;
|
||||
|
||||
public abstract class InputLayer extends Layer {
|
||||
|
||||
public InputLayer(Map map) {
|
||||
super(map);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param keyCode
|
||||
* ...
|
||||
* @param event
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param keyCode
|
||||
* ...
|
||||
* @param event
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <b>You can prevent all(!) other Touch-related events from happening!</b><br />
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param event
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onTrackballEvent(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** GestureDetector.OnDoubleTapListener **/
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onDoubleTapEvent(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** OnGestureListener **/
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onDown(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link MapView} has the chance to handle this event.
|
||||
// *
|
||||
// * @param pEvent1
|
||||
// * ...
|
||||
// * @param pEvent2
|
||||
// * ...
|
||||
// * @param pVelocityX
|
||||
// * ...
|
||||
// * @param pVelocityY
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
//public boolean onFling(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||
// float pVelocityX, float pVelocityY) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onLongPress(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param pEvent1
|
||||
* ...
|
||||
* @param pEvent2
|
||||
* ...
|
||||
* @param pDistanceX
|
||||
* ...
|
||||
* @param pDistanceY
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onScroll(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||
float pDistanceX, float pDistanceY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pEvent
|
||||
* ...
|
||||
*/
|
||||
public void onShowPress(MotionEvent pEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default does nothing (<code>return false</code>). If you handled the
|
||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
* you returned <code>true</code> none of the following Overlays or the
|
||||
* underlying {@link Map} has the chance to handle this event.
|
||||
*
|
||||
* @param e
|
||||
* ...
|
||||
* @return ...
|
||||
*/
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
///*
|
||||
// * Copyright 2012 osmdroid authors
|
||||
// * Copyright 2013 Hannes Janetzek
|
||||
// *
|
||||
// * This program is free software: you can redistribute it and/or modify it under the
|
||||
// * terms of the GNU Lesser General Public License as published by the Free Software
|
||||
// * Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
// *
|
||||
// * This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
// * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
// *
|
||||
// * You should have received a copy of the GNU Lesser General Public License along with
|
||||
// * this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
//package org.oscim.layers;
|
||||
//
|
||||
//import org.oscim.event.KeyEvent;
|
||||
//import org.oscim.event.MotionEvent;
|
||||
//import org.oscim.map.Map;
|
||||
//
|
||||
//public abstract class InputLayer extends Layer {
|
||||
//
|
||||
// public InputLayer(Map map) {
|
||||
// super(map);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param keyCode
|
||||
// * ...
|
||||
// * @param event
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param keyCode
|
||||
// * ...
|
||||
// * @param event
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * <b>You can prevent all(!) other Touch-related events from happening!</b><br />
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param event
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onTouchEvent(MotionEvent event) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onTrackballEvent(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /** GestureDetector.OnDoubleTapListener **/
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onDoubleTap(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onDoubleTapEvent(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /** OnGestureListener **/
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onDown(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// ///**
|
||||
// // * By default does nothing (<code>return false</code>). If you handled the
|
||||
// // * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// // * you returned <code>true</code> none of the following Overlays or the
|
||||
// // * underlying {@link MapView} has the chance to handle this event.
|
||||
// // *
|
||||
// // * @param pEvent1
|
||||
// // * ...
|
||||
// // * @param pEvent2
|
||||
// // * ...
|
||||
// // * @param pVelocityX
|
||||
// // * ...
|
||||
// // * @param pVelocityY
|
||||
// // * ...
|
||||
// // * @return ...
|
||||
// // */
|
||||
// //public boolean onFling(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||
// // float pVelocityX, float pVelocityY) {
|
||||
// // return false;
|
||||
// //}
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onLongPress(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param pEvent1
|
||||
// * ...
|
||||
// * @param pEvent2
|
||||
// * ...
|
||||
// * @param pDistanceX
|
||||
// * ...
|
||||
// * @param pDistanceY
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onScroll(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||
// float pDistanceX, float pDistanceY) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param pEvent
|
||||
// * ...
|
||||
// */
|
||||
// public void onShowPress(MotionEvent pEvent) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * By default does nothing (<code>return false</code>). If you handled the
|
||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||
// * you returned <code>true</code> none of the following Overlays or the
|
||||
// * underlying {@link Map} has the chance to handle this event.
|
||||
// *
|
||||
// * @param e
|
||||
// * ...
|
||||
// * @return ...
|
||||
// */
|
||||
// public boolean onSingleTapUp(MotionEvent e) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
@ -98,37 +98,37 @@ public class ItemizedIconLayer<Item extends MarkerItem> extends ItemizedLayer<It
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Each of these methods performs a item sensitive check. If the item is
|
||||
* located its corresponding method is called. The result of the call is
|
||||
* returned. Helper methods are provided so that child classes may more
|
||||
* easily override behavior without resorting to overriding the
|
||||
* ItemGestureListener methods.
|
||||
*/
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent event) {
|
||||
return activateSelectedItems(event, mActiveItemSingleTap) || super.onSingleTapUp(event);
|
||||
}
|
||||
|
||||
protected boolean onSingleTapUpHelper(int index, Item item) {
|
||||
return this.mOnItemGestureListener.onItemSingleTapUp(index, item);
|
||||
}
|
||||
|
||||
private final ActiveItem mActiveItemSingleTap = new ActiveItem() {
|
||||
@Override
|
||||
public boolean run(int index) {
|
||||
final ItemizedIconLayer<Item> that = ItemizedIconLayer.this;
|
||||
if (that.mOnItemGestureListener == null) {
|
||||
return false;
|
||||
}
|
||||
return onSingleTapUpHelper(index, that.mItemList.get(index));
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onLongPress(MotionEvent event) {
|
||||
return activateSelectedItems(event, mActiveItemLongPress) || super.onLongPress(event);
|
||||
}
|
||||
// /**
|
||||
// * Each of these methods performs a item sensitive check. If the item is
|
||||
// * located its corresponding method is called. The result of the call is
|
||||
// * returned. Helper methods are provided so that child classes may more
|
||||
// * easily override behavior without resorting to overriding the
|
||||
// * ItemGestureListener methods.
|
||||
// */
|
||||
// @Override
|
||||
// public boolean onSingleTapUp(MotionEvent event) {
|
||||
// return activateSelectedItems(event, mActiveItemSingleTap) || super.onSingleTapUp(event);
|
||||
// }
|
||||
//
|
||||
// protected boolean onSingleTapUpHelper(int index, Item item) {
|
||||
// return this.mOnItemGestureListener.onItemSingleTapUp(index, item);
|
||||
// }
|
||||
//
|
||||
// private final ActiveItem mActiveItemSingleTap = new ActiveItem() {
|
||||
// @Override
|
||||
// public boolean run(int index) {
|
||||
// final ItemizedIconLayer<Item> that = ItemizedIconLayer.this;
|
||||
// if (that.mOnItemGestureListener == null) {
|
||||
// return false;
|
||||
// }
|
||||
// return onSingleTapUpHelper(index, that.mItemList.get(index));
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// @Override
|
||||
// public boolean onLongPress(MotionEvent event) {
|
||||
// return activateSelectedItems(event, mActiveItemLongPress) || super.onLongPress(event);
|
||||
// }
|
||||
|
||||
protected boolean onLongPressHelper(int index, Item item) {
|
||||
return this.mOnItemGestureListener.onItemLongPress(index, item);
|
||||
|
@ -17,20 +17,10 @@
|
||||
package org.oscim.layers.marker;
|
||||
|
||||
import org.oscim.core.Point;
|
||||
import org.oscim.layers.InputLayer;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.map.Map;
|
||||
|
||||
/**
|
||||
* Base class representing an overlay which may be displayed on top of a
|
||||
* {@link Map}. To add an overlay, subclass this class, create an instance,
|
||||
* and add via addOverlay() of {@link Map}.
|
||||
* This class implements a form of Gesture Handling similar to
|
||||
* {@link android.view.GestureDetector.SimpleOnGestureListener} and
|
||||
* GestureDetector.OnGestureListener.
|
||||
*
|
||||
* @author Nicolas Gramlich
|
||||
*/
|
||||
public abstract class MarkerLayer extends InputLayer {
|
||||
public abstract class MarkerLayer extends Layer {
|
||||
|
||||
public MarkerLayer(Map map) {
|
||||
super(map);
|
||||
|
@ -16,17 +16,14 @@ package org.oscim.layers.tile.vector;
|
||||
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.layers.InputLayer;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.renderer.ExtrusionRenderer;
|
||||
import org.oscim.renderer.MapRenderer.Matrices;
|
||||
import org.oscim.tiling.TileRenderer;
|
||||
import org.oscim.utils.FastMath;
|
||||
|
||||
/**
|
||||
* @author Hannes Janetzek
|
||||
*/
|
||||
public class BuildingLayer extends InputLayer {
|
||||
public class BuildingLayer extends Layer {
|
||||
//private final static String TAG = BuildingOverlay.class.getName();
|
||||
|
||||
final ExtrusionRenderer mExtLayer;
|
||||
@ -81,8 +78,8 @@ public class BuildingLayer extends InputLayer {
|
||||
|
||||
private final static int MIN_ZOOM = 17;
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent e) {
|
||||
//@Override
|
||||
//public boolean onTouchEvent(MotionEvent e) {
|
||||
// int action = e.getAction() & MotionEvent.ACTION_MASK;
|
||||
// if (action == MotionEvent.ACTION_POINTER_DOWN) {
|
||||
// multi++;
|
||||
@ -101,8 +98,8 @@ public class BuildingLayer extends InputLayer {
|
||||
// mTimer = null;
|
||||
// }
|
||||
// }
|
||||
|
||||
return false;
|
||||
}
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
|
||||
}
|
||||
|
@ -19,11 +19,6 @@ package org.oscim.map;
|
||||
import java.util.AbstractList;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.event.KeyEvent;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.layers.InputLayer;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.renderer.LayerRenderer;
|
||||
|
||||
@ -92,7 +87,7 @@ public class Layers extends AbstractList<Layer> {
|
||||
}
|
||||
|
||||
Layer[] mLayers;
|
||||
InputLayer[] mInputLayer;
|
||||
// InputLayer[] mInputLayer;
|
||||
|
||||
private synchronized void updateLayers() {
|
||||
if (!mDirtyLayers)
|
||||
@ -109,14 +104,14 @@ public class Layers extends AbstractList<Layer> {
|
||||
if (o.getRenderer() != null)
|
||||
numRenderLayers++;
|
||||
|
||||
if (o instanceof InputLayer)
|
||||
numInputLayers++;
|
||||
// if (o instanceof InputLayer)
|
||||
// numInputLayers++;
|
||||
|
||||
mLayers[i] = o;
|
||||
}
|
||||
|
||||
mLayerRenderer = new LayerRenderer[numRenderLayers];
|
||||
mInputLayer = new InputLayer[numInputLayers];
|
||||
// mInputLayer = new InputLayer[numInputLayers];
|
||||
|
||||
for (int i = 0, cntR = 0, cntI = 1, n = mLayerList.size(); i < n; i++) {
|
||||
Layer o = mLayerList.get(i);
|
||||
@ -124,12 +119,12 @@ public class Layers extends AbstractList<Layer> {
|
||||
if (l != null)
|
||||
mLayerRenderer[cntR++] = l;
|
||||
|
||||
if (o instanceof InputLayer) {
|
||||
// sort from top to bottom, so that highest layers
|
||||
// process event first.
|
||||
mInputLayer[numInputLayers - cntI] = (InputLayer) o;
|
||||
cntI++;
|
||||
}
|
||||
// if (o instanceof InputLayer) {
|
||||
// // sort from top to bottom, so that highest layers
|
||||
// // process event first.
|
||||
// mInputLayer[numInputLayers - cntI] = (InputLayer) o;
|
||||
// cntI++;
|
||||
// }
|
||||
}
|
||||
|
||||
mDirtyLayers = false;
|
||||
@ -137,27 +132,27 @@ public class Layers extends AbstractList<Layer> {
|
||||
|
||||
//private boolean mCancelGesture;
|
||||
|
||||
public boolean handleMotionEvent(MotionEvent e) {
|
||||
//boolean handleGesture = true;
|
||||
|
||||
//if (mCancelGesture) {
|
||||
// int action = e.getAction();
|
||||
// handleGesture = (action == MotionEvent.ACTION_CANCEL ||
|
||||
// action == MotionEvent.ACTION_UP);
|
||||
//}
|
||||
|
||||
//if (handleGesture) {
|
||||
// if (mGestureDetector.onTouchEvent(e))
|
||||
// return true;
|
||||
//
|
||||
// mCancelGesture = false;
|
||||
//}
|
||||
|
||||
if (onTouchEvent(e))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
//public boolean handleMotionEvent(MotionEvent e) {
|
||||
// //boolean handleGesture = true;
|
||||
//
|
||||
// //if (mCancelGesture) {
|
||||
// // int action = e.getAction();
|
||||
// // handleGesture = (action == MotionEvent.ACTION_CANCEL ||
|
||||
// // action == MotionEvent.ACTION_UP);
|
||||
// //}
|
||||
//
|
||||
// //if (handleGesture) {
|
||||
// // if (mGestureDetector.onTouchEvent(e))
|
||||
// // return true;
|
||||
// //
|
||||
// // mCancelGesture = false;
|
||||
// //}
|
||||
//
|
||||
// if (onTouchEvent(e))
|
||||
// return true;
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
|
||||
///**
|
||||
// * Call this to not foward events to generic GestureDetector until
|
||||
@ -169,52 +164,52 @@ public class Layers extends AbstractList<Layer> {
|
||||
// mCancelGesture = true;
|
||||
//}
|
||||
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (InputLayer o : mInputLayer) {
|
||||
if (o.onTouchEvent(event)) {
|
||||
if (debugInput)
|
||||
Log.d(TAG, "onTouch\t\t" + o.getClass());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (InputLayer o : mInputLayer)
|
||||
if (o.onKeyDown(keyCode, event))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (InputLayer o : mInputLayer)
|
||||
if (o.onKeyUp(keyCode, event))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onTrackballEvent(MotionEvent event) {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (InputLayer o : mInputLayer)
|
||||
if (o.onTrackballEvent(event))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
//public boolean onTouchEvent(MotionEvent event) {
|
||||
// if (mDirtyLayers)
|
||||
// updateLayers();
|
||||
//
|
||||
// for (InputLayer o : mInputLayer) {
|
||||
// if (o.onTouchEvent(event)) {
|
||||
// if (debugInput)
|
||||
// Log.d(TAG, "onTouch\t\t" + o.getClass());
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
// if (mDirtyLayers)
|
||||
// updateLayers();
|
||||
//
|
||||
// for (InputLayer o : mInputLayer)
|
||||
// if (o.onKeyDown(keyCode, event))
|
||||
// return true;
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
// if (mDirtyLayers)
|
||||
// updateLayers();
|
||||
//
|
||||
// for (InputLayer o : mInputLayer)
|
||||
// if (o.onKeyUp(keyCode, event))
|
||||
// return true;
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//public boolean onTrackballEvent(MotionEvent event) {
|
||||
// if (mDirtyLayers)
|
||||
// updateLayers();
|
||||
//
|
||||
// for (InputLayer o : mInputLayer)
|
||||
// if (o.onTrackballEvent(event))
|
||||
// return true;
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
|
||||
// /* GestureDetector.OnDoubleTapListener */
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user