Commit 1c571eed by 罗翻

android_v1.7

parent c44e43ba
......@@ -26,30 +26,30 @@ public class Constants {
/**
* uat环境配置.
*/
public static final String ENVIROMENT = "uat";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "http://47.95.223.6:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
public final static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail";
public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
public final static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult";
public final static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop";
public static final boolean IS_DEBUG = true;
// public static final String ENVIROMENT = "uat";
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static final String BASE_URL = "http://47.95.223.6:3112";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
// public final static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail";
// public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop";
// public static final boolean IS_DEBUG = true;
/**
* 正式环境.
*/
// public static final String ENVIROMENT = "release";
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static final String BASE_URL = "https://mobile.kf.ai";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
// public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
// public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
// public static final boolean IS_DEBUG = false;
public static final String ENVIROMENT = "release";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "https://mobile.kf.ai";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
public final static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
public final static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
public static final boolean IS_DEBUG = false;
/**
* 演示环境
......
......@@ -10,16 +10,14 @@ import com.amap.api.location.AMapLocationListener;
/**
* Created by luofan on 2017/11/21.
* Created by luofan
* on 2017/11/21.
*/
public class LocationUtils {
private static AMapLocationClient mlocationClient;
public static AMapLocationClientOption mLocationOption = null;
public static AMapLocation sLocation = null;
private static boolean flag = true;
// private static Disposable mDisposable;
private static long time;
private static MyLocationListener mListener;
private static Handler mHandler;
......@@ -29,26 +27,28 @@ public class LocationUtils {
* @Description: 初始化地图导航,在Application onCreate中调用,只需调用一次
*/
public static void init(Context context) {
// 声明mLocationOption对象
mlocationClient = new AMapLocationClient(context);
// 初始化定位参数
mLocationOption = new AMapLocationClientOption();
// 设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
// 设置定位间隔,单位毫秒,默认为2000ms
// mLocationOption.setInterval(2000);
mLocationOption.setOnceLocation(true);
mLocationOption.setOnceLocationLatest(true);
mLocationOption.setHttpTimeOut(20000);
// 设置定位参数、、
mlocationClient.setLocationOption(mLocationOption);
AMapLocationClientOption mOption = new AMapLocationClientOption();
mOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);//可选,设置定位模式,可选的模式有高精度、仅设备、仅网络。默认为高精度模式
mOption.setGpsFirst(false);//可选,设置是否gps优先,只在高精度模式下有效。默认关闭
mOption.setHttpTimeOut(30000);//可选,设置网络请求超时时间。默认为30秒。在仅设备模式下无效
mOption.setInterval(2000);//可选,设置定位间隔。默认为2秒
mOption.setNeedAddress(true);//可选,设置是否返回逆地理地址信息。默认是true
mOption.setOnceLocation(false);//可选,设置是否单次定位。默认是false
mOption.setOnceLocationLatest(false);//可选,设置是否等待wifi刷新,默认为false.如果设置为true,会自动变为单次定位,持续定位时不要使用
AMapLocationClientOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTP);//可选, 设置网络请求的协议。可选HTTP或者HTTPS。默认为HTTP
mOption.setSensorEnable(false);//可选,设置是否使用传感器。默认是false
mOption.setWifiScan(true); //可选,设置是否开启wifi扫描。默认为true,如果设置为false会同时停止主动刷新,停止以后完全依赖于系统刷新,定位位置可能存在误差
mOption.setLocationCacheEnable(true); //可选,设置是否使用缓存定位,默认为true
mlocationClient.setLocationOption(mOption);
}
/**
* @Description: 定位结果回调
*/
public interface MyLocationListener {
public void result(AMapLocation location);
void result(AMapLocation location);
}
/**
......@@ -81,29 +81,23 @@ public class LocationUtils {
@Override
public void run() {
if (flag) {
mListener.result(null);
mListener.result(sLocation);
flag = false;
mlocationClient.stopLocation();
}
}
}, 8000);
time = System.currentTimeMillis();
mlocationClient.setLocationListener(new AMapLocationListener() {
@Override
public void onLocationChanged(AMapLocation location) {
mHandler = null;
if (location != null && flag) {
flag = false;
//定位成功,取消定位
mlocationClient.stopLocation();
sLocation = location;
mListener.result(location);
} else if ((location == null && flag)) {
flag = false;
mlocationClient.stopLocation();
mListener.result(location);
mHandler = null;
}
}
});
......@@ -118,6 +112,7 @@ public class LocationUtils {
public static void destroy() {
mHandler = null;
mlocationClient.onDestroy();
mListener = null;
}
/**
......
......@@ -59,6 +59,7 @@ public class IdentityCertificationActivity extends BaseActivity<CertificaitonPre
@Override
public void initView() {
mBind.tvTitle.setText(getString(R.string.certification_title));
mBind.titleBack.setOnClickListener(v -> finish());
mBind.ivFront.setOnClickListener(v -> {
if (mFrontFlag) {
imgMax(mFrontBitmap);
......@@ -89,7 +90,7 @@ public class IdentityCertificationActivity extends BaseActivity<CertificaitonPre
mBind.rlNext.setClickable(false);
mBind.ivSideDelete.setVisibility(View.GONE);
});
mBind.rlNext.setOnClickListener(v->mPresenter.commitePhoto());
mBind.rlNext.setOnClickListener(v -> mPresenter.commitePhoto());
mBind.ivNext.setAlpha(0.5f);
mBind.rlNext.setClickable(false);
......@@ -201,8 +202,8 @@ public class IdentityCertificationActivity extends BaseActivity<CertificaitonPre
@Override
public List<File> getFile() {
ArrayList<File> list = new ArrayList<>();
list.add(compressImage(mFrontBitmap,"front",mActivity));
list.add(compressImage(mSideBitmap,"back",mActivity));
list.add(compressImage(mFrontBitmap, "front", mActivity));
list.add(compressImage(mSideBitmap, "back", mActivity));
return list;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment