Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
2
.idea/misc.xml
generated
@@ -5,7 +5,7 @@
|
||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||
public class MarkerLocation implements Serializable {
|
||||
|
||||
private String address;
|
||||
private Double angle;
|
||||
private float angle;
|
||||
private Double lat;
|
||||
private Double lon;
|
||||
|
||||
@@ -20,11 +20,11 @@ public class MarkerLocation implements Serializable {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Double getAngle() {
|
||||
public float getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(Double angle) {
|
||||
public void setAngle(float angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
@@ -73,6 +75,19 @@ public class MarkerShowEntity {
|
||||
this.markerLocation = markerLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MarkerShowEntity that = (MarkerShowEntity) o;
|
||||
return bindObj.equals(that.bindObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bindObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerShowEntity{" +
|
||||
|
||||
@@ -2,23 +2,25 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerUserInfo implements Serializable {
|
||||
|
||||
|
||||
|
||||
private int age;
|
||||
|
||||
|
||||
private String gender;
|
||||
|
||||
|
||||
private String sn;
|
||||
|
||||
|
||||
private String userHead;
|
||||
|
||||
|
||||
private Long userId;
|
||||
|
||||
|
||||
private String userName;
|
||||
|
||||
public String getAge() {
|
||||
@@ -75,6 +77,17 @@ public class MarkerUserInfo implements Serializable {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public int getGenderValue() {
|
||||
if (!TextUtils.isEmpty(gender)) {
|
||||
if ("男".equals(gender)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
@@ -1013,6 +1013,8 @@
|
||||
<dimen name="dp_997">498.5000px</dimen>
|
||||
<dimen name="dp_998">499.0000px</dimen>
|
||||
<dimen name="dp_999">499.5000px</dimen>
|
||||
<dimen name="dp_1300">650.0000px</dimen>
|
||||
|
||||
<dimen name="sp_6">3.0000px</dimen>
|
||||
<dimen name="sp_7">3.5000px</dimen>
|
||||
<dimen name="sp_8">4.0000px</dimen>
|
||||
|
||||
@@ -1016,6 +1016,7 @@
|
||||
<dimen name="dp_997">997px</dimen>
|
||||
<dimen name="dp_998">998px</dimen>
|
||||
<dimen name="dp_999">999px</dimen>
|
||||
<dimen name="dp_1300">1300px</dimen>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1016,6 +1016,7 @@
|
||||
<dimen name="dp_997">997px</dimen>
|
||||
<dimen name="dp_998">998px</dimen>
|
||||
<dimen name="dp_999">999px</dimen>
|
||||
<dimen name="dp_1300">1300px</dimen>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShareMusic;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.service.marker.MapMarkerView;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
@@ -29,7 +28,6 @@ import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -122,22 +120,34 @@ public class MarkerServiceHandler {
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
Logger.e(TAG, "点击了大而全中的Marker");
|
||||
Logger.e(TAG, "onMarkerClicked 点击了大而全中的Marker:" + marker);
|
||||
if (lastMarker != null) {
|
||||
// 设置未选中状态
|
||||
MarkerShowEntity markerShowEntity = (MarkerShowEntity) marker.getObject();
|
||||
markerShowEntity.setChecked(false);
|
||||
drawMapMarker(markerShowEntity);
|
||||
// 判断点击的是否是同一个
|
||||
if (marker.equals(lastMarker)) {
|
||||
Logger.w(TAG, "onMarkerClicked 与上一次点击的Marker一样,不做处理:" + marker);
|
||||
return false;
|
||||
}
|
||||
|
||||
lastMarker.destroy();
|
||||
// 将上次选中 Marker 设置为未选中状态
|
||||
MarkerShowEntity lastMarkerShowEntity = (MarkerShowEntity) lastMarker.getObject();
|
||||
|
||||
Logger.e(TAG, "onMarkerClicked 点击了大而全中的Marker lastMarkerShowEntity:" + lastMarkerShowEntity);
|
||||
|
||||
lastMarkerShowEntity.setChecked(false);
|
||||
drawMapMarker(lastMarkerShowEntity);
|
||||
|
||||
lastMarker.remove();
|
||||
}
|
||||
|
||||
// 绘制选中的状态
|
||||
// 将当前的Marker设置为选中
|
||||
MarkerShowEntity markerShowEntity = (MarkerShowEntity) marker.getObject();
|
||||
Logger.e(TAG, "onMarkerClicked 点击了大而全中的Marker markerShowEntity:" + markerShowEntity);
|
||||
|
||||
markerShowEntity.setChecked(true);
|
||||
|
||||
lastMarker = drawMapMarker(markerShowEntity);
|
||||
|
||||
marker.destroy();
|
||||
marker.remove();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -147,6 +157,7 @@ public class MarkerServiceHandler {
|
||||
* 绘制Marker
|
||||
*/
|
||||
public static void drawMapMarker(MarkerResponse response) {
|
||||
lastMarker = null;
|
||||
getMarkerManager().removeMarkers();
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
@@ -245,19 +256,19 @@ public class MarkerServiceHandler {
|
||||
|
||||
//TODO 这里是用来测试的
|
||||
public static void drawMapMarker() {
|
||||
Logger.e(TAG, "=====绘制Marker====");
|
||||
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mapMarkerView)
|
||||
.owner("CARD_TYPE_USER_DATA")
|
||||
.latitude(39.574525d + new Random().nextDouble())
|
||||
.longitude(116.21733d + new Random().nextDouble());
|
||||
IMogoMarker marker = getMarkerManager().addMarker("CARD_TYPE_USER_DATA", options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject("我是Marker上面绑定的数据");
|
||||
|
||||
getMapUIController().changeZoom(8);
|
||||
// Logger.e(TAG, "=====绘制Marker====");
|
||||
//
|
||||
// MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
//
|
||||
// MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
// .icon(mapMarkerView)
|
||||
// .owner("CARD_TYPE_USER_DATA")
|
||||
// .latitude(39.574525d + new Random().nextDouble())
|
||||
// .longitude(116.21733d + new Random().nextDouble());
|
||||
// IMogoMarker marker = getMarkerManager().addMarker("CARD_TYPE_USER_DATA", options);
|
||||
// marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
// marker.setObject("我是Marker上面绑定的数据");
|
||||
//
|
||||
// getMapUIController().changeZoom(8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,13 +23,9 @@ public class MapMarkerAdapter {
|
||||
*/
|
||||
public static View getMarkerView(Context context, MarkerShowEntity markerShowEntity) {
|
||||
if (markerShowEntity.isChecked()) {
|
||||
MapMarkerInfoView mapMarkerInfoView = new MapMarkerInfoView(context);
|
||||
mapMarkerInfoView.updateView(markerShowEntity);
|
||||
return mapMarkerInfoView;
|
||||
return new MapMarkerInfoView(context, markerShowEntity);
|
||||
} else {
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(context);
|
||||
mapMarkerView.updateView(markerShowEntity);
|
||||
return mapMarkerView;
|
||||
return new MapMarkerView(context, markerShowEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-1310:55
|
||||
* desc : 地图上抽离的Marker的共性
|
||||
* version: 1.0
|
||||
*/
|
||||
public abstract class MapMarkerBaseView extends ConstraintLayout {
|
||||
private String TAG = "MapMarkerBaseView";
|
||||
|
||||
protected Context mContext;
|
||||
|
||||
protected MogoImageView ivUserHead;
|
||||
protected ImageView ivIconForeground;
|
||||
protected ImageView ivCar;
|
||||
|
||||
public MapMarkerBaseView(Context context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerBaseView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mContext = context;
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerBaseView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mContext = context;
|
||||
initView(context);
|
||||
}
|
||||
|
||||
protected abstract void initView(Context context);
|
||||
|
||||
public abstract void updateView(MarkerShowEntity markerShowEntity);
|
||||
|
||||
protected void loadImageWithMarker(MarkerShowEntity markerShowEntity) {
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getIconUrl())) {
|
||||
MarkerServiceHandler
|
||||
.getImageloader()
|
||||
.displayImage(markerShowEntity.getIconUrl(),
|
||||
ivUserHead,
|
||||
WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
// 刷新图标
|
||||
Logger.d(TAG, "loaded.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -11,14 +11,10 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -27,75 +23,80 @@ import com.mogo.utils.logger.Logger;
|
||||
* desc : 地图Marker图标带文本信息
|
||||
* version: 1.0
|
||||
*/
|
||||
public class MapMarkerInfoView extends ConstraintLayout {
|
||||
public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerInfoView";
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private MogoImageView ivUserHead;
|
||||
private ImageView ivIconForeground;
|
||||
private TextView tvMarkerContent;
|
||||
private ConstraintLayout llMarkerContent;
|
||||
private ImageView ivReverseTriangle;
|
||||
|
||||
public MapMarkerInfoView(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
mContext = context;
|
||||
public MapMarkerInfoView(Context context, MarkerShowEntity markerShowEntity) {
|
||||
super(context);
|
||||
updateView(markerShowEntity);
|
||||
}
|
||||
|
||||
protected void initView(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_map_marker_info, this);
|
||||
ivUserHead = findViewById(R.id.ivUserHead);
|
||||
ivIconForeground = findViewById(R.id.ivIconForeground);
|
||||
llMarkerContent = findViewById(R.id.llMarkerContent);
|
||||
ivReverseTriangle = findViewById(R.id.ivReverseTriangle);
|
||||
ivCar = findViewById(R.id.ivCar);
|
||||
tvMarkerContent = findViewById(R.id.tvMarkerContent);
|
||||
}
|
||||
|
||||
public void updateView(MarkerShowEntity markerShowEntity) {
|
||||
try {
|
||||
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
|
||||
switch (markerShowEntity.getMarkerType()) {
|
||||
case ServiceConst
|
||||
.CARD_TYPE_CARS_CHATTING:
|
||||
ivIconForeground.setVisibility(View.GONE);
|
||||
case ServiceConst
|
||||
.CARD_TYPE_USER_DATA:
|
||||
ivIconForeground.setVisibility(View.GONE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
|
||||
} else {
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_ROAD_CONDITION:
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
ivIconForeground.setVisibility(View.VISIBLE);
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
break;
|
||||
}
|
||||
tvMarkerContent.setText(markerShowEntity.getTextContent());
|
||||
MarkerServiceHandler
|
||||
.getImageloader()
|
||||
.displayImage(markerShowEntity.getIconUrl(), ivUserHead, WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
|
||||
tvMarkerContent.setText(markerShowEntity.getTextContent());
|
||||
}
|
||||
loadImageWithMarker(markerShowEntity);
|
||||
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
// 刷新图标
|
||||
Logger.d(TAG, "loaded.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -26,75 +20,75 @@ import com.mogo.utils.logger.Logger;
|
||||
* desc : 地图Marker图标
|
||||
* version: 1.0
|
||||
*/
|
||||
public class MapMarkerView extends ConstraintLayout {
|
||||
public class MapMarkerView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerView";
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private MogoImageView ivUserHead;
|
||||
private ImageView ivIconForeground;
|
||||
private ImageView ivBg;
|
||||
|
||||
public MapMarkerView(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MapMarkerView(Context context, MarkerShowEntity markerShowEntity) {
|
||||
super(context);
|
||||
updateView(markerShowEntity);
|
||||
}
|
||||
|
||||
protected void initView(Context context) {
|
||||
setBackground(null);
|
||||
|
||||
private void initView(Context context) {
|
||||
mContext = context;
|
||||
LayoutInflater.from(context).inflate(R.layout.view_map_marker, this);
|
||||
ivUserHead = findViewById(R.id.ivUserHead);
|
||||
ivIconForeground = findViewById(R.id.ivIconForeground);
|
||||
ivCar = findViewById(R.id.ivCar);
|
||||
ivBg = findViewById(R.id.ivBg);
|
||||
}
|
||||
|
||||
public void updateView(MarkerShowEntity markerShowEntity) {
|
||||
try {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
|
||||
switch (markerShowEntity.getMarkerType()) {
|
||||
case ServiceConst
|
||||
.CARD_TYPE_CARS_CHATTING:
|
||||
ivIconForeground.setVisibility(View.GONE);
|
||||
case ServiceConst
|
||||
.CARD_TYPE_USER_DATA:
|
||||
ivIconForeground.setVisibility(View.GONE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
|
||||
} else {
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_ROAD_CONDITION:
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
ivIconForeground.setVisibility(View.VISIBLE);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
break;
|
||||
}
|
||||
MarkerServiceHandler
|
||||
.getImageloader()
|
||||
.displayImage(markerShowEntity.getIconUrl(), ivUserHead, WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
|
||||
|
||||
}
|
||||
loadImageWithMarker(markerShowEntity);
|
||||
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
// 刷新图标
|
||||
Logger.d(TAG, "loaded.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#3834FF"
|
||||
android:startColor="#5985FF" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_6"
|
||||
android:left="@dimen/dp_6"
|
||||
android:right="@dimen/dp_40"
|
||||
android:top="@dimen/dp_6" />
|
||||
|
||||
</shape >
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#FB801E"
|
||||
android:startColor="#FFB977" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_6"
|
||||
android:left="@dimen/dp_6"
|
||||
android:right="@dimen/dp_40"
|
||||
android:top="@dimen/dp_6" />
|
||||
|
||||
</shape >
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/shape_id" >
|
||||
<!-- 倒三角 -->
|
||||
<rotate
|
||||
android:fromDegrees="45"
|
||||
android:pivotX="135%"
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#FB801E" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
|
||||
|
||||
</layer-list >
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/shape_id" >
|
||||
<!-- 倒三角 -->
|
||||
<rotate
|
||||
android:fromDegrees="45"
|
||||
android:pivotX="135%"
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#3834FF" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
</layer-list >
|
||||
@@ -8,7 +8,7 @@
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#C843FF" />
|
||||
<solid android:color="#6828E8" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:rotation="270"
|
||||
android:src="@drawable/icon_map_marker_car_blue"
|
||||
android:translationY="-5dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivBg"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:rotation="270"
|
||||
android:src="@drawable/icon_map_marker_car_blue"
|
||||
android:translationY="-5dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivReverseTriangle"
|
||||
@@ -44,13 +43,13 @@
|
||||
android:id="@+id/ivIconForeground"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:src="@drawable/icon_map_marker_music_play"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead" />
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMarkerContent"
|
||||
@@ -58,13 +57,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:text="诗一样的女子"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivUserHead"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead" />
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
tools:text="诗一样的女子" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout >
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,10 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.share.R;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -21,7 +20,10 @@ import com.mogo.utils.logger.Logger;
|
||||
*/
|
||||
public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
private TextView txtOk;
|
||||
private ImageView mBackImage;
|
||||
private RelativeLayout mBlockLayout;
|
||||
private RelativeLayout mOilPriceLayout;
|
||||
private RelativeLayout mTrafficCheckLayout;
|
||||
private RelativeLayout mRoadClosureLayout;
|
||||
private Context mContext;
|
||||
|
||||
|
||||
@@ -44,22 +46,38 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
private void initView() {
|
||||
setContentView(R.layout.launcher_dialog_share);
|
||||
txtOk = findViewById(R.id.btn_share_title);
|
||||
mBackImage = findViewById(R.id.btn_back);
|
||||
mBlockLayout = findViewById(R.id.btn_block_layout);
|
||||
mOilPriceLayout = findViewById(R.id.oil_price_layout);
|
||||
mTrafficCheckLayout = findViewById(R.id.traffic_check_layout);
|
||||
mRoadClosureLayout = findViewById(R.id.road_closure_layout);
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
mBackImage.setOnClickListener(this);
|
||||
|
||||
private void initListener() {
|
||||
mBlockLayout.setOnClickListener(this);
|
||||
mOilPriceLayout.setOnClickListener(this);
|
||||
mTrafficCheckLayout.setOnClickListener(this);
|
||||
mRoadClosureLayout.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.btn_back) {
|
||||
if (id == R.id.btn_block_layout) {
|
||||
sendShareReceiver();
|
||||
dismiss();
|
||||
} else if (id == R.id.oil_price_layout) {
|
||||
//TODO
|
||||
|
||||
} else if (id == R.id.traffic_check_layout) {
|
||||
//TODO
|
||||
|
||||
} else if (id == R.id.road_closure_layout) {
|
||||
//TODO
|
||||
|
||||
}
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +88,7 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.zhidao.roadcondition.share");
|
||||
intent.putExtra("type", "1");
|
||||
intent.putExtra("keyWords", "xx");
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
<solid android:color="@color/color_545362"/>
|
||||
</shape>
|
||||
@@ -1,41 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/color_545362"
|
||||
android:layout_width="1980dp"
|
||||
android:layout_height="1080dp">
|
||||
android:layout_width="@dimen/dp_1300"
|
||||
android:layout_height="@dimen/dp_600"
|
||||
android:background="@drawable/shape_bg_222533_20px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_share_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="1300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="我要分享"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:gravity="center"
|
||||
android:text="一 我要分享 一"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_30" />
|
||||
|
||||
android:textSize="@dimen/dp_40" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_below="@+id/btn_share_title"
|
||||
android:id="@+id/tu_block_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/btn_share_title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_64">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_65"
|
||||
android:src="@drawable/main_video_play_btn_normal" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/btn_block_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_150">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/block_up_iv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:src="@drawable/share_block_up" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/block_up_tv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/block_up_iv"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:gravity="center"
|
||||
android:text="拥堵"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/oil_price_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_120"
|
||||
android:layout_toRightOf="@+id/btn_block_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/oil_price_iv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:src="@drawable/share_oil_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/oil_price_tv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/oil_price_iv"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:gravity="center"
|
||||
android:text="油价"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/traffic_check_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_120"
|
||||
android:layout_toRightOf="@+id/oil_price_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/traffic_check_iv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:src="@drawable/share_traffic_check" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/traffic_check_tv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/traffic_check_iv"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:gravity="center"
|
||||
android:text="交通检查"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/road_closure_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_120"
|
||||
android:layout_toRightOf="@+id/traffic_check_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/road_closure_iv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:src="@drawable/share_road_closure" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_closure_tv"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/road_closure_iv"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:gravity="center"
|
||||
android:text="封路"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/btn_block_layout"
|
||||
android:layout_marginTop="@dimen/dp_55"
|
||||
android:gravity="center"
|
||||
android:text="可以对小智说:分享拥堵、分享油价、分享查车、分享封路"
|
||||
android:textColor="@color/white_40"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -7,6 +7,7 @@
|
||||
<color name="red_tips">#FF1B1B</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="white_50">#80FFFFFF</color>
|
||||
<color name="white_40">#99FFFFFF</color>
|
||||
<color name="color_F8F8F8">#F8F8F8</color>
|
||||
<color name="color_3">#333333</color>
|
||||
<color name="color_DADAE2">#DADAE2</color>
|
||||
@@ -14,5 +15,6 @@
|
||||
<color name="color_191C25">#99191C25</color>
|
||||
<color name="color_666666">#666666</color>
|
||||
<color name="color_999999">#999999</color>
|
||||
<color name="color_000000">#000000</color>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -229,7 +229,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
*/
|
||||
private void handleRoadLineMessage() {
|
||||
mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
|
||||
mMogoSocketManager.registerOnMessageListener(1, new IMogoOnMessageListener<MarkerResponse>() {
|
||||
mMogoSocketManager.registerOnMessageListener(401005, new IMogoOnMessageListener<MarkerResponse>() {
|
||||
@Override
|
||||
public Class<MarkerResponse> target() {
|
||||
return MarkerResponse.class;
|
||||
@@ -237,14 +237,13 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MarkerResponse obj) {
|
||||
Logger.e(TAG, "onMsgReceived obj= " + obj);
|
||||
Logger.e(TAG, "handleRoadLineMessage onMsgReceived obj= " + obj);
|
||||
getRoadLineData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
|
||||