eagle 小地图导航
This commit is contained in:
@@ -34,9 +34,12 @@ ext {
|
||||
androidxjunit : "androidx.test.ext:junit:1.1.2",
|
||||
androidxespressocore : "androidx.test.espresso:espresso-core:3.3.0",
|
||||
// 地图
|
||||
amapnavi3dmap : "com.amap.api:navi-3dmap:8.0.1_3dmap8.0.1",
|
||||
amapsearch : "com.amap.api:search:7.9.0",
|
||||
amaplocation : "com.amap.api:location:5.5.0",
|
||||
// amapnavi3dmap : "com.amap.api:navi-3dmap:8.0.1_3dmap8.0.1",
|
||||
// amapsearch : "com.amap.api:search:7.9.0",
|
||||
// amaplocation : "com.amap.api:location:5.5.0",
|
||||
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
|
||||
amapsearch : "com.amap.api:search:7.1.0",
|
||||
amaplocation : "com.amap.api:location:5.3.1",
|
||||
// json 转换
|
||||
gson : "com.google.code.gson:gson:2.8.4",
|
||||
// 内存泄漏检测
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.smp;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -87,8 +88,8 @@ public class SmallMapDirectionView
|
||||
View smpView = LayoutInflater.from(context).inflate(R.layout.module_small_map_view, this);
|
||||
|
||||
mAMapNaviView = (TextureMapView)smpView.findViewById(R.id.aMapNaviView);
|
||||
rlSmallMapBorder = findViewById(R.id.rlSmallMapBorder);
|
||||
rlSmallMapBorder.addView(mAMapNaviView);
|
||||
// rlSmallMapBorder = findViewById(R.id.rlSmallMapBorder);
|
||||
// rlSmallMapBorder.addView(mAMapNaviView);
|
||||
|
||||
initAMapView();
|
||||
|
||||
@@ -280,4 +281,27 @@ public class SmallMapDirectionView
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreateView(Bundle savedInstanceState) {
|
||||
if(mAMapNaviView != null){
|
||||
mAMapNaviView.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
if(mAMapNaviView != null){
|
||||
mAMapNaviView.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
if(mAMapNaviView != null){
|
||||
mAMapNaviView.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if(mAMapNaviView != null){
|
||||
mAMapNaviView.onDestroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.smp.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,6 +33,7 @@ public class SmallMapFragment extends Fragment {
|
||||
if (mRootView == null) {
|
||||
mRootView = inflater.inflate(R.layout.module_small_map_fragment, container, false);
|
||||
mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView);
|
||||
mSmallMapDirectionView.onCreateView(savedInstanceState);
|
||||
} else {
|
||||
ViewGroup viewGroup = (ViewGroup) mRootView.getParent();
|
||||
if (viewGroup != null) {
|
||||
@@ -55,4 +55,23 @@ public class SmallMapFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mSmallMapDirectionView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mSmallMapDirectionView.onPause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
mSmallMapDirectionView.onDestroy();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user