1. 增加延时检测空接口访问

2. opt TopViewAnimHelper
This commit is contained in:
tongchenfei
2020-12-24 15:45:24 +08:00
parent bf05411d3d
commit ceaa1cd33a
12 changed files with 483 additions and 170 deletions

View File

@@ -0,0 +1,64 @@
package com.mogo.module.common.utils;
import android.content.Context;
import com.mogo.commons.network.Utils;
import com.mogo.httpdnshelper.sdk.HttpDnsHelper;
import com.mogo.httpdnshelper.sdk.IHttpDnsConfig;
import com.mogo.httpdnshelper.sdk.bean.HttpDnsSimpleLocation;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import org.jetbrains.annotations.NotNull;
/**
* MogoHttpDnsHelper包装类
*
* @author tongchenfei
*/
public class MogoHttpDnsUtil {
private MogoHttpDnsUtil(){
}
private final static MogoHttpDnsUtil INSTANCE = new MogoHttpDnsUtil();
public static MogoHttpDnsUtil getInstance(){
return INSTANCE;
}
public void init(Context context){
HttpDnsHelper.INSTANCE.init(context, new IHttpDnsConfig() {
@NotNull
@Override
public HttpDnsSimpleLocation getCurrentLocation() {
MogoLocation last = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if(last!=null){
return new HttpDnsSimpleLocation(last.getCityCode(), last.getLatitude(), last.getLongitude());
}
return null;
}
@Override
public boolean showDebugLog() {
return true;
}
@NotNull
@Override
public String getSn() {
return Utils.getSn();
}
});
}
public String getHttpAddress(){
return HttpDnsHelper.INSTANCE.getHttpDnsAddress(HttpDnsHelper.HTTP_DNS_TYPE_HTTP);
}
public String getWsAddress(){
return HttpDnsHelper.INSTANCE.getHttpDnsAddress(HttpDnsHelper.HTTP_DNS_TYPE_WS);
}
public void release(){
HttpDnsHelper.INSTANCE.release();
}
}