Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0

This commit is contained in:
zhangyuanzhen
2020-01-16 20:46:31 +08:00
128 changed files with 2121 additions and 542 deletions

View File

@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 469 B

View File

@@ -19,11 +19,11 @@
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/module_apps_id_apps_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0C0C0C"
app:behavior_hideable="false"
android:id="@+id/module_apps_id_apps_container"
app:behavior_peekHeight="0dp"
app:layout_behavior="@string/bottom_sheet_behavior">
@@ -38,7 +38,7 @@
android:id="@+id/module_apps_id_apps_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_210"
android:layout_marginTop="@dimen/module_apps_pager_marginTop"
android:overScrollMode="never" />
<com.mogo.module.apps.view.LinePageIndicator
@@ -46,10 +46,10 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/dp_100"
app:lineWidth="@dimen/dp_30"
android:layout_marginBottom="@dimen/module_apps_indicator_marginBottom"
app:lineWidth="@dimen/module_apps_indicator_width"
app:selectedColor="#ffffffff"
app:strokeWidth="@dimen/dp_5"
app:strokeWidth="@dimen/module_apps_indicator_heigt"
app:unselectedColor="#33ffffff" />
<ProgressBar

View File

@@ -4,32 +4,32 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:paddingBottom="@dimen/dp_61">
android:paddingBottom="@dimen/module_apps_navigation_icon_paddingBottom">
<ImageView
android:id="@+id/module_apps_id_navigation"
android:layout_width="@dimen/dp_119"
android:layout_height="@dimen/dp_119"
android:layout_width="@dimen/module_apps_navigation_icon_width"
android:layout_height="@dimen/module_apps_navigation_icon_height"
android:src="@drawable/module_apps_ic_navigation" />
<ImageView
android:id="@+id/module_apps_ic_media_center"
android:layout_width="@dimen/dp_119"
android:layout_height="@dimen/dp_119"
android:layout_marginLeft="@dimen/dp_61"
android:layout_width="@dimen/module_apps_navigation_icon_width"
android:layout_height="@dimen/module_apps_navigation_icon_height"
android:layout_marginLeft="@dimen/module_apps_navigation_icon_marginLeft"
android:src="@drawable/module_apps_ic_media_center" />
<ImageView
android:id="@+id/module_apps_ic_car_settings"
android:layout_width="@dimen/dp_119"
android:layout_height="@dimen/dp_119"
android:layout_marginLeft="@dimen/dp_61"
android:layout_width="@dimen/module_apps_navigation_icon_width"
android:layout_height="@dimen/module_apps_navigation_icon_height"
android:layout_marginLeft="@dimen/module_apps_navigation_icon_marginLeft"
android:src="@drawable/module_apps_ic_car_settings" />
<ImageView
android:id="@+id/module_apps_id_apps"
android:layout_width="@dimen/dp_119"
android:layout_height="@dimen/dp_119"
android:layout_marginLeft="@dimen/dp_61"
android:layout_width="@dimen/module_apps_navigation_icon_width"
android:layout_height="@dimen/module_apps_navigation_icon_height"
android:layout_marginLeft="@dimen/module_apps_navigation_icon_marginLeft"
android:src="@drawable/module_apps_ic_apps" />
</LinearLayout>

View File

@@ -8,16 +8,16 @@
<ImageView
android:id="@+id/module_apps_id_app_icon"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120" />
android:layout_width="@dimen/module_apps_navigation_icon_width"
android:layout_height="@dimen/module_apps_navigation_icon_height" />
<TextView
android:id="@+id/module_apps_id_app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:layout_marginTop="@dimen/module_apps_app_name_marginTop"
android:gravity="center"
android:maxLines="2"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_32" />
android:textSize="@dimen/module_apps_app_name_textSize" />
</LinearLayout>

View File

@@ -5,8 +5,8 @@
android:layout_height="match_parent"
android:numColumns="6"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_220"
android:paddingRight="@dimen/dp_220"
android:verticalSpacing="@dimen/dp_154">
android:paddingLeft="@dimen/module_apps_page_paddingLeft"
android:paddingRight="@dimen/module_apps_page_paddingRight"
android:verticalSpacing="@dimen/module_apps_page_item_verticalSpacing">
</GridView>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">117px</dimen>
<dimen name="module_apps_indicator_heigt">2.7px</dimen>
<dimen name="module_apps_indicator_width">16px</dimen>
<dimen name="module_apps_indicator_marginBottom">54.9px</dimen>
<dimen name="module_apps_navigation_icon_width">64px</dimen>
<dimen name="module_apps_navigation_icon_height">64px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">31.6px</dimen>
<dimen name="module_apps_navigation_icon_paddingBottom">33px</dimen>
<dimen name="module_apps_app_name_marginTop">24px</dimen>
<dimen name="module_apps_app_name_textSize">18px</dimen>
<dimen name="module_apps_page_paddingLeft">112px</dimen>
<dimen name="module_apps_page_paddingRight">112px</dimen>
<dimen name="module_apps_page_item_verticalSpacing">89px</dimen>
</resources>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">260px</dimen>
<dimen name="module_apps_indicator_heigt">5px</dimen>
<dimen name="module_apps_indicator_width">30px</dimen>
<dimen name="module_apps_indicator_marginBottom">103px</dimen>
<dimen name="module_apps_navigation_icon_width">120px</dimen>
<dimen name="module_apps_navigation_icon_height">120px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">61px</dimen>
<dimen name="module_apps_navigation_icon_paddingBottom">60px</dimen>
<dimen name="module_apps_app_name_marginTop">32px</dimen>
<dimen name="module_apps_app_name_textSize">32px</dimen>
<dimen name="module_apps_page_paddingLeft">220px</dimen>
<dimen name="module_apps_page_paddingRight">220px</dimen>
<dimen name="module_apps_page_item_verticalSpacing">154px</dimen>
</resources>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_apps_pager_marginTop">260px</dimen>
<dimen name="module_apps_indicator_heigt">5px</dimen>
<dimen name="module_apps_indicator_width">30px</dimen>
<dimen name="module_apps_indicator_marginBottom">103px</dimen>
<dimen name="module_apps_navigation_icon_width">120px</dimen>
<dimen name="module_apps_navigation_icon_height">120px</dimen>
<dimen name="module_apps_navigation_icon_marginLeft">61px</dimen>
<dimen name="module_apps_navigation_icon_paddingBottom">60px</dimen>
<dimen name="module_apps_app_name_marginTop">32px</dimen>
<dimen name="module_apps_app_name_textSize">32px</dimen>
<dimen name="module_apps_page_paddingLeft">220px</dimen>
<dimen name="module_apps_page_paddingRight">220px</dimen>
<dimen name="module_apps_page_item_verticalSpacing">154px</dimen>
</resources>

View File

