Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0

This commit is contained in:
wangcongtao
2020-02-17 18:27:03 +08:00
24 changed files with 85 additions and 42 deletions

View File

@@ -29,6 +29,9 @@ public class WindowUtils {
return ( int ) ( dpValue * scale + 0.5f );
}
/**
* 根据手机的分辨率从 px(像素) 的单位 转成为 dp
*/

View File

@@ -33,9 +33,12 @@ dependencies {
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogomapapi
implementation rootProject.ext.dependencies.mogocommons
} else {
implementation project(':foudations:mogo-utils')
implementation project(':libraries:mogo-map-api')
implementation project(':foudations:mogo-commons')
}
}

View File

@@ -141,7 +141,7 @@ public class NaviClient implements IMogoNavi {
return;
}
// 关闭巡航
mAMapNavi.stopAimlessMode();
//mAMapNavi.stopAimlessMode();
mIsRealNavi = isRealNavi;
mAMapNavi.startNavi( isRealNavi ? NaviType.GPS : NaviType.EMULATOR );
}

View File

@@ -5,6 +5,7 @@ import android.graphics.Bitmap;
import android.graphics.Color;
import com.amap.api.navi.model.RouteOverlayOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.impl.amap.R;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.WindowUtils;
@@ -40,7 +41,7 @@ public class MapStyleUtils {
public static RouteOverlayOptions getRouteOverlayOptions() {
RouteOverlayOptions options = new RouteOverlayOptions();
// 设置导航线路的宽度
options.setLineWidth( 10 );
options.setLineWidth( AbsMogoApplication.getApp().getResources().getDimension(R.dimen.path_width) );
// 设置交通状况情况良好下的纹理位图
options.setSmoothTraffic( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) );
// 设置路线的图标

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="path_width">10px</dimen>
</resources>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="path_width">18px</dimen>
</resources>

View File

@@ -63,6 +63,7 @@ public class MarkerNoveltyInfo {
private String title;
private String gasPrices;
private boolean displayNavigation;
private boolean desplayHost;
private String styleType;
public String getContent() {
@@ -137,6 +138,14 @@ public class MarkerNoveltyInfo {
this.gasPrices = gasPrices;
}
public boolean isDesplayHost() {
return desplayHost;
}
public void setDesplayHost(boolean desplayHost) {
this.desplayHost = desplayHost;
}
@Override
public String toString() {
return "ContentData{" +
@@ -148,6 +157,7 @@ public class MarkerNoveltyInfo {
", title='" + title + '\'' +
", gasPrices='" + gasPrices + '\'' +
", displayNavigation=" + displayNavigation +
", desplayHost=" + desplayHost +
", styleType='" + styleType + '\'' +
'}';
}

View File

@@ -3,6 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_790"
android:layout_height="@dimen/dp_440"
app:cardPreventCornerOverlap="false"
android:orientation="vertical"
app:cardBackgroundColor="#3F4057"
app:cardCornerRadius="@dimen/dp_20"

View File

@@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.navi">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application>
<activity android:name=".ui.NaviActivity"></activity>
<provider

View File

@@ -1,5 +1,6 @@
package com.mogo.module.navi.manager
import android.app.SearchManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
@@ -11,8 +12,8 @@ import com.mogo.module.navi.constants.SearchServiceHolder
import com.mogo.module.navi.ui.search.ChoosePathFragment
import com.mogo.utils.logger.Logger
import androidx.core.content.ContextCompat.startActivity
import com.mogo.module.navi.ui.search.SearchFragment
import com.mogo.service.fragmentmanager.FragmentDescriptor
/**
*@author zyz
@@ -51,6 +52,16 @@ object NaviManager {
showHome()
SearchServiceHolder.fragmentManager
.clearAll()
val searchFragment = SearchFragment()
SearchServiceHolder.fragmentManager
.push(
FragmentDescriptor.Builder().fragment(searchFragment)
.tag(MogoModulePaths.PATH_FRAGMENT_SEARCH)
.notifyMainModule(true)
.build()
)
}
}
}

View File

@@ -51,7 +51,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
.icon(createWaterMask)
.latitude(datums[index].point?.lat ?: 0.0)
.owner("CategorySearchFragment")
.anchor(0.5f, 1f)
// .anchor(0.5f, 1f)
.longitude(datums[index].point?.lng ?: 0.0)
arrayList.add(options)
}
@@ -134,7 +134,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
BitmapUtils.createWaterMask(
context, decodeResource, (index+1).toString(), R.color.white, 18
)
return decodeResource
return createWaterMask
}
override fun onActivityCreated(savedInstanceState: Bundle?) {

View File

@@ -17,6 +17,10 @@ public class BitmapUtils {
paint.setColor(ContextCompat.getColor(context, textColor));
paint.setTextSize(dp2px(context, textSize));
paint.setDither(true); // 获取跟清晰的图像采样
paint.setFilterBitmap(true);// 过滤一些
int width = src.getWidth();
int height = src.getHeight();
//创建一个bitmap
@@ -27,20 +31,19 @@ public class BitmapUtils {
////将该图片作为画布
//Canvas canvas = new Canvas(newb);
////在画布 00坐标上开始绘制原始图片
//canvas.drawBitmap(src, 0, 0, null);
Bitmap.Config config = src.getConfig();
if (config == null) {
config = android.graphics.Bitmap.Config.ARGB_8888;
}
// 绘制文字
Bitmap ret = src.copy(src.getConfig(), true);
Bitmap ret = src.copy(config, true);
//Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Canvas canvas = new Canvas(ret);
canvas.drawText(text, (width-bounds.width())/2.0F, (float) ( bounds.height()*1.8), paint);
// 保存
//canvas.save();
//canvas.restore();
// 存储
return ret;
}

View File

@@ -3,6 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_790"
android:layout_height="@dimen/dp_440"
app:cardPreventCornerOverlap="false"
android:orientation="vertical"
app:cardBackgroundColor="#3F4057"
app:cardCornerRadius="@dimen/dp_20"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,18 +1,14 @@
package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Point;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.animation.Interpolator;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.animation.Animation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.amap.api.maps.model.animation.ScaleAnimation;
import com.mogo.map.MogoLatLng;
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
@@ -33,7 +29,6 @@ import com.mogo.module.service.Utils;
import com.mogo.module.service.datamanager.MogoDataHandler;
import com.mogo.service.cardmanager.IMogoCardChangedListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
@@ -225,27 +220,29 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
if (alpha == 1) {
try {
Point point = MarkerServiceHandler.getMapUIController().getLocationPointInScreen(mogoMarker.getPosition());
point.y -= WindowUtils.dip2px(mContext, 100f);
MogoLatLng targetMogoLatLng = MarkerServiceHandler.getMapUIController().getLocationMogoLatLngInScreen(point);
LatLng target = ObjectUtils.fromMogo2(targetMogoLatLng);
//使用TranslateAnimation,填写一个需要移动的目标点
Animation animation = new TranslateAnimation(target);
animation.setInterpolator(new Interpolator() {
@Override
public float getInterpolation(float input) {
if (input <= 0.5) {
return (float) (0.5f - 2.0 * (0.5 - input) * (0.5 - input));
} else {
return (float) (0.5f - Math.sqrt((double) ((input - 0.5f) * (1.5f - input))));
}
}
});
//整个移动所需要的时间
animation.setDuration(1000);
//设置动画
// 使用TranslateAnimation,填写一个需要移动的目标点
ScaleAnimation animationScale = new ScaleAnimation(0.5f, 1.2f, 0.5f, 1.2f);
animationScale.setDuration(500);
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
// 设置动画
if (mogoMarker instanceof AMapMarkerWrapper) {
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animation);
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animationScale);
((AMapMarkerWrapper) mogoMarker).getMarker().startAnimation();
}
} catch (Exception e) {
Logger.e(TAG, e, "error.");
}
}else{
try {
// 使用TranslateAnimation,填写一个需要移动的目标点
ScaleAnimation animationScale = new ScaleAnimation(1.2f, 1f, 1.2f, 1f);
animationScale.setDuration(500);
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
// 设置动画
if (mogoMarker instanceof AMapMarkerWrapper) {
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animationScale);
((AMapMarkerWrapper) mogoMarker).getMarker().startAnimation();
}
} catch (Exception e) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -16,8 +16,8 @@
<ImageView
android:id="@+id/ivBg"
android:layout_width="@dimen/dp_88"
android:layout_height="@dimen/dp_105"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_107"
android:layout_gravity="center"
android:src="@drawable/bg_map_marker_blue"
app:layout_constraintEnd_toEndOf="parent"