Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<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>
|
||||
</project>
|
||||
@@ -3,12 +3,15 @@ package com.mogo.utils.network;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Protocol;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
import okio.Buffer;
|
||||
|
||||
|
||||
final class RequestLogInterceptor implements Interceptor {
|
||||
@@ -33,9 +36,26 @@ final class RequestLogInterceptor implements Interceptor {
|
||||
logMsg.append(request.url()).append("\r\n");
|
||||
if(hasRequestBody){
|
||||
logMsg.append("Content-Type: ").append(requestBody.contentType()).append(", ");
|
||||
logMsg.append("Content-Length: ").append(requestBody.contentLength());
|
||||
logMsg.append("\r\nContent-Length: ").append(requestBody.contentLength());
|
||||
try {
|
||||
String body = null;
|
||||
Charset UTF8 = Charset.forName("UTF-8");
|
||||
Buffer buffer = new Buffer();
|
||||
requestBody.writeTo(buffer);
|
||||
Charset charset = UTF8;
|
||||
MediaType contentType = requestBody.contentType();
|
||||
if (contentType != null) {
|
||||
charset = contentType.charset(UTF8);
|
||||
}
|
||||
if (charset != null) {
|
||||
body = buffer.readString(charset);
|
||||
}
|
||||
logMsg.append("\r\nContent-body: ").append(body);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
logMsg.append(" <-- end http request");
|
||||
logMsg.append("\r\n<-- end http request");
|
||||
|
||||
if(NetConfig.instance().isLoggable()){
|
||||
Logger.d(TAG, logMsg.toString());
|
||||
|
||||
@@ -231,7 +231,7 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
}
|
||||
getMapUIController().changeZoom(10);
|
||||
getMapUIController().changeZoom(12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,22 +239,25 @@ public class MarkerServiceHandler {
|
||||
*/
|
||||
public static IMogoMarker drawMapMarker(MarkerShowEntity markerShowEntity) {
|
||||
Logger.e(TAG, "绘制Marker====markerTag:" + markerShowEntity);
|
||||
try {
|
||||
if (markerShowEntity.getMarkerLocation() != null) {
|
||||
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
|
||||
|
||||
if (markerShowEntity.getMarkerLocation() != null) {
|
||||
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerShowEntity.getMarkerType())
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerShowEntity.getMarkerType())
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
return marker;
|
||||
} else {
|
||||
Logger.e(TAG, "Location 必须进行初始化!!!!!");
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
return marker;
|
||||
} else {
|
||||
Logger.e(TAG, "Location 必须进行初始化!!!!!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,4 +47,9 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA";
|
||||
|
||||
/**
|
||||
* 卡片 新鲜事
|
||||
*/
|
||||
public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY";
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
|
||||
protected Context mContext;
|
||||
|
||||
protected MogoImageView ivUserHead;
|
||||
protected ImageView ivIconForeground;
|
||||
protected ImageView ivIcon;
|
||||
protected ImageView ivCar;
|
||||
|
||||
public MapMarkerBaseView(Context context) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerInfoView";
|
||||
|
||||
private TextView tvMarkerContent;
|
||||
private ConstraintLayout llMarkerContent;
|
||||
private ConstraintLayout clMarkerContent;
|
||||
private ImageView ivReverseTriangle;
|
||||
|
||||
public MapMarkerInfoView(Context context) {
|
||||
@@ -51,8 +51,8 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
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);
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
clMarkerContent = findViewById(R.id.clMarkerContent);
|
||||
ivReverseTriangle = findViewById(R.id.ivReverseTriangle);
|
||||
ivCar = findViewById(R.id.ivCar);
|
||||
tvMarkerContent = findViewById(R.id.tvMarkerContent);
|
||||
@@ -64,51 +64,66 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
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);
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility(View.VISIBLE);
|
||||
ivIcon.setVisibility(View.GONE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
|
||||
clMarkerContent.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);
|
||||
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
}
|
||||
}
|
||||
loadImageWithMarker(markerShowEntity);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_ROAD_CONDITION:
|
||||
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
case ServiceConst.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerShareMusic) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch (((MarkerShareMusic) bindObj).getShareType()) {
|
||||
case 1:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
break;
|
||||
case 2:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_book);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
|
||||
break;
|
||||
case 3:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_news);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ivIconForeground.setVisibility(View.VISIBLE);
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
}
|
||||
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
|
||||
tvMarkerContent.setText(markerShowEntity.getTextContent());
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
|
||||
LayoutInflater.from(context).inflate(R.layout.view_map_marker, this);
|
||||
ivUserHead = findViewById(R.id.ivUserHead);
|
||||
ivIconForeground = findViewById(R.id.ivIconForeground);
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
ivCar = findViewById(R.id.ivCar);
|
||||
ivBg = findViewById(R.id.ivBg);
|
||||
}
|
||||
@@ -58,12 +58,10 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
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);
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility(View.VISIBLE);
|
||||
ivIcon.setVisibility(View.GONE);
|
||||
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
@@ -73,32 +71,48 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
}
|
||||
}
|
||||
loadImageWithMarker(markerShowEntity);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_ROAD_CONDITION:
|
||||
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
case ServiceConst.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility(View.GONE);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bindObj instanceof MarkerShareMusic) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch (((MarkerShareMusic) bindObj).getShareType()) {
|
||||
case 1:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
break;
|
||||
case 2:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_book);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
|
||||
break;
|
||||
case 3:
|
||||
ivUserHead.setImageResource(R.drawable.icon_map_marker_news);
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ivIconForeground.setVisibility(View.VISIBLE);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
|
||||
break;
|
||||
}
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 905 B |
@@ -22,7 +22,7 @@
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_85"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bg_map_marker_green"
|
||||
android:src="@drawable/bg_map_marker_blue"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -42,12 +42,12 @@
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIconForeground"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:src="@drawable/icon_map_marker_music_play"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:src="@drawable/icon_map_marker_road_block_up"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivReverseTriangle" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/llMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/clMarkerContent"
|
||||
android:layout_width="@dimen/dp_366"
|
||||
android:layout_height="@dimen/dp_74"
|
||||
android:background="@drawable/bg_map_marker_green_info"
|
||||
android:background="@drawable/bg_map_marker_blue_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" >
|
||||
@@ -39,30 +39,34 @@
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIconForeground"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
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"
|
||||
android:layout_marginLeft="@dimen/dp_14"
|
||||
android:src="@drawable/icon_map_marker_road_block_up"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="8"
|
||||
android:singleLine="true"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivUserHead"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
tools:text="诗一样的女子" />
|
||||
app:layout_constraintStart_toEndOf="@+id/ivIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivIcon"
|
||||
tools:text="诗一样的女子诗诗一样的女子诗诗一样的女子诗" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout >
|
||||
|
||||
|
||||
@@ -70,9 +74,9 @@
|
||||
android:id="@+id/ivReverseTriangle"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:src="@drawable/bg_shape_reverse_triangle_green"
|
||||
app:layout_constraintEnd_toEndOf="@+id/llMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/llMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/llMarkerContent" />
|
||||
android:src="@drawable/bg_shape_reverse_triangle_blue"
|
||||
app:layout_constraintEnd_toEndOf="@+id/clMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/clMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clMarkerContent" />
|
||||
|
||||
</merge >
|
||||
Reference in New Issue
Block a user