httpdns singleton

This commit is contained in:
tongchenfei
2021-01-05 14:02:48 +08:00
parent 61c380ff23
commit a121f3d2bd
9 changed files with 91 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ import com.mogo.httpdns.MogoHttpDnsHandler;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.TipDrawable;
import com.mogo.utils.TipToast;
import com.mogo.utils.httpdns.HttpSimpleLocation;
import com.mogo.utils.network.NetConfig;
import java.security.SecureRandom;
@@ -87,6 +88,7 @@ public abstract class AbsMogoApplication extends Application {
}
private void syncInit() {
MogoHttpDnsHandler.getHttpDnsApi().init(this, this::getCurrentLocation);
TipToast.init( this, ( ( context, message, tipDrawable ) -> {
if ( TextUtils.isEmpty( message ) ) {
return null;
@@ -100,6 +102,10 @@ public abstract class AbsMogoApplication extends Application {
} ) );
}
protected HttpSimpleLocation getCurrentLocation(){
return null;
}
private View generateToastView( Context context, String message, TipDrawable tipDrawable){
View contentView;
if(tipDrawable==null) {