add mogoaction api

This commit is contained in:
wangcongtao
2020-03-12 22:35:51 +08:00
parent 89a9f33e4b
commit 325460b978
18 changed files with 285 additions and 305 deletions

View File

@@ -504,11 +504,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
*/
private void mockTouchEvent() {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis() + 100;
long eventTime = downTime + 1;
int metaState = 0;
MotionEvent motionEvent = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState );
mMapView.dispatchTouchEvent( motionEvent );
MotionEvent upEvent = MotionEvent.obtain( downTime + 100, eventTime + 100, MotionEvent.ACTION_UP, 0, 0, metaState );
MotionEvent upEvent = MotionEvent.obtain( downTime + 1, eventTime + 2, MotionEvent.ACTION_UP, 0, 0, metaState );
mMapView.dispatchTouchEvent( upEvent );
}

View File

@@ -30,7 +30,8 @@ public class BnHooker implements InvocationHandler {
Field field = AMap.class.getDeclaredField( "a" );
field.setAccessible( true );
host = field.get( map );
Object object = Proxy.newProxyInstance( BnHooker.class.getClassLoader(),
Object object = Proxy.newProxyInstance(
BnHooker.class.getClassLoader(),
new Class[]{com.amap.api.col.n3.ft.a.class, IAMapDelegate.class, IAMapListener.class},
this
);