导航功能开始
This commit is contained in:
@@ -267,4 +267,11 @@ public class Constant {
|
||||
FILE_PATH = null;//银行卡图片途径
|
||||
LEVEL = 0;//用户等级
|
||||
}
|
||||
|
||||
// 导航方式
|
||||
enum NAV_TYPE {
|
||||
CAR, RIDE, WALK
|
||||
}
|
||||
|
||||
public static NAV_TYPE currentNaviType; // 当前的导航方式
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.bean.NotificationBean;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.TalentLocationUtils;
|
||||
import com.tencent.map.navi.TencentNavi;
|
||||
import com.tencent.navi.surport.utils.DeviceUtils;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.umeng.message.IUmengRegisterCallback;
|
||||
import com.umeng.message.MsgConstant;
|
||||
@@ -59,6 +61,13 @@ public class UserApplication extends Application {
|
||||
TalentLocationUtils.getInstance(this).startLocation(this);
|
||||
//创建一个线程池
|
||||
fixedThreadPool = Executors.newSingleThreadExecutor(); // 使用单线程线程池
|
||||
// 初始化腾讯导航
|
||||
TencentNavi.Config config = new TencentNavi.Config();
|
||||
// 记录设备标识,反馈导航问题时请提供该设备标识以及发生问题的时间
|
||||
String deviceID = DeviceUtils.getImei(getApplicationContext());
|
||||
config.setDeviceId(deviceID);
|
||||
// 或者设置开发者自己的的设备号config.setDeviceId(xxxxxxxx);
|
||||
TencentNavi.init(this, config);
|
||||
}
|
||||
|
||||
public static UserApplication getUserApplication() {
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.TimestampUtil;
|
||||
import com.navinfo.outdoor.util.ToastUtils;
|
||||
import com.tencent.lbssearch.httpresponse.Poi;
|
||||
import com.tencent.map.navi.car.TencentCarNaviManager;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
|
||||
@@ -65,6 +66,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
private PoiEntity poiEntity;
|
||||
private File logFile;
|
||||
private StringBuilder gatherGetBuilder;
|
||||
private TextView tvStartNav;
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
@@ -144,6 +146,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
TextView tvTime = findViewById(R.id.tv_time);
|
||||
TextView tvDistance = findViewById(R.id.tv_distance);
|
||||
TextView tvDescribe = findViewById(R.id.tv_describe);
|
||||
tvStartNav = findViewById(R.id.tv_gather_start_navi);
|
||||
Button btnDelete = findViewById(R.id.btn_delete);
|
||||
btnDelete.setOnClickListener(this);
|
||||
btnCancelGet = findViewById(R.id.btn_cancel_get);//取消领取
|
||||
@@ -185,6 +188,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
assert poiEntity != null;
|
||||
int taskStatus = poiEntity.getTaskStatus();
|
||||
initViewByTaskStatus(taskStatus);
|
||||
// 用户点击开始导航
|
||||
tvStartNav.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (Constant.currentNaviType == null) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
public class NaviUtils {
|
||||
private static NaviUtils instance;
|
||||
public static NaviUtils getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new NaviUtils();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user