@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -2,15 +2,20 @@
package com.mogo.module.common.entity;
import android.text.TextUtils;
import java.io.Serializable;
@SuppressWarnings("unused")
public class MarkerActivitiesScope implements Serializable {
private String content;
private int isCheck;
private boolean isCheck;
public String getContent() {
if (TextUtils.isEmpty(content)) {
return "未知";
}
return content;
}
@@ -18,11 +23,11 @@ public class MarkerActivitiesScope implements Serializable {
this.content = content;
}
public int getIsCheck() {
public boolean getIsCheck() {
return isCheck;
}
public void setIsCheck(int isCheck) {
public void setIsCheck(boolean isCheck) {
this.isCheck = isCheck;
}

View File

@@ -8,44 +8,159 @@ import java.io.Serializable;
@SuppressWarnings("unused")
public class MarkerDynamicData implements Serializable {
//QQ音乐懒人听书乐听头条 2 为书籍听书3 为新闻,1 为qq音乐
private int type;
private String mediaId;//qq音乐id书的bookId
//qq音乐url 懒人听书为“”
private String mediaUrl;
//歌曲名 ,当前播放书名,新闻标题内容
private String mediaName;
//演唱歌手,当前章节,新闻来源
private String mediaSinger;
//歌曲封面,书籍封面,新闻预览图
private String mediaImg;
//音乐类别,类似经典 流行只有qq特有
private String mediaType;
private int maxTime;//音频总时长
private String bookInfo;//懒人听书json串
//当前播放时长,可以不加,播放进度单独独立出来
private int curTime;
//是否是本地音频只有qq音乐
private boolean isLocalMedia;//本地
//播放模式,顺序,单曲循环,随机
private int mediaPlayMode;
//1 播放 2 缓冲 0 暂停/停止 -1 播放错误
private int playState;
private double id;
private String name;
private double type;
public double getId() {
return id;
public String getMediaId() {
return mediaId;
}
public void setId(double id) {
this.id = id;
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getName() {
if (TextUtils.isEmpty(name)) {
return "未知";
}
return name;
public String getMediaUrl() {
return mediaUrl;
}
public void setName(String name) {
this.name = name;
public void setMediaUrl(String mediaUrl) {
this.mediaUrl = mediaUrl;
}
public double getType() {
public int getType() {
return type;
}
public void setType(double type) {
public void setType(int type) {
this.type = type;
}
public int getPlayState() {
return playState;
}
public void setPlayState(int playState) {
this.playState = playState;
}
public String getMediaName() {
if (TextUtils.isEmpty(mediaName)) {
return "未知";
}
return mediaName;
}
public void setMediaName(String mediaName) {
this.mediaName = mediaName;
}
public String getMediaSinger() {
if (TextUtils.isEmpty(mediaSinger)) {
return "";
}
return mediaSinger;
}
public void setMediaSinger(String mediaSinger) {
this.mediaSinger = mediaSinger;
}
public String getMediaImg() {
return mediaImg;
}
public void setMediaImg(String mediaImg) {
this.mediaImg = mediaImg;
}
public long getMaxTime() {
return maxTime;
}
public void setMaxTime(int maxTime) {
this.maxTime = maxTime;
}
public long getCurTime() {
return curTime;
}
public void setCurTime(int curTime) {
this.curTime = curTime;
}
public String getMediaType() {
if (TextUtils.isEmpty(mediaType)) {
return "";
}
return mediaType;
}
public void setMediaType(String mediaType) {
this.mediaType = mediaType;
}
public boolean isLocalMedia() {
return isLocalMedia;
}
public void setLocalMedia(boolean localMedia) {
isLocalMedia = localMedia;
}
public int getMediaPlayMode() {
return mediaPlayMode;
}
public void setMediaPlayMode(int mediaPlayMode) {
this.mediaPlayMode = mediaPlayMode;
}
public String getBookInfo() {
return bookInfo;
}
public void setBookInfo(String bookInfo) {
this.bookInfo = bookInfo;
}
@Override
public String toString() {
return "MarkerDynamicData{" +
"id=" + id +
", name='" + name + '\'' +
", type=" + type +
"type=" + type +
", mediaId='" + mediaId + '\'' +
", mediaUrl='" + mediaUrl + '\'' +
", mediaName='" + mediaName + '\'' +
", mediaSinger='" + mediaSinger + '\'' +
", mediaImg='" + mediaImg + '\'' +
", mediaType='" + mediaType + '\'' +
", maxTime=" + maxTime +
", bookInfo='" + bookInfo + '\'' +
", curTime=" + curTime +
", isLocalMedia=" + isLocalMedia +
", mediaPlayMode=" + mediaPlayMode +
", playState=" + playState +
'}';
}
}

View File

@@ -1,42 +1,71 @@
package com.mogo.module.common.entity;
import android.text.TextUtils;
import java.io.Serializable;
import java.util.List;
@SuppressWarnings("unused")
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-1615:12
* desc : 爱好
* version: 1.0
*/
public class MarkerHobbyDatum implements Serializable {
private List<MarkerOnlineTag> singerTop2; // 最喜欢的两位歌手
private List<MarkerOnlineTag> songTypeTop2; // 最喜欢的两种音乐类型
private List<MarkerOnlineTag> newsType; // 最喜欢的资讯类型
private List<MarkerOnlineTag> listenBookTop2; // 最喜欢听的两本书
private List<MarkerOnlineTag> ifSociety; // 是否喜爱社交
private String content;
private int isCheck;
public String getContent() {
if (TextUtils.isEmpty(content)) {
return "未知";
}
return content;
public List<MarkerOnlineTag> getSingerTop2() {
return singerTop2;
}
public void setContent(String content) {
this.content = content;
public void setSingerTop2(List<MarkerOnlineTag> singerTop2) {
this.singerTop2 = singerTop2;
}
public int getIsCheck() {
return isCheck;
public List<MarkerOnlineTag> getSongTypeTop2() {
return songTypeTop2;
}
public void setIsCheck(int isCheck) {
this.isCheck = isCheck;
public void setSongTypeTop2(List<MarkerOnlineTag> songTypeTop2) {
this.songTypeTop2 = songTypeTop2;
}
public List<MarkerOnlineTag> getNewsType() {
return newsType;
}
public void setNewsType(List<MarkerOnlineTag> newsType) {
this.newsType = newsType;
}
public List<MarkerOnlineTag> getListenBookTop2() {
return listenBookTop2;
}
public void setListenBookTop2(List<MarkerOnlineTag> listenBookTop2) {
this.listenBookTop2 = listenBookTop2;
}
public List<MarkerOnlineTag> getIfSociety() {
return ifSociety;
}
public void setIfSociety(List<MarkerOnlineTag> ifSociety) {
this.ifSociety = ifSociety;
}
@Override
public String toString() {
return "MarkerHobbyDatum{" +
"content='" + content + '\'' +
", isCheck=" + isCheck +
"singerTop2=" + singerTop2 +
", songTypeTop2=" + songTypeTop2 +
", newsType=" + newsType +
", listenBookTop2=" + listenBookTop2 +
", ifSociety=" + ifSociety +
'}';
}
}

View File

@@ -13,7 +13,7 @@ public class MarkerOnlineCar implements Serializable {
private MarkerUserInfo userInfo;//用户数据
private MarkerCarInfo carInfo;//车辆数据
private MarkerDynamicData dynamicData;//动态数据
private List<MarkerHobbyDatum> hobbyData;//爱好数据集合
private MarkerHobbyDatum hobbyData;//爱好数据集合
private List<MarkerActivitiesScope> activitiesScope;//活动范围数据集合
private double compatibility;
@@ -49,11 +49,11 @@ public class MarkerOnlineCar implements Serializable {
this.dynamicData = dynamicData;
}
public List<MarkerHobbyDatum> getHobbyData() {
public MarkerHobbyDatum getHobbyData() {
return hobbyData;
}
public void setHobbyData(List<MarkerHobbyDatum> hobbyData) {
public void setHobbyData(MarkerHobbyDatum hobbyData) {
this.hobbyData = hobbyData;
}

View File

@@ -0,0 +1,41 @@
package com.mogo.module.common.entity;
import android.text.TextUtils;
import java.io.Serializable;
@SuppressWarnings("unused")
public class MarkerOnlineTag implements Serializable {
private String content;
private boolean isCheck;
public String getContent() {
if (TextUtils.isEmpty(content)) {
return "未知";
}
return content;
}
public void setContent(String content) {
this.content = content;
}
public boolean getIsCheck() {
return isCheck;
}
public void setIsCheck(boolean isCheck) {
this.isCheck = isCheck;
}
@Override
public String toString() {
return "MarkerHobbyDatum{" +
"content='" + content + '\'' +
", isCheck=" + isCheck +
'}';
}
}

View File

@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -15,9 +15,16 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.logger.Logger;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder.Callback {
private static final String TAG = "JSurfaceView";
private SurfaceHolder mHolder;
/**
@@ -33,6 +40,15 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
*/
private int[] mFrames;
// 使用 BitmapFactory.Option.inBitmap 属性复用 bitmap 对象
private Bitmap mContainerBitmap = null;
// mContainerBitmap 是否生效
private boolean mContainerBitmapStatus = true;
// mContainerBitmapStatus 为 false 时,使用该缓存方案
private Map< Integer, WeakReference< Bitmap > > mBitmapRefMap = new HashMap<>();
public JSurfaceView( Context context ) {
super( context );
init();
@@ -87,28 +103,60 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
private void drawBitmap() {
//获取画布并锁定
Canvas mCanvas = mHolder.lockCanvas();
if ( mCanvas == null ) {
Canvas canvas = mHolder.lockCanvas();
if ( canvas == null ) {
return;
}
//绘制透明色
mCanvas.drawColor( Color.TRANSPARENT, PorterDuff.Mode.CLEAR );
Bitmap mBitmap = BitmapFactory.decodeResource( getResources(), mFrames[mCurrentPos % mFrames.length] );
canvas.drawColor( Color.TRANSPARENT, PorterDuff.Mode.CLEAR );
int factPosition = mCurrentPos % mFrames.length;
if ( mContainerBitmapStatus ) {
if ( mContainerBitmap == null ) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inMutable = true;
mContainerBitmap = BitmapFactory.decodeResource( getResources(), mFrames[factPosition], options );
} else {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inMutable = true;
options.inBitmap = mContainerBitmap;
try {
BitmapFactory.decodeResource( getResources(), mFrames[factPosition], options );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
mContainerBitmapStatus = false;
mContainerBitmap = null;
}
}
}
if ( !mContainerBitmapStatus ) {
WeakReference< Bitmap > ref = mBitmapRefMap.get( factPosition );
if ( ref != null && ref.get() != null && !ref.get().isRecycled() ) {
mContainerBitmap = ref.get();
} else {
mContainerBitmap = BitmapFactory.decodeResource( getResources(), mFrames[factPosition] );
mBitmapRefMap.put( factPosition, new WeakReference<>( mContainerBitmap ) );
}
}
if ( mContainerBitmap == null || mContainerBitmap.isRecycled() ) {
return;
}
Paint paint = new Paint();
Rect mSrcRect = new Rect( 0,
0,
mBitmap.getWidth(),
mBitmap.getHeight() ); // 图片绘制
mContainerBitmap.getWidth(),
mContainerBitmap.getHeight() ); // 图片绘制
Rect mDestRect = new Rect( 0,
0,
getWidth(),
getHeight() );// 图片绘制位置
mCanvas.drawBitmap( mBitmap, mSrcRect, mDestRect, paint );
canvas.drawBitmap( mContainerBitmap, mSrcRect, mDestRect, paint );
//解锁画布并展示bitmap到surface
mHolder.unlockCanvasAndPost( mCanvas );
mBitmap.recycle();
mHolder.unlockCanvasAndPost( canvas );
}
@Override

View File

@@ -23,6 +23,7 @@ import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoModulePaths;
@@ -41,6 +42,7 @@ 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;
/**
@@ -67,6 +69,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
private NaviInfoView mNaviInfo;
private TextView mExitNavi;
private View mSpeedLimit;
private TextView mSpeedLimitValue;
private View mSpeedLimitUnit;
private IMogoMapService mService;
private IMogoMapUIController mMApUIController;
private IMogoLocationClient mMogoLocationClient;
@@ -91,7 +97,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
@Override
protected void initViews() {
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation();
mMogoAddressManager = (IMogoAddressManager) ARouter.getInstance().build( MogoServicePaths.PATH_ADDRESS_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 );
@@ -135,7 +141,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mExitNavi.setOnClickListener( view -> {
if ( mMogoNavi != null ) {
if ( mIsLock ) {
NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog(getContext());
NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog( getContext() );
naviNoticeDialog.show();
} else {
mMApUIController.recoverLockMode();
@@ -143,6 +149,10 @@ 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
@@ -188,9 +198,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mCommonAddress.setVisibility( View.GONE );
mNaviInfo.setVisibility( View.VISIBLE );
mExitNavi.setVisibility( View.VISIBLE );
AnalyticsUtils.track("Navigation_guide_type", new HashMap<>());
AnalyticsUtils.track( "Navigation_guide_type", new HashMap<>() );
mMApUIController.setPointToCenter(0.675926, 0.77552);
mMApUIController.setPointToCenter( 0.675926, 0.77552 );
}
@Override
@@ -198,9 +208,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mCommonAddress.setVisibility( View.VISIBLE );
mNaviInfo.setVisibility( View.GONE );
mExitNavi.setVisibility( View.GONE );
AnalyticsUtils.track("Navigation_guide_type", new HashMap<>());
mSpeedLimit.setVisibility( View.GONE );
AnalyticsUtils.track( "Navigation_guide_type", new HashMap<>() );
mMApUIController.setPointToCenter(0.66145, 0.590688);
mMApUIController.setPointToCenter( 0.66145, 0.590688 );
}
@@ -212,6 +223,20 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
public void onoCalculateFailed() {
}
@Override
public void onUpdateTraffic( MogoTraffic traffic ) {
if ( traffic == null ) {
return;
}
if ( traffic.getSpeedLimit() <= 0 ) {
mSpeedLimit.setVisibility( View.INVISIBLE );
mSpeedLimitValue.setText( "--" );
} else {
mSpeedLimit.setVisibility( View.VISIBLE );
mSpeedLimitValue.setText( String.valueOf( traffic.getSpeedLimit() ) );
}
}
@Override
public void onMapLoaded() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="90dp" />
<stroke android:width="@dimen/dp_6" android:color="#B92F49" />/>
</shape>
</item>
</selector>

View File

@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/module_entrance_id_search"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_90"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_2"
android:layout_height="@dimen/module_ext_search_height"
android:layout_marginLeft="@dimen/module_ext_search_marginLeft"
android:layout_marginTop="@dimen/module_ext_search_marginTop"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:drawableLeft="@drawable/module_map_ic_search"
android:drawablePadding="@dimen/dp_16"
android:drawablePadding="@dimen/module_ext_search_drawablePadding"
android:gravity="center_vertical"
android:paddingLeft="@dimen/dp_26"
android:paddingRight="@dimen/dp_26"
android:paddingLeft="@dimen/module_ext_search_paddingLeft"
android:paddingRight="@dimen/module_ext_search_paddingRight"
android:text="@string/module_map_str_search_hint"
android:textColor="#99FFFFFF"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_ext_search_textSize"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -26,9 +27,9 @@
<LinearLayout
android:id="@+id/module_entrance_id_common_address"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_90"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_2"
android:layout_height="@dimen/module_ext_common_address_height"
android:layout_marginLeft="@dimen/module_ext_common_address_marginLeft"
android:layout_marginTop="@dimen/module_ext_common_address_marginTop"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center_vertical"
app:layout_constraintLeft_toRightOf="@+id/module_entrance_id_search"
@@ -36,8 +37,8 @@
<RelativeLayout
android:id="@+id/module_entrance_id_home"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_90"
android:layout_width="@dimen/module_ext_common_address_home_width"
android:layout_height="@dimen/module_ext_common_address_home_height"
android:background="@drawable/module_ext_dw_left_corner_bkg">
<ImageView
@@ -47,8 +48,8 @@
android:src="@drawable/module_map_ic_home" />
<View
android:layout_width="@dimen/dp_2"
android:layout_height="@dimen/dp_54"
android:layout_width="@dimen/module_ext_common_address_divider_width"
android:layout_height="@dimen/module_ext_common_address_divider_height"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#1ED8D8D8" />
@@ -57,8 +58,8 @@
<LinearLayout
android:id="@+id/module_entrance_id_company"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_90"
android:layout_width="@dimen/module_ext_common_address_company_width"
android:layout_height="@dimen/module_ext_common_address_company_height"
android:background="@drawable/module_ext_dw_right_corner_bkg"
android:gravity="center">
@@ -71,22 +72,52 @@
</LinearLayout>
<LinearLayout
android:id="@+id/module_entrance_id_speed_limit_container"
android:layout_width="@dimen/module_ext_speed_limit_width"
android:layout_height="@dimen/module_ext_speed_limit_height"
android:layout_marginTop="@dimen/module_ext_speed_limit_marginTop"
android:layout_marginRight="@dimen/module_ext_speed_limit_marginRight"
android:background="@drawable/module_ext_dw_speed_limit_bkg"
android:gravity="center"
android:visibility="invisible"
android:orientation="vertical"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/module_entrance_id_speed_limit_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="@dimen/module_ext_speed_limit_value_textSize"
tools:text="100" />
<TextView
android:id="@+id/module_entrance_id_speed_limit_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="km/h"
android:textColor="#CCFFFFFF"
android:textSize="@dimen/module_ext_speed_limit_unit_textSize" />
</LinearLayout>
<com.mogo.module.extensions.navi.NaviInfoView
android:id="@+id/module_entrance_id_navi_info_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginLeft="@dimen/module_ext_navi_panel_marginLeft"
android:layout_marginTop="@dimen/module_ext_navi_panel_marginTop"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/module_entrance_id_operation_panel"
android:layout_width="@dimen/dp_90"
android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_32"
android:layout_marginBottom="@dimen/dp_60"
android:layout_marginRight="@dimen/module_ext_operation_panel_marginRight"
android:layout_marginBottom="@dimen/module_ext_operation_panel_marginBottom"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
@@ -95,7 +126,7 @@
<RelativeLayout
android:id="@+id/module_entrance_id_vr_mode"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_92"
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">
@@ -107,11 +138,11 @@
android:src="@drawable/module_map_ic_move2_current_location"
android:text="实景"
android:textColor="#CCFFFFFF"
android:textSize="@dimen/dp_24" />
android:textSize="@dimen/module_ext_operation_panel_vr_textSize" />
<View
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_2"
android:layout_width="@dimen/module_ext_operation_panel_divider_width"
android:layout_height="@dimen/module_ext_operation_panel_divider_height"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#1ED8D8D8" />
@@ -120,7 +151,7 @@
<LinearLayout
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center">
@@ -133,30 +164,30 @@
<TextView
android:id="@+id/module_entrance_id_upload_road_condition"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
android:layout_marginBottom="@dimen/dp_40"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:layout_marginBottom="@dimen/module_ext_operation_panel_share_marginBottom"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"
android:gravity="center"
android:text="@string/module_map_str_upload_road_condition"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_24"
android:textSize="@dimen/module_ext_operation_panel_share_textSize"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_operation_panel"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_operation_panel"
app:layout_goneMarginBottom="@dimen/dp_32"
app:layout_goneMarginRight="@dimen/dp_32" />
app:layout_goneMarginBottom="@dimen/module_ext_operation_panel_share_goneMarginBottom"
app:layout_goneMarginRight="@dimen/module_ext_operation_panel_share_goneMarginRight" />
<TextView
android:id="@+id/module_entrance_id_exit_navi"
android:layout_width="@dimen/dp_200"
android:layout_height="@dimen/dp_90"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginBottom="@dimen/dp_60"
android:layout_width="@dimen/module_ext_navi_exit_width"
android:layout_height="@dimen/module_ext_navi_exit_height"
android:layout_marginLeft="@dimen/module_ext_navi_exit_marginLeft"
android:layout_marginBottom="@dimen/module_ext_navi_exit_marginBottom"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center"
android:text="退出导航"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_ext_navi_exit_textSize"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />

View File

@@ -3,16 +3,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_height="@dimen/module_ext_height"
android:background="@drawable/module_ext_dw_shadow_frame_bkg"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_70"
android:paddingRight="@dimen/dp_70">
android:paddingLeft="@dimen/module_ext_paddingLeft"
android:paddingRight="@dimen/module_ext_paddingRight">
<com.mogo.module.extensions.anim.JSurfaceView
android:id="@+id/module_ext_id_voice"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
android:layout_width="@dimen/module_ext_voice_icon_width"
android:layout_height="@dimen/module_ext_voice_icon_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -24,7 +24,7 @@
android:gravity="center_vertical"
android:text="@string/module_ext_str_voice_msg"
android:textColor="@color/module_ext_color_voice_text"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_ext_voice_textSize"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/module_ext_id_voice"
app:layout_constraintTop_toTopOf="parent" />
@@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_48"
android:textSize="@dimen/module_ext_time_textSize"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -45,10 +45,10 @@
android:id="@+id/module_ext_id_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_80"
android:layout_marginRight="@dimen/module_ext_date_marginRight"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_28"
android:textSize="@dimen/module_ext_date_textSize"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_time"
app:layout_constraintTop_toTopOf="parent"
@@ -58,8 +58,8 @@
android:id="@+id/module_ext_id_weather_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_26"
android:gravity="center"
android:layout_marginRight="@dimen/module_ext_weather_marginRight"
android:gravity="bottom"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_date"
@@ -67,25 +67,25 @@
<ImageView
android:id="@+id/module_ext_id_weather_icon"
android:layout_width="@dimen/dp_44"
android:layout_height="@dimen/dp_44" />
android:layout_width="@dimen/module_ext_weather_icon_width"
android:layout_height="@dimen/module_ext_weather_icon_height" />
<TextView
android:id="@+id/module_ext_id_weather_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_18"
android:layout_marginRight="@dimen/module_ext_weather_temp_marginRight"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_34"
android:textSize="@dimen/module_ext_weather_temp_textSize"
tools:text="28°" />
<TextView
android:id="@+id/module_ext_id_weather_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_26"
android:layout_marginRight="@dimen/module_ext_weather_temp_desc_marginRight"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_28"
android:textSize="@dimen/module_ext_weather_temp_desc_textSize"
tools:text="晴转多云" />
@@ -100,7 +100,7 @@
android:id="@+id/module_ext_id_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_28"
android:layout_marginRight="@dimen/module_ext_msg_marginRight"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_weather_container"
@@ -113,13 +113,13 @@
<TextView
android:id="@+id/module_ext_id_msg_counter"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:layout_width="@dimen/module_ext_msg_counter_width"
android:layout_height="@dimen/module_ext_msg_counter_height"
android:layout_gravity="right"
android:background="@drawable/module_ext_drawable_msg_bkg"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_20"
android:textSize="@dimen/module_ext_msg_counter_textSize"
tools:text="···" />
</FrameLayout>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_458"
android:layout_height="@dimen/dp_318"
android:layout_width="@dimen/module_ext_navi_info_panel_width"
android:layout_height="@dimen/module_ext_navi_info_panel_height"
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:orientation="vertical">
<ImageView
android:id="@+id/module_map_id_navi_next_info_road_turn_icon"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_159"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_24"
android:layout_width="@dimen/module_ext_navi_info_panel_turn_icon_width"
android:layout_height="@dimen/module_ext_navi_info_panel_turn_icon_height"
android:layout_marginLeft="@dimen/module_ext_navi_info_panel_turn_icon_marginLeft"
android:layout_marginTop="@dimen/module_ext_navi_info_panel_turn_icon_marginTop"
android:scaleType="fitCenter"
tools:src="@drawable/ic_11" />
@@ -20,10 +20,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/module_map_id_navi_next_info_road_turn_icon"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginTop="@dimen/module_ext_navi_info_panel_next_info_distance_marginTop"
android:layout_toRightOf="@+id/module_map_id_navi_next_info_road_turn_icon"
android:textColor="#282828"
android:textSize="@dimen/dp_60"
android:textSize="@dimen/module_ext_navi_info_panel_next_info_distance_textSize"
tools:text="53" />
<TextView
@@ -31,11 +31,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/module_map_id_navi_next_info_distance"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_16"
android:layout_marginLeft="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginLeft"
android:layout_marginBottom="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginBottom"
android:layout_toRightOf="@+id/module_map_id_navi_next_info_distance"
android:textColor="#282828"
android:textSize="@dimen/dp_28"
android:textSize="@dimen/module_ext_navi_info_panel_next_info_distance_unit_textSize"
tools:text="米" />
<TextView
@@ -47,7 +47,7 @@
android:ellipsize="end"
android:maxLines="2"
android:textColor="#282828"
android:textSize="@dimen/dp_28"
android:textSize="@dimen/module_ext_navi_info_panel_next_info_road_textSize"
tools:text="北三环东路辅路" />
<TextView
@@ -56,11 +56,11 @@
android:layout_height="wrap_content"
android:layout_below="@+id/module_map_id_navi_next_info_road_turn_icon"
android:layout_alignParentBottom="true"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginTop="@dimen/module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop"
android:background="@drawable/module_ext_dw_navi_info_extras_bkg"
android:gravity="center"
android:maxLines="2"
android:textColor="#282828"
android:textSize="@dimen/dp_28"
android:textSize="@dimen/module_ext_navi_info_panel__arrive_destination_estimate_info_textSize"
tools:text="剩余2000.8公里 1000小时59分钟59秒 \n1天后达到达到达到达到" />
</RelativeLayout>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_ext_layout_entrance.xml-->
<dimen name="module_ext_search_height">58px</dimen>
<dimen name="module_ext_search_marginLeft">18px</dimen>
<dimen name="module_ext_search_marginTop">8px</dimen>
<dimen name="module_ext_search_drawablePadding">11.2px</dimen>
<dimen name="module_ext_search_paddingLeft">10.8px</dimen>
<dimen name="module_ext_search_paddingRight">17px</dimen>
<dimen name="module_ext_search_textSize">20px</dimen>
<dimen name="module_ext_common_address_height">58px</dimen>
<dimen name="module_ext_common_address_marginLeft">19px</dimen>
<dimen name="module_ext_common_address_marginTop">8px</dimen>
<dimen name="module_ext_common_address_home_width">64.2px</dimen>
<dimen name="module_ext_common_address_home_height">58px</dimen>
<dimen name="module_ext_common_address_divider_width">1px</dimen>
<dimen name="module_ext_common_address_divider_height">33.4px</dimen>
<dimen name="module_ext_common_address_company_width">64.2px</dimen>
<dimen name="module_ext_common_address_company_height">58px</dimen>
<dimen name="module_ext_speed_limit_width">96px</dimen>
<dimen name="module_ext_speed_limit_height">96px</dimen>
<dimen name="module_ext_speed_limit_marginTop">8px</dimen>
<dimen name="module_ext_speed_limit_marginRight">32px</dimen>
<dimen name="module_ext_speed_limit_value_textSize">32px</dimen>
<dimen name="module_ext_speed_limit_unit_textSize">15px</dimen>
<dimen name="module_ext_navi_panel_marginLeft">20px</dimen>
<dimen name="module_ext_navi_panel_marginTop">8px</dimen>
<dimen name="module_ext_operation_panel_width">58px</dimen>
<dimen name="module_ext_operation_panel_marginRight">20px</dimen>
<dimen name="module_ext_operation_panel_marginBottom">34.5px</dimen>
<dimen name="module_ext_operation_panel_vr_height">58px</dimen>
<dimen name="module_ext_operation_panel_vr_textSize">17px</dimen>
<dimen name="module_ext_operation_panel_divider_width">31.4px</dimen>
<dimen name="module_ext_operation_panel_divider_height">1.2px</dimen>
<dimen name="module_ext_operation_panel_move2_height">58px</dimen>
<dimen name="module_ext_operation_panel_share_width">58px</dimen>
<dimen name="module_ext_operation_panel_share_height">58px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">21px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">14px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">34.5px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">20px</dimen>
<dimen name="module_ext_navi_exit_width">130px</dimen>
<dimen name="module_ext_navi_exit_height">58px</dimen>
<dimen name="module_ext_navi_exit_marginLeft">20px</dimen>
<dimen name="module_ext_navi_exit_marginBottom">32px</dimen>
<dimen name="module_ext_navi_exit_textSize">22px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">640px</dimen>
<dimen name="module_ext_paddingRight">32px</dimen>
<dimen name="module_ext_paddingLeft">32px</dimen>
<dimen name="module_ext_voice_icon_width">64px</dimen>
<dimen name="module_ext_voice_icon_height">64px</dimen>
<dimen name="module_ext_voice_textSize">22px</dimen>
<dimen name="module_ext_time_textSize">28px</dimen>
<dimen name="module_ext_date_marginRight">22px</dimen>
<dimen name="module_ext_date_textSize">22px</dimen>
<dimen name="module_ext_weather_marginRight">16px</dimen>
<dimen name="module_ext_weather_icon_width">24px</dimen>
<dimen name="module_ext_weather_icon_height">24px</dimen>
<dimen name="module_ext_weather_temp_marginRight">18px</dimen>
<dimen name="module_ext_weather_temp_textSize">18.48px</dimen>
<dimen name="module_ext_weather_temp_desc_marginRight">16px</dimen>
<dimen name="module_ext_weather_temp_desc_textSize">22px</dimen>
<dimen name="module_ext_msg_marginRight">28px</dimen>
<dimen name="module_ext_msg_counter_width">15px</dimen>
<dimen name="module_ext_msg_counter_height">15px</dimen>
<dimen name="module_ext_msg_counter_textSize">11.73px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">244px</dimen>
<dimen name="module_ext_navi_info_panel_height">170px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">85px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_height">85px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginLeft">13px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginTop">13px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_marginTop">20px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_textSize">32px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginLeft">7px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginBottom">8px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">16px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">15px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px
</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">15px</dimen>
</resources>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_ext_layout_entrance.xml-->
<dimen name="module_ext_search_height">90px</dimen>
<dimen name="module_ext_search_marginLeft">32px</dimen>
<dimen name="module_ext_search_marginTop">2px</dimen>
<dimen name="module_ext_search_drawablePadding">16px</dimen>
<dimen name="module_ext_search_paddingLeft">26px</dimen>
<dimen name="module_ext_search_paddingRight">26px</dimen>
<dimen name="module_ext_search_textSize">32px</dimen>
<dimen name="module_ext_common_address_height">90px</dimen>
<dimen name="module_ext_common_address_marginLeft">32px</dimen>
<dimen name="module_ext_common_address_marginTop">2px</dimen>
<dimen name="module_ext_common_address_home_width">100px</dimen>
<dimen name="module_ext_common_address_home_height">90px</dimen>
<dimen name="module_ext_common_address_divider_width">2px</dimen>
<dimen name="module_ext_common_address_divider_height">54px</dimen>
<dimen name="module_ext_common_address_company_width">100px</dimen>
<dimen name="module_ext_common_address_company_height">90px</dimen>
<dimen name="module_ext_speed_limit_width">180px</dimen>
<dimen name="module_ext_speed_limit_height">180px</dimen>
<dimen name="module_ext_speed_limit_marginTop">2px</dimen>
<dimen name="module_ext_speed_limit_marginRight">60px</dimen>
<dimen name="module_ext_speed_limit_value_textSize">60px</dimen>
<dimen name="module_ext_speed_limit_unit_textSize">28px</dimen>
<dimen name="module_ext_navi_panel_marginLeft">32px</dimen>
<dimen name="module_ext_navi_panel_marginTop">2px</dimen>
<dimen name="module_ext_operation_panel_width">90px</dimen>
<dimen name="module_ext_operation_panel_marginRight">32px</dimen>
<dimen name="module_ext_operation_panel_marginBottom">60px</dimen>
<dimen name="module_ext_operation_panel_vr_height">92px</dimen>
<dimen name="module_ext_operation_panel_vr_textSize">24px</dimen>
<dimen name="module_ext_operation_panel_divider_width">48px</dimen>
<dimen name="module_ext_operation_panel_divider_height">2px</dimen>
<dimen name="module_ext_operation_panel_move2_height">90px</dimen>
<dimen name="module_ext_operation_panel_share_width">90px</dimen>
<dimen name="module_ext_operation_panel_share_height">90px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">40px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">24px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">32px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">32px</dimen>
<dimen name="module_ext_navi_exit_width">200px</dimen>
<dimen name="module_ext_navi_exit_height">90px</dimen>
<dimen name="module_ext_navi_exit_marginLeft">32px</dimen>
<dimen name="module_ext_navi_exit_marginBottom">60px</dimen>
<dimen name="module_ext_navi_exit_textSize">32px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">120px</dimen>
<dimen name="module_ext_paddingRight">60px</dimen>
<dimen name="module_ext_paddingLeft">60px</dimen>
<dimen name="module_ext_voice_icon_width">120px</dimen>
<dimen name="module_ext_voice_icon_height">120px</dimen>
<dimen name="module_ext_voice_textSize">32px</dimen>
<dimen name="module_ext_time_textSize">48px</dimen>
<dimen name="module_ext_date_marginRight">80px</dimen>
<dimen name="module_ext_date_textSize">28px</dimen>
<dimen name="module_ext_weather_marginRight">26px</dimen>
<dimen name="module_ext_weather_icon_width">44px</dimen>
<dimen name="module_ext_weather_icon_height">44px</dimen>
<dimen name="module_ext_weather_temp_marginRight">18px</dimen>
<dimen name="module_ext_weather_temp_textSize">34px</dimen>
<dimen name="module_ext_weather_temp_desc_marginRight">26px</dimen>
<dimen name="module_ext_weather_temp_desc_textSize">28px</dimen>
<dimen name="module_ext_msg_marginRight">28px</dimen>
<dimen name="module_ext_msg_counter_width">30px</dimen>
<dimen name="module_ext_msg_counter_height">30px</dimen>
<dimen name="module_ext_msg_counter_textSize">20px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">458px</dimen>
<dimen name="module_ext_navi_info_panel_height">318px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_height">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginLeft">24px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_marginTop">10px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_textSize">60px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginLeft">12px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginBottom">16px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">28px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">28px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
</resources>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_ext_layout_entrance.xml-->
<dimen name="module_ext_search_height">90px</dimen>
<dimen name="module_ext_search_marginLeft">32px</dimen>
<dimen name="module_ext_search_marginTop">2px</dimen>
<dimen name="module_ext_search_drawablePadding">16px</dimen>
<dimen name="module_ext_search_paddingLeft">26px</dimen>
<dimen name="module_ext_search_paddingRight">26px</dimen>
<dimen name="module_ext_search_textSize">32px</dimen>
<dimen name="module_ext_common_address_height">90px</dimen>
<dimen name="module_ext_common_address_marginLeft">32px</dimen>
<dimen name="module_ext_common_address_marginTop">2px</dimen>
<dimen name="module_ext_common_address_home_width">100px</dimen>
<dimen name="module_ext_common_address_home_height">90px</dimen>
<dimen name="module_ext_common_address_divider_width">2px</dimen>
<dimen name="module_ext_common_address_divider_height">54px</dimen>
<dimen name="module_ext_common_address_company_width">100px</dimen>
<dimen name="module_ext_common_address_company_height">90px</dimen>
<dimen name="module_ext_speed_limit_width">180px</dimen>
<dimen name="module_ext_speed_limit_height">180px</dimen>
<dimen name="module_ext_speed_limit_marginTop">2px</dimen>
<dimen name="module_ext_speed_limit_marginRight">60px</dimen>
<dimen name="module_ext_speed_limit_value_textSize">60px</dimen>
<dimen name="module_ext_speed_limit_unit_textSize">28px</dimen>
<dimen name="module_ext_navi_panel_marginLeft">32px</dimen>
<dimen name="module_ext_navi_panel_marginTop">2px</dimen>
<dimen name="module_ext_operation_panel_width">90px</dimen>
<dimen name="module_ext_operation_panel_marginRight">32px</dimen>
<dimen name="module_ext_operation_panel_marginBottom">60px</dimen>
<dimen name="module_ext_operation_panel_vr_height">92px</dimen>
<dimen name="module_ext_operation_panel_vr_textSize">24px</dimen>
<dimen name="module_ext_operation_panel_divider_width">48px</dimen>
<dimen name="module_ext_operation_panel_divider_height">2px</dimen>
<dimen name="module_ext_operation_panel_move2_height">90px</dimen>
<dimen name="module_ext_operation_panel_share_width">90px</dimen>
<dimen name="module_ext_operation_panel_share_height">90px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">40px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">24px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">32px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">32px</dimen>
<dimen name="module_ext_navi_exit_width">200px</dimen>
<dimen name="module_ext_navi_exit_height">90px</dimen>
<dimen name="module_ext_navi_exit_marginLeft">32px</dimen>
<dimen name="module_ext_navi_exit_marginBottom">60px</dimen>
<dimen name="module_ext_navi_exit_textSize">32px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">120px</dimen>
<dimen name="module_ext_paddingRight">60px</dimen>
<dimen name="module_ext_paddingLeft">60px</dimen>
<dimen name="module_ext_voice_icon_width">120px</dimen>
<dimen name="module_ext_voice_icon_height">120px</dimen>
<dimen name="module_ext_voice_textSize">32px</dimen>
<dimen name="module_ext_time_textSize">48px</dimen>
<dimen name="module_ext_date_marginRight">80px</dimen>
<dimen name="module_ext_date_textSize">28px</dimen>
<dimen name="module_ext_weather_marginRight">26px</dimen>
<dimen name="module_ext_weather_icon_width">44px</dimen>
<dimen name="module_ext_weather_icon_height">44px</dimen>
<dimen name="module_ext_weather_temp_marginRight">18px</dimen>
<dimen name="module_ext_weather_temp_textSize">34px</dimen>
<dimen name="module_ext_weather_temp_desc_marginRight">26px</dimen>
<dimen name="module_ext_weather_temp_desc_textSize">28px</dimen>
<dimen name="module_ext_msg_marginRight">28px</dimen>
<dimen name="module_ext_msg_counter_width">30px</dimen>
<dimen name="module_ext_msg_counter_height">30px</dimen>
<dimen name="module_ext_msg_counter_textSize">20px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">458px</dimen>
<dimen name="module_ext_navi_info_panel_height">318px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_height">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginLeft">24px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_marginTop">10px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_textSize">60px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginLeft">12px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginBottom">16px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">28px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">28px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
</resources>

View File

@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -5,7 +5,7 @@
<activity
android:name=".MainActivity"
android:clearTaskOnLaunch="true"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|mcc|mnc|keyboard|navigation"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:enabled="true"
android:launchMode="singleInstance"
android:resizeableActivity="true"

View File

@@ -1,7 +1,6 @@
package com.mogo.module.main;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.View;
import android.widget.FrameLayout;
@@ -100,23 +99,20 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public void onPageSelected( int position ) {
try {
IMogoModuleProvider provider = mCardModulesAdapter.getProvider( mCurrentPosition );
trackLastCardShowEvent( provider );
mCurrentPosition = position;
final IMogoModuleProvider provider = mCardModulesAdapter.getProvider( position );
provider = mCardModulesAdapter.getProvider( mCurrentPosition );
mMogoModuleHandler.setEnable( provider.getModuleName() );
if ( !isClickMarker ) {
mMogoCardManager.invoke( position, mMogoModuleHandler.getCurrentModuleName() );
}
trackCardSelectedEvent( provider );
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
public void onPageScrolled( int position, float positionOffset, int positionOffsetPixels ) {
super.onPageScrolled( position, positionOffset, positionOffsetPixels );
}
@Override
public void onPageScrollStateChanged( int state ) {
super.onPageScrollStateChanged( state );
@@ -135,7 +131,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
* 卡片展示时长埋点
* @param provider
*/
private void trackCardSelectedEvent( IMogoModuleProvider provider ) {
private void trackLastCardShowEvent( IMogoModuleProvider provider ) {
if ( provider == null ) {
return;
}
@@ -143,6 +139,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
properties.put( "appname", provider.getAppName() );
properties.put( "packagename", provider.getAppPackage() );
properties.put( "activeTime", System.currentTimeMillis() - mCardStartShowTime );
properties.put( "type", provider.getModuleName() );
mAnalytics.track( "Launcher_Card_Show", properties );
mCardStartShowTime = System.currentTimeMillis();
}
@@ -157,6 +154,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
Map< String, Object > properties = new HashMap<>();
properties.put( "appname", provider.getAppName() );
properties.put( "packagename", provider.getAppPackage() );
properties.put( "type", provider.getModuleName() );
mAnalytics.track( "Launcher_Card_Slide", properties );
}
} );

View File

@@ -19,6 +19,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
@@ -212,96 +213,216 @@ public class MogoModulesManager implements MogoModulesHandler,
mMapLoadedCallback = null;
}
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onMapLoaded();
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onMapLoaded();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onTouch( MotionEvent motionEvent ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onTouch( motionEvent );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onTouch( motionEvent );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onPOIClick( MogoPoi poi ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onPOIClick( poi );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onPOIClick( poi );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onMapClick( MogoLatLng latLng ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onMapClick( latLng );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onMapClick( latLng );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onLockMap( boolean isLock ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onLockMap( isLock );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onLockMap( isLock );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onMapModeChanged( EnumMapUI ui ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onMapModeChanged( ui );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onMapModeChanged( ui );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onMapChanged( MogoLatLng location, float zoom, float tilt, float bearing ) {
Iterator< IMogoMapListener > iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onMapChanged( location, zoom, tilt, bearing );
IMogoMapListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onMapChanged( location, zoom, tilt, bearing );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onInitNaviFailure() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onInitNaviFailure();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onInitNaviFailure();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onInitNaviSuccess() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onInitNaviSuccess();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onInitNaviSuccess();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onNaviInfoUpdate( naviinfo );
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onNaviInfoUpdate( naviinfo );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onStartNavi() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onStartNavi();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onStartNavi();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onStopNavi() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onStopNavi();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onStopNavi();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@@ -309,24 +430,72 @@ public class MogoModulesManager implements MogoModulesHandler,
@Override
public void onCalculateSuccess() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onCalculateSuccess();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onCalculateSuccess();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onoCalculateFailed() {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onoCalculateFailed();
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onoCalculateFailed();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onUpdateTraffic( MogoTraffic traffic ) {
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
IMogoNaviListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onUpdateTraffic(traffic);
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@Override
public void onLocationChanged( MogoLocation location ) {
Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
if ( iterator == null ) {
return;
}
while ( iterator.hasNext() ) {
iterator.next().onLocationChanged( location );
IMogoLocationListener listener = iterator.next();
if ( listener != null ) {
try {
listener.onLocationChanged( location );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}
}
@@ -375,7 +544,11 @@ public class MogoModulesManager implements MogoModulesHandler,
public void onMarkerReceive( IMogoMarker marker ) {
IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener( marker.getOwner() );
if ( listener != null ) {
listener.onMarkerClicked( marker );
try {
listener.onMarkerClicked( marker );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
}
}

View File

@@ -1,40 +0,0 @@
package com.mogo.module.main.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
/**
* @author congtaowang
* @since 2020-01-02
* <p>
* 广播接收者
* <p>
* {@link Intent#ACTION_POWER_CONNECTED}
* {@link Intent#ACTION_POWER_DISCONNECTED}
*/
public class MogoReceiver extends BroadcastReceiver {
public static void register( Context context ) {
if ( context == null ) {
return;
}
IntentFilter inputFilter = new IntentFilter();
inputFilter.addAction( Intent.ACTION_POWER_CONNECTED );
inputFilter.addAction( Intent.ACTION_POWER_DISCONNECTED );
context.getApplicationContext().registerReceiver( new MogoReceiver(), inputFilter );
}
@Override
public void onReceive( Context context, Intent intent ) {
final String action = intent.getAction();
if ( TextUtils.equals( action, Intent.ACTION_POWER_CONNECTED ) ) {
}
if ( TextUtils.equals( action, Intent.ACTION_POWER_DISCONNECTED ) ) {
}
}
}

View File

@@ -15,7 +15,7 @@
<FrameLayout
android:id="@+id/module_main_id_map_shadow_frame"
android:layout_width="@dimen/dp_720"
android:layout_width="@dimen/module_main_map_shadow_frame_width"
android:layout_height="match_parent"
android:background="@drawable/module_main_dw_left_frame_bkg"
android:visibility="invisible" />
@@ -36,21 +36,21 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10">
android:layout_marginTop="@dimen/module_main_card_container_marginTop">
<!-- 卡片-->
<FrameLayout
android:layout_width="@dimen/dp_660"
android:layout_width="@dimen/module_main_card_container_width"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_70">
android:layout_marginLeft="@dimen/module_main_card_container_marginLeft">
<com.mogo.module.main.cards.OrientedViewPager
android:id="@+id/module_main_id_cards_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_211"
android:layout_marginBottom="@dimen/module_main_card_container_marginBottom"
android:clipToPadding="false"
android:overScrollMode="never"
android:paddingBottom="@dimen/dp_20" />
android:paddingBottom="@dimen/module_main_card_container_paddingBottom" />
<!-- 应用入口-->
<FrameLayout
android:id="@+id/module_main_id_apps_fragment_container"

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">720px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_marginLeft">60px</dimen>
<dimen name="module_main_card_container_marginBottom">211px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">720px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_marginLeft">60px</dimen>
<dimen name="module_main_card_container_marginBottom">211px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_shadow_frame_width">384px</dimen>
<dimen name="module_main_card_container_marginTop">8px</dimen>
<dimen name="module_main_card_container_width">352px</dimen>
<dimen name="module_main_card_container_marginLeft">32px</dimen>
<dimen name="module_main_card_container_marginBottom">140.5px</dimen>
<dimen name="module_main_card_container_paddingBottom">20px</dimen>
</resources>

View File

@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion

View File

@@ -8,6 +8,7 @@ import com.mogo.map.MogoLatLng
import com.mogo.map.navi.IMogoNaviListener
import com.mogo.map.navi.MogoCalculatePath
import com.mogo.map.navi.MogoNaviInfo
import com.mogo.map.navi.MogoTraffic
import com.mogo.map.search.inputtips.MogoTip
import com.mogo.module.common.MogoModulePaths
import com.mogo.module.navi.R
@@ -53,7 +54,10 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
override fun onoCalculateFailed() {
}
private lateinit var mAdapter: CalculatePathAdapter
override fun onUpdateTraffic(traffic: MogoTraffic?) {
}
private lateinit var mAdapter: CalculatePathAdapter
override fun getLayoutId(): Int {
return R.layout.fragment_search_category
}

View File

@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -32,6 +32,10 @@ import com.mogo.service.map.IMogoMapService;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -263,6 +267,8 @@ public class MarkerServiceHandler {
lastMarker = null;
getMarkerManager().removeMarkers();
JSONArray array = new JSONArray();
// 解析不同的Marker类型然后对应的进行绘制
if (response != null && response.getResult() != null) {
MarkerCardResult markerCardResult = response.getResult();
@@ -301,7 +307,7 @@ public class MarkerServiceHandler {
drawMapMarker(markerShowEntity);
}
analyticData(3, onlineCarList.size());
fillNumberTrackEventBody(array, 3, onlineCarList.size());
}
if (exploreWayList != null) {
@@ -318,7 +324,7 @@ public class MarkerServiceHandler {
drawMapMarker(markerShowEntity);
}
}
analyticData(1, exploreWayList.size());
fillNumberTrackEventBody(array, 1, exploreWayList.size());
}
if (shareMusicList != null) {
@@ -334,7 +340,7 @@ public class MarkerServiceHandler {
drawMapMarker(markerShowEntity);
}
analyticData(4, shareMusicList.size());
fillNumberTrackEventBody(array, 4, shareMusicList.size());
}
if (noveltyInfoList != null) {
@@ -373,27 +379,42 @@ public class MarkerServiceHandler {
break;
}
}
analyticData(2, num_gas_station);
analyticData(6, num_road_closed);
analyticData(5, num_traffic_check);
analyticData(7, num_shop_discount);
analyticData(8, num_fours_shop);
fillNumberTrackEventBody(array,2, num_gas_station);
fillNumberTrackEventBody(array,6, num_road_closed);
fillNumberTrackEventBody(array,5, num_traffic_check);
fillNumberTrackEventBody(array,7, num_shop_discount);
fillNumberTrackEventBody(array,8, num_fours_shop);
}
analyticData(array);
}
}
private static void fillNumberTrackEventBody(JSONArray arr, int type, int size){
JSONObject object = new JSONObject( );
try {
object.put( "type", type );
object.put( "num", size);
if ( arr != null ) {
arr.put( object );
}
} catch ( JSONException e ) {
e.printStackTrace();
}
getMapUIController().changeZoom(12);
}
/**
* 统计地图内数据获取
*
* @param type 类型
* @param num marker数量
* @param array 埋点数据
*/
private static void analyticData(int type, int num) {
private static void analyticData(JSONArray array) {
try {
if ( array == null || array.length() == 0 ) {
return;
}
final Map<String, Object> properties = new HashMap<>();
properties.put("type", type);
properties.put("num", num);
properties.put("data", array.toString());
getMogoAnalytics().track("Launcher_Data_Get", properties);
} catch (Exception e) {
e.printStackTrace();
@@ -411,14 +432,14 @@ public class MarkerServiceHandler {
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
.alpha( 0.7f )
.object( markerShowEntity )
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
options.icon(markerView);
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
marker.setOnMarkerClickListener(mogoMarkerClickListener);
marker.setObject(markerShowEntity);
marker.setAlpha(0.7f);
return marker;
} else {
Logger.e(TAG, "Location 必须进行初始化!!!!!");

View File

@@ -26,6 +26,7 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoModule;
@@ -46,8 +47,6 @@ import com.mogo.service.module.ModuleType;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.service.voice.IMogoVoiceListener;
import com.mogo.service.voice.IMogoVoiceManager;
import com.mogo.utils.logger.Logger;
import java.util.List;
@@ -116,7 +115,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
case ServiceConst.MSG_TYPE_REFRESH_DECREASE:
mRefreshRemainingTime -= ServiceConst.DECREASE_INTERVAL;
if ( mRefreshRemainingTime == 0 ) {
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
} else {
mHandler.sendEmptyMessageDelayed( msg.what, ServiceConst.DECREASE_INTERVAL );
}
@@ -239,8 +238,10 @@ public class MogoServiceProvider implements IMogoModuleProvider,
registerCenter.registerMogoMapListener( getModuleName(), this );
mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( context );
mIntentManager.registerIntentListener( MogoReceiver.ADAS_ACTION, this );
mIntentManager.registerIntentListener( MogoReceiver.ACTIION_ADAS, this );
mIntentManager.registerIntentListener( Intent.ACTION_POWER_CONNECTED, this );
mIntentManager.registerIntentListener( Intent.ACTION_POWER_DISCONNECTED, this );
mIntentManager.registerIntentListener( MogoReceiver.ACTION_NWD_ACC, this );
}
private void registerAIReceiver( Context context ) {
@@ -262,7 +263,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
}
}
filter.addAction( MogoReceiver.VOICE_ACTION );
filter.addAction( MogoReceiver.ADAS_ACTION );
filter.addAction( MogoReceiver.ACTIION_ADAS );
filter.addAction( MogoReceiver.ACTION_NWD_ACC );
// acc On
filter.addAction( Intent.ACTION_POWER_CONNECTED );
filter.addAction( Intent.ACTION_POWER_DISCONNECTED );
try {
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
Logger.i( TAG, "register voice receiver." );
@@ -297,7 +302,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
* @return
*/
private float getMapCameraFactWidth() {
return Utils.calculateLineDistance( mCameraNorthEastPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
try {
return Utils.calculateLineDistance( mCameraNorthEastPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
} catch ( Exception e ) {
return 1000f;
}
}
/**
@@ -306,7 +315,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
* @return
*/
private float getMapCameraFactHeight() {
return Utils.calculateLineDistance( mCameraSouthWestPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
try {
return Utils.calculateLineDistance( mCameraSouthWestPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
} catch ( Exception e ) {
return 1000f;
}
}
/**
@@ -368,7 +381,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
@Override
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
if ( mIsCameraInited ) {
mLastCustomRefreshCenterLocation = latLng;
mIsCameraInited = false;
@@ -385,14 +397,15 @@ public class MogoServiceProvider implements IMogoModuleProvider,
notifyRefreshData( latLng, getQueryRadius(), mCustomRefreshCallback );
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
} else if ( mLastZoomLevel - zoom < 0 ) {
mLastZoomLevel = zoom;
} else if ( mLastZoomLevel == zoom ) {
// 手动平移
if ( invokeRefreshWhenTranslationByUser( latLng ) ) {
notifyRefreshData( latLng, getQueryRadius(), mCustomRefreshCallback );
mLastCustomRefreshCenterLocation = latLng;
}
} else {
mLastZoomLevel = zoom;
}
}
@@ -435,11 +448,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
// 自动刷新触发
if ( mLastAutoRefreshLocation == null ) {
mLastAutoRefreshLocation = new MogoLatLng( location.getLatitude(), location.getLongitude() );
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
} else {
float distance = Utils.calculateLineDistance( mLastAutoRefreshLocation, new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
if ( distance > mAutoRefreshStrategy.getDistance() ) {
notifyRefreshData( mLastAutoRefreshLocation, 2_000, mAutoRefreshCallback );
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
}
}
}
@@ -452,6 +465,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
return;
}
Logger.d( TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新" );
Logger.i( TAG, "刷新半径 = %d, 点 = %s", radius, latLng );
mRefreshModel.refreshData( latLng, radius, callback );
}
@@ -467,7 +481,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
@Override
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
}
@Override
@@ -511,18 +524,37 @@ public class MogoServiceProvider implements IMogoModuleProvider,
}
@Override
public void onUpdateTraffic( MogoTraffic traffic ) {
if ( traffic != null ) {
Logger.i( TAG, "speed = %d, desc = %s", traffic.getSpeedLimit(), traffic.getDesc() );
// 发送当前限速到 adas
Intent intent = new Intent( "com.mogo.launcher.adas" );
intent.putExtra( "adas_speed_limit", traffic.getSpeedLimit() );
mContext.sendBroadcast( intent );
}
}
public IMogoMarkerClickListener getMarkerClickListener() {
return null;
}
@Override
public void onIntentReceived( String command, Intent intent ) {
if ( MogoReceiver.ADAS_ACTION.equals( command ) ) {
if ( MogoReceiver.ACTIION_ADAS.equals( command ) ) {
if ( intent == null ) {
return;
}
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
mStatusManager.setADASUIShow( getModuleName(), status == 1 );
} else if ( Intent.ACTION_POWER_CONNECTED.equals( command ) ) {
mStatusManager.setAccStatus( getModuleName(), true );
} else if ( Intent.ACTION_POWER_DISCONNECTED.equals( command ) ) {
mStatusManager.setAccStatus( getModuleName(), false );
} else if ( MogoReceiver.ACTION_NWD_ACC.equals( command ) ) {
int state = intent.getByteExtra( MogoReceiver.PARAM_ACC_STATUS, ( byte ) 0 );
mStatusManager.setAccStatus( getModuleName(), state == 1 );
}
}

View File

@@ -11,17 +11,20 @@ import java.util.List;
*/
public class RefreshBody {
public List< String > dataType = new ArrayList<>();
public int limit = 50;// 请求数量
public int radius = 2_000; // 地理围栏半径(米)
public LatLon location;
public List<String> dataType = new ArrayList<>(); // 要查询的类型
public int limit = 50; // 请求数量
public int radius = 2_000; // 地理围栏半径(米)
public LatLon location; // 坐标
public boolean onlyFocus; // 是否仅查询已关注的好友
public boolean onlySameCity; // 是否仅查询注册城市相同的同城用户
public static class LatLon {
private double lat;
private double lon;
public LatLon( double lat, double lon ) {
public LatLon(double lat, double lon) {
this.lat = lat;
this.lon = lon;
}

View File

@@ -7,14 +7,13 @@ import com.mogo.commons.data.BaseData;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.map.MogoLatLng;
import com.mogo.module.service.ServiceConst;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -36,14 +35,14 @@ public class RefreshModel {
private final Context mContext;
private RefreshApiService mRefreshApiService;
public RefreshModel( Context context ) {
public RefreshModel(Context context) {
this.mContext = context;
IMogoNetwork network = ( IMogoNetwork ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_NETWORK ).navigation( context );
this.mRefreshApiService = network.create( RefreshApiService.class, getNetHost() );
IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(context);
this.mRefreshApiService = network.create(RefreshApiService.class, getNetHost());
}
private String getNetHost() {
switch ( DebugConfig.getNetMode() ) {
switch (DebugConfig.getNetMode()) {
case DebugConfig.NET_MODE_DEV:
return HOST_DEV;
case DebugConfig.NET_MODE_QA:
@@ -53,34 +52,82 @@ 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();
public void refreshData(MogoLatLng latLng, int radius, final RefreshCallback callback) {
if (mRefreshApiService != null) {
final Map<String, Object> query = new ParamsProvider.Builder(mContext).build();
final RefreshBody refreshBody = new RefreshBody();
refreshBody.limit = 5;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lng);
refreshBody.radius = radius;
query.put( "data", GsonUtil.jsonFromObject( refreshBody ) );
mRefreshApiService.refreshData( query )
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) {
query.put("data", GsonUtil.jsonFromObject(refreshBody));
mRefreshApiService.refreshData(query)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
@Override
public void onSuccess( BaseData o ) {
super.onSuccess( o );
if ( callback != null ) {
public void onSuccess(BaseData o) {
super.onSuccess(o);
if (callback != null) {
callback.onSuccess();
}
}
@Override
public void onError( String message, int code ) {
super.onError( message, code );
if ( callback != null ) {
public void onError(String message, int code) {
super.onError(message, code);
if (callback != null) {
callback.onFail();
}
}
} );
});
}
}
/**
* 查询在线车辆
*
* @param latLng 经纬度
* @param radius 半径
* @param onlyFocus 是否仅查询已关注的好友
* @param onlySameCity 是否仅查询注册城市相同的同城用户
* @param callback
*/
public void queryOnLineCar(MogoLatLng latLng,
int radius,
boolean onlyFocus,
boolean onlySameCity,
final RefreshCallback callback) {
if (mRefreshApiService != null) {
final Map<String, Object> query = new ParamsProvider.Builder(mContext).build();
final RefreshBody refreshBody = new RefreshBody();
refreshBody.limit = 100;
refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lng);
refreshBody.radius = radius;
refreshBody.onlyFocus = onlyFocus;
refreshBody.onlySameCity = onlySameCity;
refreshBody.dataType.add(ServiceConst.CARD_TYPE_USER_DATA);
query.put("data", GsonUtil.jsonFromObject(refreshBody));
mRefreshApiService.refreshData(query)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
if (callback != null) {
callback.onSuccess();
}
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
if (callback != null) {
callback.onFail();
}
}
});
}
}
}

View File

@@ -30,10 +30,16 @@ public class MogoReceiver extends BroadcastReceiver {
/**
* ADAS
*/
public static final String ADAS_ACTION = "com.mogo.launcher.adas";
public static final String ACTIION_ADAS = "com.zhidao.autopilot.adas";
// ADAS 状态 0 - 关闭 1 - 打开
public static final String PARAM_ADAS_STATUS = "adas_drawer_status";
// 诺威达 acc 状态
public static final String ACTION_NWD_ACC = "com.nwd.action.ACTION_MCU_STATE_CHANGE";
// 诺威达 acc 状态
public static final String PARAM_ACC_STATUS = "extra_mcu_state";
private IMogoIntentManager mMogoIntentManager;
public MogoReceiver( Context context ) {

View File

@@ -5,7 +5,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion

View File

@@ -3,6 +3,7 @@ package com.mogo.module.share.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
@@ -69,7 +70,9 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
if (id == R.id.btn_block_layout) { //拥堵
sendShareReceiver("1");
} else if (id == R.id.oil_price_layout) {
//TODO
Intent intent = new Intent();
intent.setData(Uri.parse("reshthing://com.zhidao.fresh.things/shareOilPrice"));
mContext.startActivity(intent);
} else if (id == R.id.traffic_check_layout) { //交通检查
sendShareReceiver("2");
} else if (id == R.id.road_closure_layout) { //封路
@@ -80,7 +83,7 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
}
/**
* 发送广播
* 发送广播 1拥堵2交通检查3封路
*/
private void sendShareReceiver(String type) {
Logger.d("liyz", "LaucherShareDialog sendShareReceiver ---->");

View File

@@ -5,7 +5,7 @@ apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
@@ -53,6 +53,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.moduleservice
implementation rootProject.ext.dependencies.moduleshare
} else {
implementation project(":libraries:mogo-map")
implementation project(":foudations:mogo-utils")
@@ -60,6 +61,7 @@ dependencies {
implementation project(':services:mogo-service-api')
implementation project(':modules:mogo-module-common')
implementation project(':modules:mogo-module-service')
implementation project(':modules:mogo-module-share')
}
implementation 'com.shuyu:gsyVideoPlayer-armv7a:7.1.1'

View File

@@ -14,6 +14,13 @@
</intent-filter>
</receiver>
<receiver android:name=".receiver.PushReceiver">
<intent-filter>
<action android:name="com.zhidao.roadcondition.split" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -0,0 +1,14 @@
package com.mogo.module.tanlu.callback;
import com.mogo.commons.data.BaseData;
/**
* @author lixiaopeng
* @description 上报分享
* @since 2020-01-09
*/
public interface UploadShareCallback {
void onSuccess(BaseData data);
void onFail(String message, int code);
}

View File

@@ -12,7 +12,19 @@ public class TanluConstants {
public static final String NAVI_INFO = "navi_info";
public static final String MODEL_NAME = "CARD_TYPE_ROAD_CONDITION";
public static final String[] CMD_PLAY_ROAD_CONDITION = {"播放路况"};
public static final String UPLOAD_ROAD_CONDITION = "upload_road_condition";
//上报路况
public static final String UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
//xx堵不堵
public static final String SPECIFIEDROAD_SEARCH = "com.zhidao.pathfinder.specifiedroad.search";
//播放
public static final String PLAY_VIDEO = "com.zhidao.tanlu.play";
//分享封路
public static final String SHARE_ROAD_CLOSURE = "com.zhidao.share.road.closure";
//分享交通检查
public static final String SHARE_TRAFFIC_CHECK = "com.zhidao.share.traffic.check";
//我要分享
public static final String GO_TO_SHARE = "com.zhidao.share";
}

View File

@@ -25,7 +25,7 @@ import com.amap.api.services.geocoder.GeocodeSearch;
import com.amap.api.services.geocoder.RegeocodeResult;
import com.amap.api.services.poisearch.PoiResult;
import com.amap.api.services.poisearch.PoiSearch;
import com.google.gson.JsonObject;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
@@ -43,6 +43,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.search.geo.MogoPoiItem;
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
import com.mogo.map.search.poisearch.MogoPoiResult;
@@ -51,9 +52,11 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.share.ShareControl;
import com.mogo.module.tanlu.R;
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
import com.mogo.module.tanlu.callback.RoadLineCallback;
import com.mogo.module.tanlu.callback.UploadShareCallback;
import com.mogo.module.tanlu.callback.VoiceSearchCallback;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.tanlu.model.Center;
@@ -63,6 +66,7 @@ import com.mogo.module.tanlu.model.PathLineResult;
import com.mogo.module.tanlu.model.TanluModelData;
import com.mogo.module.tanlu.model.VoiceSearchResult;
import com.mogo.module.tanlu.model.event.MarkerInfo;
import com.mogo.module.tanlu.model.event.PushTypeInfo;
import com.mogo.module.tanlu.util.Utils;
import com.mogo.module.tanlu.video.FullMediaActivity;
import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer;
@@ -85,6 +89,7 @@ import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
@@ -108,7 +113,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
IMogoLocationListener,
View.OnClickListener {
private static final String TAG = "liyz";
private static final String TAG = "TanluCardViewFragment";
SimpleCoverVideoPlayer simpleCoverVideoPlayer;
AutoZoomInImageView autoZoomInImageView;
//map
@@ -130,8 +135,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
//media
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
private String mVideoUrl = "http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8";
private String mImageUrl = "https://oimagec4.ydstatic.com/image?id=-5397300958976572132&product=adpublish&w=520&h=347";
private String mVideoUrl = "";
private String mImageUrl = "";
private String mTitle = "";
private long mGenerateTime = 0;
private IMogoImageloader mogoImageloader;
@@ -152,6 +157,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
private List<MogoLatLng> passedByPoints;
private IMogoRegisterCenter mMogoRegisterCenter;
private String mKeywords;
private boolean isCurrentPage;
@Override
@@ -180,9 +186,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
autoZoomInImageView.setVisibility(View.GONE);
//视频配置 TODO 需要去掉
// gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG)
// .build(simpleCoverVideoPlayer);
//视频点击
simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -202,10 +206,9 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
//切换卡片操作
iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity());
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this);
//语音操作
//唤醒
mogoIntentManager = (IMogoIntentManager) ARouter.getInstance().build(MogoServicePaths.PATH_INTENT_MANAGER).navigation(getContext());
@@ -233,14 +236,15 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
Double longit; //经度
Double lat; //维度
if (mKeywords.equals("附近")) {
Logger.d(TAG, "附近 ----1---");
longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
} else {
Logger.d(TAG, "其他 ---1----");
longit = latLon.getLongitude();
lat = latLon.getLatitude();
}
Log.d(TAG, "geoSearch keywords = $keywords --cityCode = $cityCode " +
"--longitude= longit --latitude = $lat");
Log.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
getVoiceControlRoadData(mKeywords, lat, longit);
} else {
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
@@ -249,7 +253,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
poiSearch.setOnPoiSearchListener(new PoiSearch.OnPoiSearchListener() {
@Override
public void onPoiSearched(PoiResult p0, int p1) {
Logger.d(TAG, "setOnPoiSearchListener ------mKeywords =" + mKeywords + ">>p1 =" + p1);
Logger.d(TAG, "setOnPoiSearchListener--mKeywords =" + mKeywords + ">>p1 =" + p1);
if (p1 == 1000) {
if (p0.getPois() != null && p0.getPois().size() != 0) {
PoiItem poi = p0.getPois().get(0);
@@ -258,15 +262,16 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
Double longit; //经度
Double lat; //维度
if (mKeywords.equals("附近")) {
Logger.d(TAG, "附近 ----2---");
longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
} else {
Logger.d(TAG, "其他 --2----");
longit = latLon.getLongitude();
lat = latLon.getLatitude();
}
getVoiceControlRoadData(mKeywords, lat, longit);
Logger.d(TAG, "poi search keywords = $keywords --cityCode = $cityCode " +
"--longitude= $long --latitude = $lat");
Log.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
} else {
Logger.e(TAG, "poi == null");
}
@@ -293,16 +298,13 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
Logger.d(TAG, "onActivityCreated -------> ");
EventBus.getDefault().register(this);
initInterface();
initModelData();
handleRoadLineMessage();
initMap();
initStrings();
initListener();
//TODO切换探路卡片
// iMogoCardManager.switch2(TanluConstants.MODEL_NAME);
}
private void initModelData() {
@@ -318,12 +320,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
@Override
public void onInitNaviFailure() {
}
@Override
public void onInitNaviSuccess() {
}
@Override
@@ -332,9 +332,9 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
@Override
public void onStartNavi() { //开始导航
initModelData();
getNavigationLineData();
public void onStartNavi() { //开始导航,这期先不做
// initModelData();
// getNavigationLineData();
}
@Override
@@ -351,18 +351,28 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onoCalculateFailed() {
}
@Override
public void onUpdateTraffic( MogoTraffic traffic ) {
}
});
//监听marker点击
mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
@Override
public boolean onMarkerClicked(IMogoMarker marker) {
//点击marker以后确认他的位置然后点击下一个操作 TODO
//点击marker以后确认他的位置然后点击下一个操作
mEmptyLayout.setVisibility(View.GONE);
mRootLayout.setVisibility(View.VISIBLE);
Logger.d(TAG, "onMarkerClicked registerMogoMarkerClickListener = ");
MarkerExploreWay exploreWay = extractFromMarker(marker);
if (exploreWay == null) {
return false;
}
//TODO 自己打的点,需要重新组装新数据,清理老的
if (exploreWay.getFileType() == 0) { //图片
refreshPhotoData(exploreWay);
} else if (exploreWay.getFileType() == 1) { //视频
@@ -404,13 +414,16 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
* 注册listener监听
*/
private void initListener() {
//某某路堵不堵,某某地点堵不堵,附近堵不堵,播放路况 TODO
//唤醒
mogoIntentManager.registerIntentListener(MogoReceiver.ADAS_ACTION, mogoIntentListener);
//免唤醒
AIAssist.getInstance(getActivity()).registerUnWakeupCommandCallback(TanluConstants.UPLOAD_ROAD_CONDITION, mogoVoiceListener);
mogoIntentManager.registerIntentListener(TanluConstants.UPLOAD_ROAD_CONDITION, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SPECIFIEDROAD_SEARCH, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.PLAY_VIDEO, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_ROAD_CLOSURE, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_TRAFFIC_CHECK, mogoIntentListener);
mogoIntentManager.registerIntentListener(TanluConstants.GO_TO_SHARE, mogoIntentListener);
}
/**
* 唤醒语音
*/
@@ -419,10 +432,33 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onIntentReceived(String intentStr, Intent intent) {
String data = intent.getStringExtra("data");
Logger.e(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 ok
try {
JSONObject jsonObject = new JSONObject(data);
mKeywords = jsonObject.get("location").toString();
Logger.d(TAG, "mogoIntentListener specified mKeywords = " + mKeywords);
handleActionFoo(mKeywords);
} catch (Exception e) {
e.printStackTrace();
}
} else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 ok
sendShareReceiver("1");
Logger.d(TAG, "mogoIntentListener 上报路况 ----> ");
} else if (intentStr.equals(TanluConstants.PLAY_VIDEO)) { //播放视频 免唤醒
Logger.d(TAG, "mogoIntentListener 播放视频 ----> ");
//TODO
JsonObject jsonObject = new JsonObject();
mKeywords = jsonObject.get("location").toString();
handleActionFoo(mKeywords);
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路
sendShareReceiver("3");
Logger.d(TAG, "mogoIntentListener 分享封路 ----> ");
} else if (intentStr.equals(TanluConstants.SHARE_TRAFFIC_CHECK)) { //分享交通检查
sendShareReceiver("2");
Logger.d(TAG, "mogoIntentListener 分享交通检查 ----> ");
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享
ShareControl shareControl = new ShareControl();
shareControl.showDialog(getActivity());
Logger.d(TAG, "mogoIntentListener 我要分享 ----> ");
}
}
};
@@ -434,33 +470,44 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onCmdSelected(String cmd) {
Logger.e(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
if (cmd.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) {
//
Logger.d(TAG, "");
if (cmd.equals(TanluConstants.PLAY_VIDEO)) {
//TODO
}
}
@Override
public void onCmdAction(String speakText) {
Logger.d(TAG, "免唤醒 onCmdAction speakText =" + speakText);
}
@Override
public void onCmdCancel(String speakText) {
Logger.d(TAG, "免唤醒 onCmdCancel speakText =" + speakText);
}
@Override
public void onSpeakEnd(String speakText) {
Logger.e(TAG, "免唤醒 onSpeakEnd speakText =" + speakText);
}
@Override
public void onSpeakSelectTimeOut(String speakText) {
Logger.e(TAG, "免唤醒 onSpeakSelectTimeOut speakText =" + speakText);
}
};
/**
* 发送广播 1拥堵2交通检查3封路
*/
private void sendShareReceiver(String type) {
Logger.d(TAG, "TanluCardViewFragment sendShareReceiver ---->");
Intent intent = new Intent();
intent.setAction("com.zhidao.roadcondition.share");
intent.putExtra("type", type);
getContext().sendBroadcast(intent);
}
private MarkerExploreWay extractFromMarker(IMogoMarker marker) {
if (marker == null) {
@@ -476,30 +523,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
/**
* 处理路线数据信息msgType
*/
private void handleRoadLineMessage() {
// mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
// mMogoSocketManager.registerOnMessageListener(401005, new IMogoOnMessageListener<MarkerResponse>() {
// @Override
// public Class<MarkerResponse> target() {
// return MarkerResponse.class;
// }
//
// @Override
// public void onMsgReceived(MarkerResponse obj) {
// Logger.e(TAG, "handleRoadLineMessage onMsgReceived obj= " + obj);
// }
// });
//TODO 广播类型判断
// getNavigationLineData();
// getRoadLineData();
}
/**
* @param view
*/
@@ -530,23 +553,12 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
handleData(markerExploreWayList.get(currentPosition));
}
} else if (id == R.id.tv_main_empty) { //TODO上报路况,逻辑
} else if (id == R.id.tv_main_empty) { //上报路况
Logger.d(TAG, "tv_main_empty click -----> ");
sendShareReceiver("1");
}
}
/**
* 发送广播
*/
private void sendShareReceiver(String type) {
Logger.d("liyz", "LaucherShareDialog sendShareReceiver ---->");
Intent intent = new Intent();
intent.setAction("com.zhidao.roadcondition.share");
intent.putExtra("type", type);
getContext().sendBroadcast(intent);
}
/**
* 执行图片动画
*/
@@ -612,6 +624,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
//视频配置
mVideoUrl = videoUrl;
simpleCoverVideoPlayer.loadCoverImage(mImageUrl, getContext());
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
.build(simpleCoverVideoPlayer);
if (mImageUrl == null) {
@@ -670,6 +683,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
*/
@Override
public void onPerform() {
//免唤醒
AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.PLAY_VIDEO, TanluConstants.CMD_PLAY_ROAD_CONDITION, mogoVoiceListener);
isCurrentPage = true;
Logger.d(TAG, "tanlu卡片 onPerform 有效 ---->");
mMarkerManager = mMogoMapService.getMarkerManager(getActivity());
List<IMogoMarker> markers = mMarkerManager.getMarkers(TanluConstants.MODEL_NAME);
@@ -715,6 +732,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onDisable() {
Logger.d(TAG, "tanlu卡片 无效 ----->");
isCurrentPage = false;
AIAssist.getInstance(getActivity()).unregisterUnWakeupCommand(TanluConstants.PLAY_VIDEO);
}
@Override
@@ -754,11 +773,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onLocationChanged(MogoLocation location) {
// if (location.getErrCode() == 0) {
// Logger.d(TAG, "onLocationChanged 当前位置 -->" + location.getAddress());
// } else {
// Logger.d(TAG, "onLocationChanged 定位失败 -->" + location.getErrInfo());
// }
}
@Override
@@ -788,6 +802,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
TanluServiceHandler.getLocationClient().removeLocationListener(this);
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS );
}
/**
@@ -797,42 +812,75 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMarkerInfo(final MarkerInfo event) {
Logger.d(TAG, "onMarkerInfo ------>");
Logger.d(TAG, "onMarkerInfo ------------>");
if (event.type.equals("1")) { //上报路况
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_block_up);
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
} else if (event.type.equals("2")) { //交通检查
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_traffic_check);
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check);
} else if (event.type.equals("3")) { //封路
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_road_closure);
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_road_closure);
} else {
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
}
mogoImageloader.downloadImage(getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
@Override
public void onStart() {
Logger.d(TAG, "onMarkerInfo onStart ------>");
}
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
MogoMarkerOptions options = new MogoMarkerOptions()
.icon(mMarkerIcon)
.latitude(event.lat)
.owner(TanluConstants.MODEL_NAME)
.longitude(event.lon);
IMogoMarker marker = mMarkerManager.addMarker("share_tag", options); //随便传tag不可点击
//TODO 请求分享接口
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
if (markerExploreWay.getUserInfo() != null) {
@Override
public void onCompleted(Bitmap bitmap) {
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
MogoMarkerOptions options = new MogoMarkerOptions()
.icon(mMarkerIcon)
.latitude(event.lat)
.owner(TanluConstants.MODEL_NAME)
.longitude(event.lon);
IMogoMarker marker = mMarkerManager.addMarker("share_tag", options);
//TODO 请求分享接口
}
@Override
public void onFailure(Exception e) {
Logger.e(TAG, "onMarkerInfo onFailure -----e =" + e);
}
});
}
uploadShareInfo(markerExploreWay.getType(), "", markerExploreWay.getUserInfo().getUserName(),
markerExploreWay.getUserInfo().getUserHead());
}
/**
* 上报分享信息
*/
private void uploadShareInfo(String poiType, String poiImgUrl, String nickname, String headImgUrl) {
double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
String addressStr = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAddress();
mTanluModelData.addTrafficCheckInfo(poiType, poiImgUrl, nickname, headImgUrl, lat, lon, addressStr,
new UploadShareCallback() {
@Override
public void onSuccess(BaseData data) {
Logger.d(TAG, "uploadShareInfo onSuccess ----->");
AIAssist.getInstance(getContext()).speakTTSVoice(getString(R.string.tanlu_share_success), null);
}
@Override
public void onFail(String message, int code) {
Logger.d(TAG, "uploadShareInfo onFail ----->");
AIAssist.getInstance(getContext()).speakTTSVoice(getString(R.string.tanlu_share_failed), null);
}
});
}
/**
* push 类型1为导航数据2为通勤族 TODO
*
* @param event
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onPushInfo(final PushTypeInfo event) {
Logger.d(TAG, " onPushInfo event.type =" + event.type);
if (event.type.equals("1")) {
getNaviRoadLineInfo();
} else if (event.type.equals("2")) {
getRoadLineData();
}
}
/**
* 导航路线数据事件
*/
@@ -900,12 +948,13 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
/**
* 绘制线路
* 绘制线路 TODO
*/
private void drawMapLine(List<Center> pointList) {
int intervalNum = Utils.getIntervalValue(pointList.size());
Logger.d(TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}");
int listSize = pointList.size();
passedByPoints = new ArrayList<>();
//沿途最多15个点
for (int i = 0; i < listSize; i += intervalNum) {
@@ -925,32 +974,44 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void getVoiceControlRoadData(String keywords, final double lat, final double lon) {
String adCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAdCode();
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
Logger.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode=" + cityCode + ">>>adCode =" + adCode);
//移动到具体位置
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMApUIController.moveToCenter(latLng);
Logger.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode= " + cityCode + " >>>adCode = " + adCode);
mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() {
@Override
public void onSuccess(VoiceSearchResult o) {
String discription = o.getDescription();
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
if (o.getInformations() != null && o.getInformations().size() > 0) {
speakSuccessVoice(o.getInformations(), discription == null ? "" : discription);
String discription = o.getResult().getDescription();
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
if (o.getResult().getInformations() != null && o.getResult().getInformations().size() > 0) {
//切换到探路卡片
if (!isCurrentPage) {
//切换探路卡片
iMogoCardManager.switch2(TanluConstants.MODEL_NAME);
}
List<Information> informationList = o.getInformations();
//移动
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMApUIController.moveToCenter(latLng);
speakSuccessVoice(o.getResult().getInformations(), discription == null ? "" : discription);
List<Information> informationList = o.getResult().getInformations();
//清除探路之前的数据
mMarkerManager.removeMarkers(TanluConstants.MODEL_NAME);
mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, false);
//打点 TODO
//打点
ArrayList<MogoMarkerOptions> optionList = new ArrayList<>();
for (int i = 0; i < informationList.size(); i++) {
//根据type确定添加的图片
if (informationList.get(i).type == 0) { //图片
multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
} else if (informationList.get(i).type == 1) { //视频
String trafficType = informationList.get(i).trafficInfoType;
if (trafficType.equals("traffic_jam")) { //拥堵
multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
} else if (trafficType.equals("car_checking")) { //查车
multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check);
} else if (trafficType.equals("0")) {
multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check);
} else if (trafficType.equals("traffic_control")) {
multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_road_closure);
}
MogoMarkerOptions options = new MogoMarkerOptions()
@@ -961,11 +1022,9 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
optionList.add(options);
}
Logger.d(TAG, "getVoiceControlRoadData optionList.size() = " + optionList.size());
mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true);
//直接使用当前数据list作为切换的数据源
} else {
if (!TextUtils.isEmpty(discription)) {
AIAssist.getInstance(getContext()).speakTTSVoice(discription, null);
@@ -973,7 +1032,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
AIAssist.getInstance(getContext()).speakTTSVoice("未找到其他车主分享的路况信息", null);
}
}
}
@Override
@@ -1026,7 +1084,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}
}
private void initStrings() {
voiceGetInfoMationTts =
getContext().getResources().getString(R.string.voice_get_informations_tts);
@@ -1052,5 +1109,3 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
}

View File

@@ -23,6 +23,7 @@ public class Information extends BaseData implements Parcelable {
public int distance;
public String nickName;
public String headImgUrl;
public String trafficInfoType;
@Override
@@ -42,6 +43,7 @@ public class Information extends BaseData implements Parcelable {
dest.writeInt(this.distance);
dest.writeString(this.nickName);
dest.writeString(this.headImgUrl);
dest.writeString(this.trafficInfoType);
}
public Information() {
@@ -58,6 +60,7 @@ public class Information extends BaseData implements Parcelable {
this.distance = in.readInt();
this.nickName = in.readString();
this.headImgUrl = in.readString();
this.trafficInfoType = in.readString();
}
public static final Creator<Information> CREATOR = new Creator<Information>() {

View File

@@ -5,9 +5,13 @@ class Sns {
var sns: List<CarsLive>
var localUserId: String
var localNickName: String
var localHeadImgUrl: String
constructor(sns: List<CarsLive>, localUserId: String) {
constructor(sns: List<CarsLive>, localUserId: String, localNickName: String, localHeadImgUrl: String) {
this.sns = sns
this.localUserId = localUserId
this.localNickName = localNickName
this.localHeadImgUrl = localHeadImgUrl
}
}

View File

@@ -5,12 +5,14 @@ import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.google.gson.Gson;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
import com.mogo.module.tanlu.callback.RoadLineCallback;
import com.mogo.module.tanlu.callback.UploadShareCallback;
import com.mogo.module.tanlu.callback.VoiceSearchCallback;
import com.mogo.module.tanlu.constant.HttpConst;
import com.mogo.module.tanlu.constant.TanluConstants;
@@ -66,7 +68,7 @@ public class TanluModelData {
Logger.d(TAG, "getVoiceControlRoadData -------> " + getSn());
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
.append("sn", "ZD821C1933L00974") //getSn
.append("sn", Utils.getSn())
.append("data", searchInformationStr)
.append("getSnData", locCarsWithRadiusStr)
.build();
@@ -103,7 +105,7 @@ public class TanluModelData {
public void getRoadLineData(final RoadLineCallback callback) {
Logger.d(TAG, "getRoadLineData -------> =" + Utils.getSn());
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
.append("sn", "ZD821C1933L00974")
.append("sn", Utils.getSn())
.build();
mTanluApiService.getRoadLineInfo(params)
@@ -134,12 +136,12 @@ public class TanluModelData {
}
/**
* 导航路径,监听消息自己请求路线数据
* 导航路径,监听消息自己请求路线数据 ZD821C1933L00974
*/
public void getNaviRoadLineInfo(final RoadLineCallback callback) {
Logger.d(TAG, "getNaviRoadLineInfo -------> =" + Utils.getSn());
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
.append("sn", "ZD821C1933L00974")
.append("sn", Utils.getSn())
.build();
mTanluApiService.getNaviRoadLineInfo(params)
@@ -177,6 +179,9 @@ public class TanluModelData {
Gson gson = new Gson();
NaviLatLng coordinates = new NaviLatLng(getNaviInfo(lon, lat).fromStart(), getNaviInfo(lon, lat).toEnd());
Logger.d(TAG, "getNavigationLineData -------> " + getSn());
if (coordinates == null) {
return;
}
List<Double> list = new ArrayList<>();
list.add(lon);
@@ -189,7 +194,7 @@ public class TanluModelData {
.append("getSnData", locCarsWithRadiusStr)
.build();
mTanluApiService.requestInformationAlongTheWay(getSn(), params)
mTanluApiService.requestInformationAlongTheWay(Utils.getSn(), params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<InformationAndLiveCarResult>(RequestOptions.create(mContext)) {
@@ -223,14 +228,61 @@ public class TanluModelData {
Log.d(TAG, " getNaviInfo naviInfo =" + naviInfo);
NaviLatLngInfo naviLatLngInfo = new Gson().fromJson(naviInfo, NaviLatLngInfo.class);
Log.d(TAG, "getLocNaviInfo lat = $lat -----> lon = $lon");
if (lon == 0.0 || lat == 0.0) {
return naviLatLngInfo;
if (naviLatLngInfo != null) {
if (lon == 0.0 || lat == 0.0) {
return naviLatLngInfo;
} else {
naviLatLngInfo.setFromPoiLatitude(lat + "");
naviLatLngInfo.setFromPoiLongitude(lon + "");
SharedPrefsMgr.getInstance(mContext).putString(TanluConstants.NAVI_INFO, new Gson().toJson(naviLatLngInfo));
return naviLatLngInfo;
}
} else {
naviLatLngInfo.setFromPoiLatitude(lat + "");
naviLatLngInfo.setFromPoiLongitude(lon + "");
SharedPrefsMgr.getInstance(mContext).putString(TanluConstants.NAVI_INFO, new Gson().toJson(naviLatLngInfo));
return naviLatLngInfo;
return null;
}
}
/**
* 上报交通检查和封路 TODO
*/
public void addTrafficCheckInfo(String poiType, String poiImgUrl, String nickname, String headImgUrl,
double lat, double lon, String address, final UploadShareCallback callback) {
Gson gson = new Gson();
UploadShareRoadInfo uploadShareRoadInfo = new UploadShareRoadInfo(poiType, poiImgUrl, nickname, headImgUrl, new Center(lat, lon), address);
String uploadShareStr = gson.toJson(uploadShareRoadInfo);
Logger.d(TAG, "addTrafficCheckInfo sn= " + getSn() + ">> uploadShareStr =" + uploadShareStr);
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
.append("sn", Utils.getSn())
.append("data", uploadShareStr)
.build();
mTanluApiService.searchOnLineInformation(params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
callback.onSuccess(o);
Logger.d(TAG, "addTrafficCheckInfo onSuccess ------>");
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
callback.onFail(message, code);
Logger.e(TAG, "addTrafficCheckInfo onError message= " + message + ">>code =" + code);
}
@Override
public void onError(Throwable e) {
super.onError(e);
Logger.d(TAG, "addTrafficCheckInfo onError ------> e= " + e.getMessage());
}
});
}
}

View File

@@ -0,0 +1,26 @@
package com.mogo.module.tanlu.model;
/**
* @author lixiaopeng
* @description 分享上报信息参数
* @since 2020-01-16
*/
public class UploadShareRoadInfo {
public String poiType;
public String poiImgUrl;
public String nickname;
public String headImgUrl;
private Center location;
private String address;
public UploadShareRoadInfo(String poiType, String poiImgUrl, String nickname,
String headImgUrl, Center location, String address) {
this.poiType = poiType;
this.poiImgUrl = poiImgUrl;
this.nickname = nickname;
this.headImgUrl = headImgUrl;
this.location = location;
this.address = address;
}
}

View File

@@ -9,31 +9,45 @@ import java.util.List;
* @since 2020-01-08
*/
public class VoiceSearchResult extends BaseData {
private List<Information> informations;
private String description;
private Sns snResult;
public List<Information> getInformations() {
return informations;
private Result result;
public Result getResult() {
return result;
}
public void setInformations(List<Information> informations) {
this.informations = informations;
public void setResult(Result result) {
this.result = result;
}
public String getDescription() {
return description;
public static class Result {
private List<Information> informations;
private String description;
private Sns snResult;
public List<Information> getInformations() {
return informations;
}
public void setInformations(List<Information> informations) {
this.informations = informations;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Sns getSnResult() {
return snResult;
}
public void setSnResult(Sns snResult) {
this.snResult = snResult;
}
}
public void setDescription(String description) {
this.description = description;
}
public Sns getSnResult() {
return snResult;
}
public void setSnResult(Sns snResult) {
this.snResult = snResult;
}
}

View File

@@ -0,0 +1,17 @@
package com.mogo.module.tanlu.model.event;
import java.io.Serializable;
/**
* @author lixiaopeng
* @description push区分类别
* @since 2020-01-08
*/
public class PushTypeInfo implements Serializable {
public String type;
public PushTypeInfo(String type) {
this.type = type;
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.module.tanlu.net;
import com.mogo.commons.data.BaseData;
import com.mogo.module.tanlu.model.InformationAndLiveCarResult;
import com.mogo.module.tanlu.model.PathLineResult;
import com.mogo.module.tanlu.model.VoiceSearchResult;
@@ -20,7 +21,7 @@ import retrofit2.http.Query;
public interface TanluApiService {
/**
* 探路沿途数据
* 探路沿途数据,只是为了通知server下发push
*/
@FormUrlEncoded
@POST("deva/car/path/no/getOnTheWayDataAndSn/v1")
@@ -47,5 +48,11 @@ public interface TanluApiService {
@POST("deva/car/search/no/searchInforationByAddress/v1")
Observable<VoiceSearchResult> searchOnLineInformation(@FieldMap Map<String, Object> infoBody);
/**
* 上报交通检查,封路
*/
@FormUrlEncoded
@POST("deva/car/poi/no/addNovelty/v1")
Observable<BaseData> uploadCheckTrafficInfor(@FieldMap Map<String, Object> infoBody);
}

View File

@@ -0,0 +1,22 @@
package com.mogo.module.tanlu.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.mogo.module.tanlu.model.event.PushTypeInfo
import com.mogo.module.tanlu.model.event.VoiceRoadInfo
import org.greenrobot.eventbus.EventBus
/**
* 导航和通勤族 push的action
*/
class PushReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == "com.zhidao.roadcondition.split"){
var type = intent.getStringExtra("type")
Log.d("PushReceiver", "type = $type")
EventBus.getDefault().post(PushTypeInfo(type))
}
}
}

View File

@@ -56,12 +56,11 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer {
}
}
// fun loadCoverImage(url: String, mContext: Context) {
// Glide.with(mContext.applicationContext)
// .load(url)
// .error(R.color.color_303447)
// .into(coverImage)
// }
fun loadCoverImage(url: String, mContext: Context) {
Glide.with(mContext.applicationContext)
.load(url)
.into(coverImage)
}
override fun updateStartImage() {
when (mCurrentState) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="@color/color_DADAE2"/>
<corners android:radius="@dimen/dp_10" />
<stroke android:color="@color/color_59FFFFFF"
android:width="@dimen/dp_2"/>
<!-- <solid android:color="@color/color_DADAE2"/>-->
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#323346"
android:startColor="#6E7091" />
<corners android:radius="@dimen/dp_20" />
</shape>

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_660"
android:layout_height="@dimen/dp_660"
android:background="@drawable/shape_bg_222533_10px">
android:background="@drawable/tanlu_gradual_change_bg">
<!--正常显示数据-->
<RelativeLayout
@@ -21,15 +21,15 @@
android:id="@+id/tv_information_media_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_32"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_58"
android:layout_marginRight="@dimen/dp_24"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/main_empty_location"
android:textColor="@color/color_3"
android:textSize="@dimen/dp_36"
android:textColor="@color/white"
android:textSize="@dimen/dp_34"
android:textStyle="bold" />
<TextView
@@ -37,11 +37,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_information_media_content"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_4"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_1"
android:layout_marginBottom="@dimen/dp_10"
android:text="666KM"
android:textColor="@color/color_666666"
android:textColor="@color/color_99FFFFFF"
android:textSize="@dimen/dp_26"
android:textStyle="bold" />
@@ -52,9 +52,9 @@
android:layout_below="@+id/tv_information_media_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_32"
android:layout_marginRight="@dimen/dp_24"
android:text="2019-10-10"
android:textColor="@color/color_999999"
android:textColor="@color/color_99FFFFFF"
android:textSize="@dimen/dp_26" />
</RelativeLayout>
@@ -64,8 +64,8 @@
android:layout_width="@dimen/dp_596"
android:layout_height="@dimen/dp_355"
android:layout_below="@+id/layout_top_view"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginRight="@dimen/dp_32"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_24"
android:background="@drawable/shape_bg_222533_9px">
<com.mogo.module.tanlu.video.SimpleCoverVideoPlayer
@@ -85,14 +85,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/media_layout"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginRight="@dimen/dp_32"
android:layout_marginBottom="@dimen/dp_42">
android:layout_marginTop="@dimen/dp_30"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_24">
<TextView
android:id="@+id/tv_previous_res"
android:layout_width="@dimen/dp_284"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_90"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/dp_40"
@@ -101,12 +100,12 @@
android:gravity="center_vertical"
android:drawablePadding="@dimen/dp_40"
android:text="@string/tanlu_previous"
android:textColor="@color/color_545362"
android:textSize="@dimen/dp_26" />
android:textColor="@color/white"
android:textSize="@dimen/dp_28" />
<TextView
android:id="@+id/tv_next_res"
android:layout_width="@dimen/dp_284"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_90"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
@@ -117,8 +116,8 @@
android:drawableRight="@drawable/media_next"
android:gravity="center_vertical"
android:text="@string/tanlu_next"
android:textColor="@color/color_545362"
android:textSize="@dimen/dp_26" />
android:textColor="@color/white"
android:textSize="@dimen/dp_28" />
</RelativeLayout>
</RelativeLayout>
@@ -126,7 +125,7 @@
<!--空数据显示-->
<RelativeLayout
android:id="@+id/layout_empty_data_show"
android:layout_width="match_parent"
android:layout_width="@dimen/dp_660"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
@@ -134,9 +133,9 @@
<ImageView
android:id="@+id/iv_main_empty"
android:layout_width="@dimen/dp_420"
android:layout_height="@dimen/dp_420"
android:layout_marginTop="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_122"
android:src="@mipmap/main_view_empty_bg" />
<TextView
@@ -147,7 +146,7 @@
android:layout_marginTop="@dimen/dp_70"
android:text="@string/main_empty_content"
android:textColor="@color/white"
android:textSize="@dimen/dp_32" />
android:textSize="@dimen/dp_34" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -34,7 +34,9 @@
<color name="color_DADAE2">#DADAE2</color>
<color name="color_545362">#545362</color>
<color name="color_191C25">#99191C25</color>
<color name="color_666666">#666666</color>
<color name="color_666666">#99666666</color>
<color name="color_999999">#999999</color>
<color name="color_99FFFFFF">#99FFFFFF</color>
<color name="color_59FFFFFF">#59FFFFFF</color>
</resources>

View File

@@ -6,7 +6,7 @@
<string name="start_already_agreement">已同意</string>
<string name="splash_agreement_bt">探路共享计划 >> </string>
<string name="splash_agreement_dialog_title">探路APP用户服务协议</string>
<string name="main_empty_content"><Data><![CDATA[<font color="#69718B">未找到其他用户分享的路况,<br/>您可以试试</font><font color="#F7B500">上报路况</font>]]></Data></string>
<string name="main_empty_content"><Data><![CDATA[<font color="#8F95AA">未找到其他用户分享的路况,<br/>您可以试试</font><font color="#51B0FF">上报路况</font>]]></Data></string>
<string name="main_empty_location">未知区域</string>
<string name="custom_send_road_condition">上报路况</string>
<string name="text_searching_information">正在更新情报数据</string>
@@ -17,7 +17,8 @@
<string name="start_mogo_share">共享计划</string>
<string name="tanlu_previous">上一条</string>
<string name="tanlu_next">下一条</string>
<string name="tanlu_share_success">分享成功</string>
<string name="tanlu_share_failed">分享失败</string>
<array name="searching_voice_string_array">
<item >正在为您搜索路况</item>