From b6718f7d9d54d8bcf4c29fc3040403b016fd8d27 Mon Sep 17 00:00:00 2001 From: yileizhao Date: Fri, 14 Feb 2020 10:41:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A0=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7=E6=82=AC=E6=B5=AE=E7=AA=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/windowview/MogoWindowManager.java | 25 +++-- .../main/windowview/WindowViewHandler.java | 104 +++++++++++------- .../windowview/IMogoWindowManager.java | 18 ++- 3 files changed, 91 insertions(+), 56 deletions(-) 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 67e6a8ea3e..2357701d68 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 @@ -14,31 +14,36 @@ import com.mogo.service.windowview.IMogoWindowManager; *

* 根据优先级控制显示 window view. */ -@Route( path = MogoServicePaths.PATH_WINDOW_MANAGER ) +@Route(path = MogoServicePaths.PATH_WINDOW_MANAGER) public class MogoWindowManager implements IMogoWindowManager { @Override - public void addView( View view, int x, int y, boolean movable ) { - WindowViewHandler.addView( view, x, y, movable ); + public void addView(View view, int x, int y, boolean movable) { + WindowViewHandler.addView(view, x, y, movable); } @Override - public void addView( int priority, View view, int x, int y, boolean movable ) { - WindowViewHandler.addView( view, priority, x, y, movable ); + public void addView(View view, FrameLayout.LayoutParams params, boolean movable) { + WindowViewHandler.addView(view, params, movable); } @Override - public void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ) { - WindowViewHandler.addView( view, priority, params, movable ); + public void addView(int priority, View view, int x, int y, boolean movable) { + WindowViewHandler.addView(view, priority, x, y, movable); } @Override - public void removeView( View view ) { - WindowViewHandler.removeView( view ); + public void addView(int priority, View view, FrameLayout.LayoutParams params, boolean movable) { + WindowViewHandler.addView(view, priority, params, movable); } @Override - public void init( Context context ) { + public void removeView(View view) { + WindowViewHandler.removeView(view); + } + + @Override + public void init(Context context) { } } 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 a81e50ab49..1b37bea1c9 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 @@ -37,7 +37,7 @@ public class WindowViewHandler { public static FrameLayout sFloatingLayout = null; - public static void init( FrameLayout frameLayout ) { + public static void init(FrameLayout frameLayout) { sFloatingLayout = frameLayout; } @@ -49,20 +49,39 @@ public class WindowViewHandler { * @param y * @param movable */ - public static void addView( View view, int x, int y, boolean movable ) { - if ( view == null ) { + public static void addView(View view, int x, int y, boolean movable) { + if (view == null) { return; } - if ( sFloatingLayout == null ) { - Logger.e( TAG, "no floating frame. " ); + if (sFloatingLayout == null) { + Logger.e(TAG, "no floating frame. "); return; } - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT ); + FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.leftMargin = x; params.topMargin = y; - sFloatingLayout.addView( view, params ); + sFloatingLayout.addView(view, params); + } + + /** + * 添加view到布局,优先级大的展示 + * + * @param view + * @param params + * @param movable + */ + public static void addView(View view, FrameLayout.LayoutParams params, boolean movable) { + if (view == null) { + return; + } + + if (sFloatingLayout == null) { + Logger.e(TAG, "no floating frame. "); + return; + } + sFloatingLayout.addView(view, params); } /** @@ -74,27 +93,27 @@ public class WindowViewHandler { * @param y * @param movable */ - public static void addView( View view, int priority, int x, int y, boolean movable ) { - if ( view == null ) { + public static void addView(View view, int priority, int x, int y, boolean movable) { + if (view == null) { return; } - if ( sFloatingLayout == null ) { - Logger.e( TAG, "no floating frame. " ); + if (sFloatingLayout == null) { + Logger.e(TAG, "no floating frame. "); return; } - if ( sView == view ) { - Logger.w( TAG, "改布局已添加且没有移除,不操作" ); + if (sView == view) { + Logger.w(TAG, "改布局已添加且没有移除,不操作"); return; } - if ( sView != null ) { - if ( priority < sPriority ) { - Logger.w( TAG, "过滤低优先级布局" ); + if (sView != null) { + if (priority < sPriority) { + Logger.w(TAG, "过滤低优先级布局"); return; } - sFloatingLayout.removeView( sView ); + sFloatingLayout.removeView(sView); } sView = view; sMovable = movable; @@ -112,27 +131,27 @@ public class WindowViewHandler { * @param params * @param movable */ - public static void addView( View view, int priority, FrameLayout.LayoutParams params, boolean movable ) { - if ( view == null ) { + 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. " ); + if (sFloatingLayout == null) { + Logger.e(TAG, "no floating frame. "); return; } - if ( sView == view ) { - Logger.w( TAG, "改布局已添加且没有移除,不操作" ); + if (sView == view) { + Logger.w(TAG, "改布局已添加且没有移除,不操作"); return; } - if ( sView != null ) { - if ( priority < sPriority ) { - Logger.w( TAG, "过滤低优先级布局" ); + if (sView != null) { + if (priority < sPriority) { + Logger.w(TAG, "过滤低优先级布局"); return; } - sFloatingLayout.removeView( sView ); + sFloatingLayout.removeView(sView); } sView = view; sMovable = movable; @@ -141,15 +160,15 @@ public class WindowViewHandler { addView(); } - public static void removeView( View view ) { - if ( sFloatingLayout == null ) { + public static void removeView(View view) { + if (sFloatingLayout == null) { return; } - if ( view == null ) { + if (view == null) { return; } - sFloatingLayout.removeView( view ); - if ( sView == view ) { + sFloatingLayout.removeView(view); + if (sView == view) { sView = null; sPriority = Integer.MIN_VALUE; sMovable = false; @@ -158,28 +177,29 @@ public class WindowViewHandler { } private static void addView() { - if ( sView == null ) { + if (sView == null) { return; } FrameLayout.LayoutParams params = sParams; - if ( params == null ) { - params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT ); + 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 ); + sFloatingLayout.addView(sView, params); } - public static void attachMovementEvent( View view, WindowManager.LayoutParams params ) { - if ( view == null ) { + public static void attachMovementEvent(View view, WindowManager.LayoutParams params) { + if (view == null) { return; } - view.setOnTouchListener( ( v, event ) -> { + view.setOnTouchListener((v, event) -> { DispatchTouchEventWrapper.getInstance() - .attach( view, params ) - .handle( event ); + .attach(view, params) + .handle(event); return false; - } ); + }); } + } 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 170d20a8eb..e3d86b0ae3 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 @@ -22,7 +22,17 @@ public interface IMogoWindowManager extends IProvider { * @param y 左上角y坐标 * @param movable 是否可移动(无效) */ - void addView( View view, int x, int y, boolean movable ); + void addView(View view, int x, int y, boolean movable); + + + /** + * 向window中添加指定的布局,不考虑优先级 + * + * @param view 添加的实例 + * @param params 布局参数 + * @param movable 是否可移动(无效) + */ + void addView(View view, FrameLayout.LayoutParams params, boolean movable); /** * 向window中添加指定的布局,优先级大的展示 @@ -33,7 +43,7 @@ public interface IMogoWindowManager extends IProvider { * @param y 左上角y坐标 * @param movable 是否可移动(无效) */ - void addView( int priority, View view, int x, int y, boolean movable ); + void addView(int priority, View view, int x, int y, boolean movable); /** * 向window中添加指定的布局,优先级大的展示 @@ -43,12 +53,12 @@ public interface IMogoWindowManager extends IProvider { * @param params 布局参数 * @param movable 是否可移动(无效) */ - void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ); + void addView(int priority, View view, FrameLayout.LayoutParams params, boolean movable); /** * 移除对应的 view * * @param view */ - void removeView( View view ); + void removeView(View view); } From ffbddc2c048d1147555ebfecad80b86e1fb436dd Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Fri, 14 Feb 2020 11:46:02 +0800 Subject: [PATCH 2/3] replace home icon --- .../extensions/entrance/EntranceFragment.java | 11 +---------- .../res/drawable-ldpi/module_map_ic_home.png | Bin 465 -> 396 bytes .../res/drawable-xhdpi/module_map_ic_home.png | Bin 831 -> 588 bytes .../res/layout/module_ext_layout_entrance.xml | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) mode change 100644 => 100755 modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_map_ic_home.png diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index 02e0ffbcfe..b901345e9b 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -1,6 +1,5 @@ package com.mogo.module.extensions.entrance; -import android.graphics.BitmapFactory; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; @@ -11,15 +10,12 @@ import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.commons.mvp.MvpFragment; -import com.mogo.commons.storage.SpStorage; import com.mogo.map.MogoLatLng; import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.location.MogoLocation; import com.mogo.map.marker.IMogoMarkerManager; -import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.map.model.MogoPoi; import com.mogo.map.navi.IMogoNavi; import com.mogo.map.navi.IMogoNaviListener; @@ -33,7 +29,6 @@ import com.mogo.module.extensions.R; import com.mogo.module.extensions.dialog.NaviNoticeDialog; import com.mogo.module.extensions.navi.NaviInfoView; import com.mogo.module.share.ShareControl; -import com.mogo.module.share.dialog.LaucherShareDialog; import com.mogo.service.MogoServicePaths; import com.mogo.service.fragmentmanager.FragmentDescriptor; import com.mogo.service.fragmentmanager.IMogoFragmentManager; @@ -41,10 +36,6 @@ import com.mogo.service.map.IMogoMapService; import com.mogo.service.module.IMogoAddressManager; import com.mogo.service.module.IMogoModuleProvider; import com.mogo.service.module.IMogoRegisterCenter; -import com.mogo.service.windowview.IMogoWindowManager; -import com.mogo.utils.TipToast; - -import java.util.HashMap; /** * @author congtaowang @@ -101,6 +92,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent protected void initViews() { mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation(); mMogoAddressManager = ( IMogoAddressManager ) ARouter.getInstance().build( MogoServicePaths.PATH_ADDRESS_MANAGER ).navigation(); + mCommonAddress = findViewById( R.id.module_entrance_id_common_address ); mSearch = findViewById( R.id.module_entrance_id_search ); @@ -154,7 +146,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent mSpeedLimit = findViewById( R.id.module_entrance_id_speed_limit_container ); mSpeedLimitValue = findViewById( R.id.module_entrance_id_speed_limit_value ); mSpeedLimitUnit = findViewById( R.id.module_entrance_id_speed_limit_unit ); - } @NonNull diff --git a/modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_map_ic_home.png b/modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_map_ic_home.png index 367de879589fe3bac14dc93589f310ea310e85d5..ff7674dcbd3ccddfbc78c9ae8299ec2a5157821b 100755 GIT binary patch delta 356 zcmV-q0h|8O1B?TZF@Hu$L_t(o3GG(93c@fHHR5A%vActVpU_Fc&E5ZSaPUh6U7Vc# z0S7^Fa1-1MuKs}tI@A-5(56jqLaNgZ9Q3|Uj;CpBrNWCHU;7BN8wQE6B84eZDyO&rH z<(bu=tuo(Z)H$=gWd84;k2PiSP)2i|9bgBH4!i*B1#R9c4Ys`i0000!5z<2`+wqzwXp zcn7=#-T^xYqA1#i9*o#k)||}%tz?jQR^b9Bs>*~e4G^cjx_@7)D3e6(Zl?Y)6LLGHS?bJ|TZbT^$3`;LpiGaJk`%{zuk@8XW0>0e zB&cb{X{C~kYC{P4fizS9okQw7#q^1Ia!!e@=Hjp1#NFJU)nyfj^23PmUwe%W6bs?V zvS6iJkX*%~g0}7i_@%07*qoM6N<$f^3z<>i_@% diff --git a/modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_map_ic_home.png b/modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_map_ic_home.png old mode 100644 new mode 100755 index e0ccc8bcb0658456d65804e9a517e74bd9c1aba9..80702ee564143937096e8036063967ad9fa2ee00 GIT binary patch literal 588 zcmV-S0<-;zP)Px%21!IgRA>e5Sg}q6F$}#!EQo;xAqLC z1!~D6zou!LRg6zy2e56}3M^OqL7+F-6YQq0>u*V5F+q^q2jB&4Qv#g0<{kc*Ao-lQ zt`ZS+ofO(aSt{C_-6(ZqY%JZ$6yb34%-;rtSZXnF>pl3 z)x`*R0PeyD&hF8#g;%tjrT8$y@tEC|h)XHX&i9b5=|RmecAb6b;?oK7jS5UqbK>1d~8A3PQMqAKj8a)qG@rJWdxhVDiO{Vt!>7?&nE#Ix2XB6v1W(Ww(GaYQu|6CKkCMoaZi9Tz@>rHf3* z6&K1kRZ;bp<@ccaE**g6cW0X;s`6fGMyj a3j6|pvUmZ?UL000004XF*Lt006O% z3;baP0008^NklzDEI*s4~hwj5tD-f zK@d@c3L%Fa0)pf&>d6Nff(J1|l8atM@Zcr!;3FUiBCfxZnWY#sGt<-EvZNaRbai!g z)xWBHdUm!}vt|{r3RnfK0#*U5fK|XMU=;{kfkvZo2=swXVI%z~?_1l1K^k<`3ZR_`z&I+8T~ELscc^%U&QvC(p46{CJONlFuDfzD`szz z2O<7Z>6#*I)-t#R4mXvx+I!^ltXWXHN}{(!AuO+oQLsxfnnu11;qOZKSCRGd-1e)< z&&X1s;5V|0xx5I;-QXEW-;vUv1*Hm!eGhmEQa>+{4=x`)(kw)dfEh(ji1xaMXRQ=% zO8JwdkGuLy*OjVxx=4D0%cXM;XcBVV`_i;kcWv;`bKvB!El{`I?3mZPx?wy62sRL-5Kym z#!2gyFNTq5 z8)uUkNB3VlsYw^H(e|a~7(1#-%`=!w6!Nhxf3-wuu@jx+S)7o}cy{~fq9q#R=tkMG zydainUWHn1-gdOrb}WzYirLZFub0l`wIUm!|Fq8AkjnFwKfEh5aBvXw!#n5?@SNP8 zV!J-043w4=X@eBX}002ov JPDHLkV1h>|fb;+W diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index 73a1e40567..f28537c564 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -129,7 +129,7 @@ android:layout_height="@dimen/module_ext_operation_panel_vr_height" android:background="@drawable/module_ext_dw_top_corner_bkg" android:orientation="vertical" - android:visibility="gone"> + android:visibility="visible"> Date: Fri, 14 Feb 2020 11:49:20 +0800 Subject: [PATCH 3/3] hide vr button --- .../src/main/res/layout/module_ext_layout_entrance.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index f28537c564..73a1e40567 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -129,7 +129,7 @@ android:layout_height="@dimen/module_ext_operation_panel_vr_height" android:background="@drawable/module_ext_dw_top_corner_bkg" android:orientation="vertical" - android:visibility="visible"> + android:visibility="gone">