diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java index 857c4bc424..86f4c2eb39 100644 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java +++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java @@ -45,6 +45,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer { // 设置高德 marker 的object对象为 IMogoMarker 实例。!!!! marker.setObject( this ); } + setObject( mogoMarkerOptions.getObject() ); this.mMogoMarkerOptions = mogoMarkerOptions; mMogoMarkerOptions.addObserver( this ); } @@ -153,6 +154,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer { } if ( mMarker != null ) { mMarker.setMarkerOptions( options ); + if ( mMarker.getObject() instanceof IMogoMarker ) { + ( ( IMogoMarker ) mMarker.getObject() ).setObject( opt.getObject() ); + } } } diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png index 20d7a511d7..5a4c2cf96e 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png index a5c40ead1a..5a05ce6474 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png index 91d900b074..8d8a894b58 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png index bfc7fcd20c..96ffe793f8 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png index 1fb0f4b124..4cfbae387d 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png index 71315ff1fe..77d51fe649 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png index d8b2756563..b0f50cc894 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png index 28a3ad9083..bb21c76be1 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png index 6173de6527..eb9cfc2cdd 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png index 875c448856..061114de81 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png index e6ef7d4c89..bf4793327c 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png index 7dc5d8dc52..eb59de2d41 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png index 46da5389ea..e8e6e92b49 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png index 1da8dc8752..3f8192d710 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png index 79f705a317..d479431b73 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png index ca288d22cd..981a89f1a3 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png index e7ea611bc4..6d05927994 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png index 982333b0ff..69df7c1534 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png index 864e7d9c31..29c3d23eff 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png index 0f3087443c..611f3b41fb 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png index 0ba4e195b8..0bdebdd05d 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png index 2dce00f26a..e9d338aa96 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png index 7ff7329c6f..353e5049b8 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png index 7e76168488..2b938c892e 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png index 483c6ab5b9..2902206da5 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png index 5c1e7e31aa..94db18a7f0 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png index 5d59916fc9..74e434228a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png index fb264f39df..cd1cfd42f7 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png index b4c5267c13..adc0bbbbb3 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png index a1575c7121..3d63020dd2 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png index fda44310fb..a4dd04c61a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png index dbbb2e2573..9bd9e6945a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png index 035f4baa9e..89dd67242a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png index 97e9992259..e1bf5acd56 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png index de674eb2f0..089222b492 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png index 593bebdfe2..5c797cfbf2 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png index 73a955b984..eddba707ef 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png index 00f3dba4a4..db1ad2eeb7 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png index 6f512f3285..957d08b307 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png index 4b36a45509..3bcc77650a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png index a2959b451a..47897888a0 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png index e4d37df07f..727505beb9 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png index c965683d9d..b18126a2f0 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png index cbceda1b64..329995bd2f 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png index 72cb98cefd..63d1ccd728 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png index 0c70b8bf07..8257b5dfe3 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png index aadc8dacef..7c29ae8f99 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png index 62ad187de8..a348269ccc 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png index 957cf4e0f9..bbc15d056d 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png index 5e355cc04b..316f5e1b96 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png index f9fed9f672..8e18625e6d 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png index 7e1f7441b4..903dff86ed 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png index 68ed73eb62..cd95173633 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png index c6edbba61c..8bc4f5247d 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png index 981cf490f9..7b9b08ebf2 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png index 8632e6f02f..5a1f932024 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png index 12c4090df8..2d4462266e 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png index c792321a02..7a950926ce 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png index 3ff00967ab..09b1272ce6 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png index 78515625ae..4e52213d57 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png index 84b9987a85..d9afd535e5 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png index 1e35461890..70a25f3c25 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png index 2a3b2f2842..d87fe0ba59 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png index 4425324bdd..28afebb493 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png index 71d1957c17..5c23e754e6 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png index d6d27e1c27..6593326f29 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png index b4ef20fc32..3bfa5983b6 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png index 32cf624bf3..53fa3dc1b2 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png index 2e9c584a23..e9a51bb3f1 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png index e98239a7b9..c033de20cc 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png index 98773fcf3c..78c0a884b5 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png index 74f7b41ea7..9d2d6889c9 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png index 09d784ddb3..45b1420b8a 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png index b78739dcd8..e716d63c69 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png index a83b1fb416..973a163dc9 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png index 844ba94558..10a7dc6995 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png index e8bb0199f4..89e9415071 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png index 94847a4e32..2716e1a458 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png index 66cbb08569..7ac8809a8b 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png index 0595b2cb8a..0c4daba210 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png index 33aefe1714..9763518122 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png index cb148b17aa..24a6ef2e82 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png index 0bdbc57f23..91e3cb0e8f 100755 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png and b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png differ diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java index 2f4b6e4152..62ad63cddd 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java @@ -60,6 +60,8 @@ public class MogoMarkerOptions extends Observable { // marker 归属模块 private String mOwner; + private Object mObject; + public MogoMarkerOptions latitude( double latitude ) { this.latitude = latitude; return this; @@ -156,6 +158,11 @@ public class MogoMarkerOptions extends Observable { return this; } + public MogoMarkerOptions object( Object object ) { + this.mObject = object; + return this; + } + /** * 自定义marker图层样式,优先使用 icon {@link #icon(Bitmap)}作为marker资源 * @@ -255,4 +262,8 @@ public class MogoMarkerOptions extends Observable { public String getOwner() { return mOwner; } + + public Object getObject() { + return mObject; + } } diff --git a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_amap_navi_cursor.png b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_amap_navi_cursor.png index e14034ffe4..fce07ecf01 100755 Binary files a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_amap_navi_cursor.png and b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_amap_navi_cursor.png differ diff --git a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_start.png b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_start.png old mode 100755 new mode 100644 index 5c5430c62e..addc3b5e8d Binary files a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_start.png and b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_start.png differ diff --git a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_target.png b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_target.png old mode 100755 new mode 100644 index a89d92e306..75a0dbba0c Binary files a/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_target.png and b/libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_target.png differ diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java index e0b257b241..b846804f48 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java @@ -22,10 +22,22 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme @Override public void onCreate( @NonNull LifecycleOwner owner ) { super.onCreate( owner ); + } + + @Override + public void onResume( @NonNull LifecycleOwner owner ) { + super.onResume( owner ); AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL, AppsConst.CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS, this ); AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL, AppsConst.CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS, this ); } + @Override + public void onPause( @NonNull LifecycleOwner owner ) { + super.onPause( owner ); + AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL ); + AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL ); + } + @Override public void onCmdSelected( String cmd ) { if ( mView == null ) { @@ -64,7 +76,5 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme @Override public void onDestroy( @NonNull LifecycleOwner owner ) { super.onDestroy( owner ); - AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL ); - AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL ); } } diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java index f56a5ba615..48faee2f70 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java @@ -14,8 +14,8 @@ public class AppsConst { public static final int TOTAL_SIZE_EACH_PAGE = 12; public static final String CMD_OPEN_APPS_PANEL = "CMD_OPEN_APPS_PANEL"; - public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"第一个"}; + public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"打开全部应用"}; public static final String CMD_CLOSE_APPS_PANEL = "CMD_CLOSE_APPS_PANEL"; - public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"第二个"}; + public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"关闭全部应用"}; } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java index 45e1e0bfc8..b8c227f3fd 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java @@ -18,11 +18,6 @@ public class MogoModule { */ private String mName; - /** - * 语音指令通过广播传递数据 action. - */ - private String mVoiceAction; - /** * @param path 模块加载路径 * @param name 模块名称 @@ -50,13 +45,4 @@ public class MogoModule { this.mName = name; return this; } - - public String getVoiceAction() { - return mVoiceAction; - } - - public MogoModule setVoiceAction( String voiceAction ) { - this.mVoiceAction = voiceAction; - return this; - } } diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java index f82da866e7..58add0892d 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java @@ -132,7 +132,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme super.onCreate( savedInstanceState ); MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_APPS, MogoModulePaths.PATH_MODULE_APPS ) ); - MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_MAP, MogoModulePaths.PATH_MODULE_MAP ).setVoiceAction( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV ) ); + MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_MAP, MogoModulePaths.PATH_MODULE_MAP ) ); MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) ); MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_EXTENSION, ExtensionsModuleConst.TYPE ) ); MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_ENTRANCE, ExtensionsModuleConst.TYPE_ENTRANCE ) ); diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/MogoWindowManager.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/MogoWindowManager.java index b98d58898e..fdba48199c 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/MogoWindowManager.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/MogoWindowManager.java @@ -2,6 +2,7 @@ package com.mogo.module.main.windowview; import android.content.Context; import android.view.View; +import android.widget.FrameLayout; import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.service.MogoServicePaths; @@ -21,6 +22,11 @@ public class MogoWindowManager implements IMogoWindowManager { WindowViewHandler.addView( view, priority, x, y, movable ); } + @Override + public void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ) { + WindowViewHandler.addView( view, priority, params, movable ); + } + @Override public void removeView( View view ) { WindowViewHandler.removeView( view ); diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/WindowViewHandler.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/WindowViewHandler.java index e8a75877ad..a0dcc94cd8 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/WindowViewHandler.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/windowview/WindowViewHandler.java @@ -28,6 +28,7 @@ public class WindowViewHandler { private static View sView = null; private static int sX, sY; + private static FrameLayout.LayoutParams sParams; /** * 是否可手指拖动 @@ -55,26 +56,48 @@ public class WindowViewHandler { return; } - if ( sView == null ) { - sView = view; - sMovable = movable; - sPriority = priority; - sX = x; - sY = y; - addView(); - } else { + if ( sView != null ) { if ( priority < sPriority ) { Logger.w( TAG, "过滤低优先级布局" ); return; } sFloatingLayout.removeView( sView ); - sView = view; - sX = x; - sY = y; - sPriority = priority; - sMovable = movable; - addView(); } + sView = view; + sMovable = movable; + sPriority = priority; + sX = x; + sY = y; + addView(); + } + + public static void addView( View view, int priority, FrameLayout.LayoutParams params, boolean movable ) { + if ( view == null ) { + return; + } + + if ( sFloatingLayout == null ) { + Logger.e( TAG, "no floating frame. " ); + return; + } + + if ( sView == view ) { + Logger.w( TAG, "改布局已添加且没有移除,不操作" ); + return; + } + + if ( sView != null ) { + if ( priority < sPriority ) { + Logger.w( TAG, "过滤低优先级布局" ); + return; + } + sFloatingLayout.removeView( sView ); + } + sView = view; + sMovable = movable; + sPriority = priority; + sParams = params; + addView(); } public static void removeView( View view ) { @@ -92,6 +115,7 @@ public class WindowViewHandler { sView = null; sPriority = Integer.MIN_VALUE; sMovable = false; + sParams = null; DispatchTouchEventWrapper.getInstance().release(); } @@ -100,9 +124,12 @@ public class WindowViewHandler { return; } - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT ); - params.leftMargin = sX; - params.topMargin = sY; + FrameLayout.LayoutParams params = sParams; + if ( params == null ) { + params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT ); + params.leftMargin = sX; + params.topMargin = sY; + } sFloatingLayout.addView( sView, params ); } diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java index 231b29f3ae..66f8b1ae2f 100644 --- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java +++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java @@ -5,14 +5,11 @@ import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.commons.mvp.MvpFragment; import com.mogo.map.IMogoMap; import com.mogo.map.IMogoUiSettings; import com.mogo.map.MogoMapView; import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.service.MogoServicePaths; -import com.mogo.service.voice.IMogoVoiceManager; /** * @author congtaowang @@ -27,8 +24,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements private MogoMapView mMogoMapView; private IMogoMap mMogoMap; - private IMogoVoiceManager mMogoVoiceManager; - @Override protected int getLayoutId() { return R.layout.module_map_fragment_map; @@ -54,8 +49,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements mMogoMapView.onCreate( savedInstanceState ); } initMapView(); - mMogoVoiceManager = ( IMogoVoiceManager ) ARouter.getInstance().build( MogoServicePaths.PATH_VOICE_MANAGER ).navigation( getContext() ); - mMogoVoiceManager.registerIntentListener( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV, mPresenter ); } @Override @@ -121,8 +114,5 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements if ( mMogoMapView != null ) { mMogoMapView.onDestroy(); } - if ( mMogoVoiceManager != null ) { - mMogoVoiceManager.unregisterIntentListener( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV ); - } } } diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java index 38b8ac4aaf..7bf10c799d 100644 --- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java +++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java @@ -2,7 +2,6 @@ package com.mogo.module.map; import android.content.Intent; import android.graphics.Rect; -import android.os.Bundle; import android.text.TextUtils; import androidx.annotation.NonNull; @@ -17,6 +16,7 @@ import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.service.MogoServicePaths; import com.mogo.service.map.IMogoMapService; import com.mogo.service.voice.IMogoVoiceListener; +import com.mogo.service.voice.IMogoVoiceManager; import com.mogo.utils.ResourcesHelper; import com.mogo.utils.WindowUtils; import com.mogo.utils.logger.Logger; @@ -34,6 +34,7 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList private static final String TAG = "MapPresenter"; private IMogoMapService mMogoMapService; + private IMogoVoiceManager mMogoVoiceManager; public MapPresenter( MapView view ) { super( view ); @@ -43,7 +44,9 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList public void onCreate( @NonNull LifecycleOwner owner ) { super.onCreate( owner ); mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() ); - registerUnWakeupCmd(); + mMogoVoiceManager = ( IMogoVoiceManager ) ARouter.getInstance().build( MogoServicePaths.PATH_VOICE_MANAGER ).navigation( getContext() ); + + registerVoiceCmd(); IMogoNavi mogoNavi = mMogoMapService.getNavi( getContext() ); mogoNavi.setCalculatePathDisplayBounds( new Rect( @@ -54,168 +57,89 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList ) ); } - private void registerUnWakeupCmd() { - if ( VoiceConstants.sUnWakeupCmds.isEmpty() ) { + @Override + public void onResume( @NonNull LifecycleOwner owner ) { + super.onResume( owner ); + registerVoiceCmd(); + } + + @Override + public void onPause( @NonNull LifecycleOwner owner ) { + super.onPause( owner ); + unregisterVoiceCmd(); + } + + private void registerVoiceCmd() { + if ( VoiceConstants.sVoiceCmds.isEmpty() ) { Logger.w( TAG, "no unwakeup words" ); return; } - for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnWakeupCmds.entrySet() ) { + for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) { + mMogoVoiceManager.registerIntentListener( entry.getKey(), this ); AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this ); } } - @Override - public void onIntentReceived( String action, Intent intent ) { - if ( !TextUtils.equals( action, VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV ) ) { + private void unregisterVoiceCmd() { + if ( VoiceConstants.sVoiceCmds.isEmpty() ) { + Logger.w( TAG, "no unwakeup words" ); return; } - int type = intent.getExtras().getInt( VoiceConstants.EXTRA_KEY_TYPE ); - Bundle data = intent.getExtras(); - switch ( type ) { - case VoiceConstants.TYPE_START_NAVI: -// actions.onStartNavi(); - break; - case VoiceConstants.TYPE_STOP_NAVI: -// actions.onStopNavi(); - break; - case VoiceConstants.TYPE_NAVI_GUIDE_INFO: -// actions.onSpeakNaviGuideInfo(); - break; - case VoiceConstants.TYPE_MAP_UI_SETTING: - final int actionType = data.getInt( VoiceConstants.EXTRA_TYPE, 0 ); - final int operateAction = data.getInt( VoiceConstants.EXTRA_OPERA, 0 ); - onMapUISetting( actionType, operateAction ); - break; - case VoiceConstants.TYPE_NAVI_STRATEGY: -// actions.onNaviStrategySetting( data.getInt( VoiceConstants.EXTRA_M, 1 ) ); - break; - case VoiceConstants.TYPE_NAVI_OVERVIEW: - final int overview = data.getInt( VoiceConstants.EXTRA_IS_SHOW, -1 ); -// if ( overview == 0 ) { -// actions.onNaviOverview(); -// } else { -// actions.onNaviContinue(); -// } - break; - case VoiceConstants.TYPE_NAVI_SPEAK: -// actions.onNaviSpeak( data.getInt( VoiceConstants.EXTRA_MUTE, 0 ) ); - break; - case VoiceConstants.TYPE_COMMON_ADDRESS_SETTING: -// actions.onAddressSetting(); - break; - case VoiceConstants.TYPE_COMMON_ADDRESS_CHANGED: -// actions.onAddressUpdate(); - break; - case VoiceConstants.TYPE_NAVI_ADD_POINT: -// final int updateType = intent.getIntExtra( "TYPE", -1 ); -// final String name = intent.getStringExtra( "POINAME" ); -// final String address = intent.getStringExtra( "ADDRESS" ); -// final double lat = intent.getDoubleExtra( "LAT", 0.0 ); -// final double lng = intent.getDoubleExtra( "LON", 0.0 ); -// actions.onUpdateNaviPoint( updateType, name, address, lat, lng ); - break; - case VoiceConstants.TYPE_SPEAK_NAVI_INFO: -// actions.onSpeakPathRetainDistanceInfo(); - break; - case VoiceConstants.TYPE_SPEAK_SPEED_LIMIT_INFO: -// actions.onSpeakSpeedLimitInfo(); - break; + for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) { + mMogoVoiceManager.unregisterIntentListener( entry.getKey() ); + AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this ); } } - /** - * @param actionType 0 - 实时路况 - * 1 - 地图缩放 - * 2 - 视图模式 - * 3 - 夜间模式 - * @param action actionType = 0 -> 0 - 开、1 - 关 - * actionType = 1 -> 0 - 放大地图、1 - 缩小地图 - * actionType = 2 -> 0 - 切换到2D车头朝上、1 - 切换2D正北模式、2 - 切换3D车头朝上 - * actionType = 3 -> 0 - 黑夜、1 - 正常、2 - 自动 - */ - public void onMapUISetting( int actionType, int action ) { - switch ( actionType ) { - case 0: - if ( action == 0 ) { - mView.getUIController().setTrafficEnabled( true ); - } else if ( action == 1 ) { - mView.getUIController().setTrafficEnabled( false ); - } - break; - case 1: - if ( action == 0 ) { - mView.getUIController().changeZoom( true ); - } else if ( action == 1 ) { - mView.getUIController().changeZoom( false ); - } - break; - case 2: - if ( action == 0 ) { - // 车头朝上,2D - mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D ); - } else if ( action == 1 ) { - // 北朝上,2D - mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D ); - } else if ( action == 2 ) { - // 车头朝上,3D - mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D ); - } - break; - case 3: - if ( action == 0 ) { - mView.getUIController().changeMapMode( EnumMapUI.Type_Night ); - } else if ( action == 1 ) { - mView.getUIController().changeMapMode( EnumMapUI.Type_Light ); - } else if ( action == 2 ) { - mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night ); - } - break; + @Override + public void onIntentReceived( String command, Intent intent ) { + if ( TextUtils.isEmpty( command ) ) { + return; } + onCmdSelected( command ); } @Override public void onCmdSelected( String cmd ) { switch ( cmd ) { case VoiceConstants.CMD_MAP_TRAFFIC_MODE: - onMapUISetting( 0, 0 ); + mView.getUIController().setTrafficEnabled( true ); break; case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE: - onMapUISetting( 0, 1 ); + mView.getUIController().setTrafficEnabled( false ); break; case VoiceConstants.CMD_MAP_ZOOM_IN: - onMapUISetting( 1, 0 ); + mView.getUIController().changeZoom( true ); break; case VoiceConstants.CMD_MAP_ZOOM_OUT: - onMapUISetting( 1, 1 ); + mView.getUIController().changeZoom( false ); break; case VoiceConstants.CMD_MAP_2D: - onMapUISetting( 2, 1 ); + case VoiceConstants.CMD_MAP_NORTH_UP_MODE: + mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D ); break; case VoiceConstants.CMD_MAP_3D: - onMapUISetting( 2, 2 ); + mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D ); break; - case VoiceConstants.CMD_MAP_LIGHT_MODE: - onMapUISetting( 3, 1 ); + case VoiceConstants.CMD_MAP_DAY_TIME_MODE: + mView.getUIController().changeMapMode( EnumMapUI.Type_Light ); break; case VoiceConstants.CMD_MAP_NIGHT_MODE: - onMapUISetting( 3, 0 ); + mView.getUIController().changeMapMode( EnumMapUI.Type_Night ); break; case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE: - onMapUISetting( 3, 2 ); + mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night ); break; case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE: - mMogoMapService.getMapUIController().displayOverview(); + mView.getUIController().displayOverview(); break; case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE: - mMogoMapService.getMapUIController().recoverLockMode(); + mView.getUIController().recoverLockMode(); break; case VoiceConstants.CMD_MAP_CAR_UP_MODE: - mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.CarUp_2D ); - break; - case VoiceConstants.CMD_MAP_NORTH_UP_MODE: - mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.NorthUP_2D ); + mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D ); break; } } diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java index 5fde381bd2..ddad9fed66 100644 --- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java +++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java @@ -11,176 +11,99 @@ import java.util.Map; */ public class VoiceConstants { - // 同行者Adapter接受action - public static final String ACTION_GAODE_SDK_NAVI_RECV = "ACTION_GAODE_SDK_NAVI_RECV"; - // 同行者Adapter发送action - public static final String ACTION_GAODE_SDK_NAVI_SEND = "ACTION_GAODE_SDK_NAVI_SEND"; - - public static final String EXTRA_KEY_TYPE = "KEY_TYPE"; - public static final String EXTRA_TYPE = "EXTRA_TYPE";//操作地图 - public static final String EXTRA_OPERA = "EXTRA_OPERA";//操作地图 - public static final String EXTRA_MUTE = "EXTRA_MUTE"; - public static final String EXTRA_IS_SHOW = "EXTRA_IS_SHOW";//预览全路径还是继续导航 - public static final String EXTRA_M = "EXTRA_M";// 导航策略:1(避免收费) 3(不走高速) 4(躲避拥堵) 20 (高速优先) - - /** - * 直接导航 - */ - public static final int TYPE_START_NAVI = 110009; - - /** - * 导航预览or继续导航 - */ - public static final int TYPE_NAVI_OVERVIEW = 110006; - - /** - * 地图控制:缩放、路况、车头、2/3D - */ - public static final int TYPE_MAP_UI_SETTING = 110027; - - /** - * 重新计算导航策略 - */ - public static final int TYPE_NAVI_STRATEGY = 110032; - - /** - * 提箱前方路线方案 - *

- * 未实现 - */ - public static final int TYPE_NAVI_GUIDE_INFO = 120004; - - /** - * 播放当前剩余里程和时间 - *

- * 未实现 - */ - public static final int TYPE_SPEAK_NAVI_INFO = 120001; - - /** - * 播放当前限速信息 - *

- * 未实现 - */ - public static final int TYPE_SPEAK_SPEED_LIMIT_INFO = 120002; - - /** - * 停止导航,但是不退出地图 - */ - public static final int TYPE_STOP_NAVI = 110010; - - /** - * 退出地图应用 - */ - @Deprecated - public static final int TYPE_EXIT_NAVI = 120003; - - /** - * 插入途经点 - */ - public static final int TYPE_NAVI_ADD_POINT = 210009; - - public static final int TYPE_NAVI_SPEAK = 10011; - public static final int TYPE_COMMON_ADDRESS_SETTING = 10007; - public static final int TYPE_COMMON_ADDRESS_CHANGED = 10008; - public static final int TYPE_NAVI_TO = 110027; - // 地图免唤醒语音注册 /** * 放大地图 */ - public static final String CMD_MAP_ZOOM_IN = "CMD_MAP_ZOOM_IN"; - public static final String[] CMD_MAP_ZOOM_IN_WAKE_UP_WORDS = {"放大地图"}; + public static final String CMD_MAP_ZOOM_IN = "com.ileja.navi.map.enlarge"; + public static final String[] CMD_MAP_ZOOM_IN_TRIGGER_WORDS = {"放大地图"}; /** * 缩小地图 */ - public static final String CMD_MAP_ZOOM_OUT = "CMD_MAP_ZOOM_OUT"; - public static final String[] CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS = {"缩小地图"}; + public static final String CMD_MAP_ZOOM_OUT = "com.ileja.navi.map.reduce"; + public static final String[] CMD_MAP_ZOOM_OUT_TRIGGER_WORDS = {"缩小地图"}; /** * 2D模式 */ - public static final String CMD_MAP_2D = "CMD_MAP_2D"; - public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"二地模式"}; + public static final String CMD_MAP_2D = "com.ileja.navi.mode.2d"; + public static final String[] CMD_MAP_2D_TRIGGER_WORDS = {"二地模式"}; /** * 3D模式 */ - public static final String CMD_MAP_3D = "CMD_MAP_3D"; - public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"三地模式"}; + public static final String CMD_MAP_3D = "com.ileja.navi.mode.3d"; + public static final String[] CMD_MAP_3D_TRIGGER_WORDS = {"三地模式"}; /** * 白天模式 */ - public static final String CMD_MAP_LIGHT_MODE = "CMD_MAP_LIGHT_MODE"; - public static final String[] CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS = {"白天模式"}; + public static final String CMD_MAP_DAY_TIME_MODE = "com.ileja.navi.mode.daytime"; + public static final String[] CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS = {"白天模式"}; /** * 黑夜模式 */ - public static final String CMD_MAP_NIGHT_MODE = "CMD_MAP_NIGHT_MODE"; - public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"夜间模式"}; + public static final String CMD_MAP_NIGHT_MODE = "com.ileja.navi.mode.night"; + public static final String[] CMD_MAP_NIGHT_MODE_TRIGGER_WORDS = {"夜间模式"}; /** * 自动模式 */ - public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE"; - public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS = {"自动模式"}; + public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "com.ileja.navi.mode.autodaynight"; + public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS = {"自动模式"}; /** * 查看路况 */ - public static final String CMD_MAP_TRAFFIC_MODE = "CMD_MAP_TRAFFIC_MODE"; - public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"打开路况", "打开实况"}; + public static final String CMD_MAP_TRAFFIC_MODE = "com.ileja.navi.traffic.open"; + public static final String[] CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS = {"打开路况", "打开实况"}; /** * 关闭路况 */ - public static final String CMD_MAP_UN_TRAFFIC_MODE = "CMD_MAP_UN_TRAFFIC_MODE"; - public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况","关闭实况"}; + public static final String CMD_MAP_UN_TRAFFIC_MODE = "com.ileja.navi.traffic.close"; + public static final String[] CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS = {"关闭路况", "关闭实况"}; /** * 导航全览 */ - public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "CMD_MAP_DISPLAY_OVERVIEW_MODE"; - public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS = {"进入全览", "查看全程"}; + public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "com.ileja.navi.map.full"; + public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS = {"进入全览", "查看全程"}; /** * 继续导航 */ - public static final String CMD_MAP_CONTINUE_NAVI_MODE = "CMD_MAP_CONTINUE_NAVI_MODE"; - public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS = {"继续导航"}; + public static final String CMD_MAP_CONTINUE_NAVI_MODE = "com.ileja.navi.route.continue"; + public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS = {"继续导航"}; /** * 车头朝上 */ - public static final String CMD_MAP_CAR_UP_MODE = "CMD_MAP_CAR_UP_MODE"; - public static final String[] CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS = {"车头朝上"}; + public static final String CMD_MAP_CAR_UP_MODE = "com.ileja.navi.mode.car_up"; + public static final String[] CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS = {"车头朝上"}; /** * 北朝上 */ - public static final String CMD_MAP_NORTH_UP_MODE = "CMD_MAP_NORTH_UP_MODE"; - public static final String[] CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS = {"北朝上"}; - - public static final Map< String, String[] > sUnWakeupCmds = new HashMap<>(); + public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.navi.mode.north_up"; + public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"}; + public static final Map< String, String[] > sVoiceCmds = new HashMap<>(); static { - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS ); - sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS ); + sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS ); } - - } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServiceProvider.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServiceProvider.java index 99f408481d..38485f4c3f 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServiceProvider.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServiceProvider.java @@ -242,12 +242,7 @@ public class MogoServiceProvider implements IMogoModuleProvider, } mAIAssistReceiver = new AIAssistReceiver( context ); IntentFilter filter = new IntentFilter(); - for ( MogoModule module : modules ) { - String action = module.getVoiceAction(); - if ( !TextUtils.isEmpty( action ) ) { - filter.addAction( action ); - } - } + filter.addAction( AIAssistReceiver.ACTION ); try { context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter ); Logger.i( TAG, "register voice receiver." ); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java index 06a99a2843..c39d8faf80 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java @@ -22,6 +22,5 @@ public interface RefreshApiService { @FormUrlEncoded @POST( "/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync" ) - Observable< BaseData > refreshData( - @FieldMap Map< String, Object > parameters ); + Observable< BaseData > refreshData( @FieldMap Map< String, Object > parameters ); } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java index 477a9c25a4..618aed2396 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java @@ -56,14 +56,12 @@ public class RefreshModel { public void refreshData( MogoLatLng latLng, int radius, final RefreshCallback callback ) { if ( mRefreshApiService != null ) { final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build(); - final Map< String, Object > field = new HashMap<>(); - field.put( "sn", query.get( "sn" ) ); final RefreshBody refreshBody = new RefreshBody(); refreshBody.limit = 50; refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng ); refreshBody.radius = radius; - field.put( "data", GsonUtil.jsonFromObject( refreshBody ) ); - mRefreshApiService.refreshData( field ) + query.put( "data", GsonUtil.jsonFromObject( refreshBody ) ); + mRefreshApiService.refreshData( query ) .subscribeOn( Schedulers.io() ) .observeOn( AndroidSchedulers.mainThread() ) .subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) { diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/AIAssistReceiver.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/AIAssistReceiver.java index 00376fdf83..2f757c975d 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/AIAssistReceiver.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/AIAssistReceiver.java @@ -3,7 +3,6 @@ package com.mogo.module.service.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.os.Bundle; import android.text.TextUtils; import com.alibaba.android.arouter.launcher.ARouter; @@ -19,6 +18,9 @@ import com.mogo.utils.logger.Logger; */ public class AIAssistReceiver extends BroadcastReceiver { + public static final String ACTION = "com.zhidao.speech.awake.notify"; + public static final String PARAM_COMMAND = "command"; + private static final String TAG = "AIAssistReceiver"; @@ -32,6 +34,11 @@ public class AIAssistReceiver extends BroadcastReceiver { public void onReceive( Context context, Intent intent ) { Logger.i( TAG, "receive ai assist intent" ); final String action = intent.getAction(); - mMogoVoiceManager.invoke( action, intent ); + if ( TextUtils.equals( ACTION, action ) ) { + String cmd = intent.getStringExtra( PARAM_COMMAND ); + if ( !TextUtils.isEmpty( cmd ) ) { + mMogoVoiceManager.invoke( cmd, intent ); + } + } } } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceListener.java b/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceListener.java index b7c329f1c3..8c750a12b8 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceListener.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceListener.java @@ -13,8 +13,8 @@ public interface IMogoVoiceListener { /** * 回调语音意图 * - * @param action 广播 action + * @param command 广播 command * @param intent 意图 */ - void onIntentReceived( String action, Intent intent ); + void onIntentReceived( String command, Intent intent ); } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceManager.java b/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceManager.java index 35f5c7b342..05661fce9b 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceManager.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/voice/IMogoVoiceManager.java @@ -15,22 +15,22 @@ public interface IMogoVoiceManager extends IProvider { /** * 注册意图接收者 * - * @param action + * @param command */ - void registerIntentListener( String action, IMogoVoiceListener listener ); + void registerIntentListener( String command, IMogoVoiceListener listener ); /** * 注册意图接收者 * - * @param action + * @param command */ - void unregisterIntentListener( String action ); + void unregisterIntentListener( String command ); /** * 触发意图回调,各业务不用关心 * - * @param action + * @param command * @param intent */ - void invoke( String action, Intent intent ); + void invoke( String command, Intent intent ); } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java b/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java index d91f865a25..1439b190a4 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java @@ -1,6 +1,7 @@ package com.mogo.service.windowview; import android.view.View; +import android.widget.FrameLayout; import com.alibaba.android.arouter.facade.template.IProvider; @@ -23,6 +24,16 @@ public interface IMogoWindowManager extends IProvider { */ void addView( int priority, View view, int x, int y, boolean movable ); + /** + * 向window中添加指定的布局 + * + * @param priority 优先级 + * @param view 添加的实例 + * @param params 布局参数 + * @param movable 是否可移动(无效) + */ + void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ); + /** * 移除对应的 view * diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MogoVoiceManager.java b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MogoVoiceManager.java index f1b7cd8b5b..d7f30da74c 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MogoVoiceManager.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MogoVoiceManager.java @@ -21,18 +21,18 @@ import com.zhidao.auto.platform.voice.VoiceClient; public class MogoVoiceManager implements IMogoVoiceManager { @Override - public void registerIntentListener( String action, IMogoVoiceListener listener ) { - VoiceManager.getInstance().registerIntentListener( action, listener ); + public void registerIntentListener( String command, IMogoVoiceListener listener ) { + VoiceManager.getInstance().registerIntentListener( command, listener ); } @Override - public void unregisterIntentListener( String action ) { - VoiceManager.getInstance().unregisterIntentListener( action ); + public void unregisterIntentListener( String command ) { + VoiceManager.getInstance().unregisterIntentListener( command ); } @Override - public void invoke( String action, Intent intent ) { - VoiceManager.getInstance().invoke( action, intent ); + public void invoke( String command, Intent intent ) { + VoiceManager.getInstance().invoke( command, intent ); } @Override diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MsgObject.java b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MsgObject.java new file mode 100644 index 0000000000..1f7a044934 --- /dev/null +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/MsgObject.java @@ -0,0 +1,28 @@ +package com.mogo.service.impl.voice; + +import android.content.Intent; + +/** + * @author congtaowang + * @since 2020-01-13 + *

+ * 描述 + */ +public class MsgObject { + + private final String mCommand; + private final Intent mIntent; + + public MsgObject( String command, Intent intent ) { + this.mCommand = command; + this.mIntent = intent; + } + + public String getCommand() { + return mCommand; + } + + public Intent getIntent() { + return mIntent; + } +} diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/voice/VoiceManager.java b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/VoiceManager.java index f77b16a0eb..29e6f56f93 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/voice/VoiceManager.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/voice/VoiceManager.java @@ -2,6 +2,11 @@ package com.mogo.service.impl.voice; import android.content.Context; import android.content.Intent; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; + +import androidx.annotation.NonNull; import com.mogo.service.voice.IMogoVoiceListener; import com.mogo.service.voice.IMogoVoiceManager; @@ -10,6 +15,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * @author congtaowang @@ -21,6 +27,25 @@ public class VoiceManager implements IMogoVoiceManager { private static volatile VoiceManager sInstance; + public static final int MSG_COMMAND_RECEIVED = 2000; + + + private Handler mHandler = new Handler( Looper.getMainLooper() ) { + @Override + public void handleMessage( @NonNull Message msg ) { + super.handleMessage( msg ); + if ( msg.what == MSG_COMMAND_RECEIVED ) { + MsgObject object = ( ( MsgObject ) msg.obj ); + List< IMogoVoiceListener > listeners = mListeners.get( object.getCommand() ); + if ( listeners != null && !listeners.isEmpty() ) { + for ( IMogoVoiceListener listener : listeners ) { + listener.onIntentReceived( object.getCommand(), object.getIntent() ); + } + } + } + } + }; + private VoiceManager() { } @@ -40,23 +65,23 @@ public class VoiceManager implements IMogoVoiceManager { } - private Map< String, List< IMogoVoiceListener > > mListeners = new HashMap<>(); + private Map< String, List< IMogoVoiceListener > > mListeners = new ConcurrentHashMap<>(); @Override - public void registerIntentListener( String action, IMogoVoiceListener listener ) { - if ( listener == null || action == null ) { + public void registerIntentListener( String command, IMogoVoiceListener listener ) { + if ( listener == null || command == null ) { return; } - if ( !mListeners.containsKey( action ) ) { - mListeners.put( action, new ArrayList<>() ); + if ( !mListeners.containsKey( command ) ) { + mListeners.put( command, new ArrayList<>() ); } - mListeners.get( action ).add( listener ); + mListeners.get( command ).add( listener ); } @Override - public void unregisterIntentListener( String action ) { - mListeners.remove( action ); + public void unregisterIntentListener( String command ) { + mListeners.remove( command ); } @Override @@ -65,12 +90,10 @@ public class VoiceManager implements IMogoVoiceManager { } @Override - public void invoke( String action, Intent intent ) { - List< IMogoVoiceListener > listeners = mListeners.get( action ); - if ( listeners != null && !listeners.isEmpty() ) { - for ( IMogoVoiceListener listener : listeners ) { - listener.onIntentReceived( action, intent ); - } - } + public void invoke( String command, Intent intent ) { + Message msg = Message.obtain(); + msg.what = MSG_COMMAND_RECEIVED; + msg.obj = new MsgObject( command, intent ); + mHandler.sendMessage( msg ); } }