From 7d7688b793bdf80860c965d3c482eb502dfd0b0a Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Mon, 2 Nov 2020 17:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=85=E9=9A=9C=E6=B1=82?= =?UTF-8?q?=E5=8A=A9=E9=80=9A=E7=9F=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extensions/entrance/EntranceFragment.java | 50 +++++++++++- .../module_ext_icon_seek_help_notice_icon.png | Bin 0 -> 984 bytes .../module_ext_icon_seek_help_notice_icon.png | Bin 0 -> 984 bytes .../module_ext_icon_seek_help_notice_icon.png | Bin 0 -> 1892 bytes ...odule_ext_drawable_seek_help_notice_bg.xml | 10 +++ .../res/layout/include_navi_info_panle.xml | 3 +- ...module_ext_include_seeking_help_notice.xml | 71 ++++++++++++++++++ .../res/layout/module_ext_layout_entrance.xml | 5 ++ .../src/main/res/values-xhdpi/dimens.xml | 8 ++ .../src/main/res/values/dimens.xml | 8 ++ .../module/share/manager/SeekHelpManager.kt | 2 + 11 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_ext_icon_seek_help_notice_icon.png create mode 100644 modules/mogo-module-extensions/src/main/res/drawable-mdpi/module_ext_icon_seek_help_notice_icon.png create mode 100644 modules/mogo-module-extensions/src/main/res/drawable-xhdpi/module_ext_icon_seek_help_notice_icon.png create mode 100644 modules/mogo-module-extensions/src/main/res/drawable/module_ext_drawable_seek_help_notice_bg.xml create mode 100644 modules/mogo-module-extensions/src/main/res/layout/module_ext_include_seeking_help_notice.xml 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 2afba379f1..56f72c9746 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,8 +1,10 @@ package com.mogo.module.extensions.entrance; import android.content.Intent; +import android.content.SharedPreferences; import android.graphics.Rect; import android.os.Bundle; +import android.os.Handler; import android.text.TextUtils; import android.util.TypedValue; import android.view.LayoutInflater; @@ -16,6 +18,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; +import androidx.constraintlayout.widget.Group; import com.alibaba.android.arouter.launcher.ARouter; import com.bumptech.glide.request.RequestOptions; @@ -26,7 +29,6 @@ import com.mogo.commons.voice.AIAssist; 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.navi.IMogoAimlessModeListener; import com.mogo.map.navi.IMogoNavi; @@ -51,6 +53,7 @@ import com.mogo.module.extensions.utils.TopViewAnimHelper; import com.mogo.module.share.manager.ServiceApisManager; import com.mogo.service.IMogoServiceApis; import com.mogo.service.analytics.IMogoAnalytics; +import com.mogo.service.connection.IMogoOnMessageListener; import com.mogo.service.entrance.ButtonIndex; import com.mogo.service.fragmentmanager.IFragmentProvider; import com.mogo.service.fragmentmanager.IMogoFragmentManager; @@ -174,10 +177,14 @@ public class EntranceFragment extends MvpFragment seekHelpGroup.setVisibility(View.GONE)); + } } } @@ -880,6 +896,36 @@ public class EntranceFragment extends MvpFragment seekHelpNoticeListener = + new IMogoOnMessageListener() { + @Override + public Class target() { + return String.class; + } + + @Override + public void onMsgReceived(String obj) { + if(mStatusManager.isSeekHelping()) { + int seekNum = SharedPrefsMgr.getInstance(getContext()).getInt("seek_help_num", 0); + final int finalSeekNum = seekNum++; + SharedPrefsMgr.getInstance(getContext()).putInt("seek_help_num", seekNum); + handler.post(() -> { + seekHelpGroup.setVisibility(View.VISIBLE); + seekHelpNum.setText("" + finalSeekNum); + }); + } + } + }; + + private Handler handler = new Handler(); + + private void listenSeekNumber(){ + mApis.getSocketManagerApi(getContext()).registerOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener); + mStatusManager.registerStatusChangedListener(TAG,StatusDescriptor.SEEK_HELPING,this); + } + @Override public void onDestroy() { super.onDestroy(); @@ -892,11 +938,13 @@ public class EntranceFragment extends MvpFragmentPx&l1W5CR7ee-m0O5TQ547La~b!`ATr85m&pBAMm!)zA;p`NBv0gl2bv_3;*I1% z$ffZ@!V^aFLLNkv%TR=pCUY9c=kxu* z0&SiC!6?|D+o2bw1iD+W$qEt!c-wW_VRS`z$VT!Z5}DK>bqDB@@oxkh@HEft{TiaD3DHDADpVHbVq9NI|Kbj);^TPL&0u}_D7NVI^i?gFPJF zCU5~Ag;;l-i@^6)NBo!V)PlWWV$3XK5Pt}s8*)pxfNEyAE1?iv33ddhWtfTC8-A2U z_I_ms{aGTa)j{$aco#0t?iI6u6(mOzTOkQ)rEFQ_*2D1S;-%awCd6Io>U!3HX zN{bLveBvp<++(2ZLd@Z9?XPn)Sc1L9uVNwS1^jr=fwp8gL7SQe`m~iuY!~o7`kvR? z*$~hJe5aF2pB&*JR~S8AHuyL&6$a+|%9D68_z(jvc$GMV2u#LqOEwYo4mb(C%PIuPNAwct2>jIN(v6*z2)U~vCnbU7I8^SI;f$2XGGbDK**YJ;4K6g9-0000Px&l1W5CR7ee-m0O5TQ547La~b!`ATr85m&pBAMm!)zA;p`NBv0gl2bv_3;*I1% z$ffZ@!V^aFLLNkv%TR=pCUY9c=kxu* z0&SiC!6?|D+o2bw1iD+W$qEt!c-wW_VRS`z$VT!Z5}DK>bqDB@@oxkh@HEft{TiaD3DHDADpVHbVq9NI|Kbj);^TPL&0u}_D7NVI^i?gFPJF zCU5~Ag;;l-i@^6)NBo!V)PlWWV$3XK5Pt}s8*)pxfNEyAE1?iv33ddh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)VEp~c$CARPM>(CGG!TPgjC)~A+voB-j`)G|?nlb9{m9G%Ya&tNo& z8Buo?*Z^8025GJbS_-P~Jh8;I$z$Yluo1L_&EQM$VTto`Rm7#2edM5V#|Oegz)@m&pG@ z_62gU1+=Brr3GME4)%b3-~jLi$B%j^YF(E0tCBuuf--9ShCsy4z#{#M_z%dEuWu)8 z#?1w?uY}pY{6IOm?g)zpoXfseW)rTY;g_S9$QWR3BU;!}(yTLCeFxjyD0_+RcXXl^ zvXACxG+SgnnS|rPnpUbfj<318zYNstIHUJT)MKJE<9&^~9gGBCPy&d(Iy3kQ`CYJ) e + + + + + \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml b/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml index 289e64c9d9..3bea94c0eb 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml @@ -2,7 +2,8 @@ + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout" + > + + + + + + + + + + + + + + + \ No newline at end of file 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 290f28af62..5e92507d0d 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 @@ -9,6 +9,11 @@ + + 31px 10px + + 44px + 1060px + 100px + 30px + 34px + 20px + 40px \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml index bc7e325604..2c1cfff501 100644 --- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml @@ -162,4 +162,12 @@ 14px 8px + + 25px + 25px + 16px + 56px + 18px + 10px + 22px \ No newline at end of file diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt index 8eb55c6bf3..d1b6bf781b 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/SeekHelpManager.kt @@ -170,6 +170,8 @@ object SeekHelpManager { // 接口请求成功,内部同步v2x状态,通知adas,改变自车图标 ServiceApisManager.serviceApis.statusManagerApi.setSeekHelping("ShareDialog", true) SharedPrefsMgr.getInstance(context!!).putLong("seek_help_time", System.currentTimeMillis()) + SharedPrefsMgr.getInstance(context!!).putInt("seek_help_num", 0) + isSeekHelp = true aiAssist?.speakTTSVoice("已发布求助信息,将为你通知其他车主") toast("已发布求助信息,将为你通知其他车主")