新增启动APP时获取动态域名判断
新增测试服URL
This commit is contained in:
@@ -29,6 +29,7 @@ import androidx.core.app.NotificationManagerCompat;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.shayu.phonelive.AppContext;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
import com.tencent.rtmp.TXLiveBase;
|
||||
@@ -40,12 +41,16 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AdBean;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.DomainUrl;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.custom.CircleProgress;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
@@ -223,8 +228,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
playAD(obj.getIntValue("type") == 0);
|
||||
} else {
|
||||
releaseVideo();
|
||||
LauncherActivity.this.startActivity(new Intent(LauncherActivity.this, EntryActivity.class));
|
||||
LauncherActivity.this.finish();
|
||||
forwardEntryActivity();
|
||||
}
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
@@ -267,8 +271,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
IMLoginManager.get(this).upDataUserInfo();
|
||||
} else {
|
||||
releaseVideo();
|
||||
this.startActivity(new Intent(this, EntryActivity.class));
|
||||
this.finish();
|
||||
forwardEntryActivity();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -279,35 +282,75 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
* 跳转到首页
|
||||
*/
|
||||
private void forwardMainActivity() {
|
||||
releaseVideo();
|
||||
Intent intent = new Intent(
|
||||
LauncherActivity.this, MainActivity.class);
|
||||
intent.putExtra(Constants.SHOW_INVITE, false);
|
||||
checkHomeUrl(() -> {
|
||||
releaseVideo();
|
||||
Intent intent = new Intent(
|
||||
LauncherActivity.this, MainActivity.class);
|
||||
intent.putExtra(Constants.SHOW_INVITE, false);
|
||||
|
||||
if (getIntent().getStringExtra("liveid") != null) {
|
||||
intent.putExtra("liveid", getIntent().getStringExtra("liveid"));
|
||||
}
|
||||
if (getIntent().getStringExtra("type") != null) {
|
||||
intent.putExtra("type", getIntent().getStringExtra("type"));
|
||||
}
|
||||
if (getIntent().getStringExtra("liveid") != null) {
|
||||
intent.putExtra("liveid", getIntent().getStringExtra("liveid"));
|
||||
}
|
||||
if (getIntent().getStringExtra("type") != null) {
|
||||
intent.putExtra("type", getIntent().getStringExtra("type"));
|
||||
}
|
||||
|
||||
if (getIntent().getStringExtra("activityUrl") != null) {
|
||||
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
|
||||
}
|
||||
if (mImageViewList != null && mImageViewList.size() > 0) {
|
||||
Log.i(TAG, "forwardMainActivity: " + mImageViewList.size());
|
||||
AdBean bean = mAdList.get(0);
|
||||
if (bean != null && bean.getAnimation() == 1) {
|
||||
intent.putExtra("ad_url", mAdList.get(0).getUrl());
|
||||
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle();
|
||||
LauncherActivity.this.startActivity(intent, bundle);
|
||||
if (getIntent().getStringExtra("activityUrl") != null) {
|
||||
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
|
||||
}
|
||||
if (mImageViewList != null && mImageViewList.size() > 0) {
|
||||
Log.i(TAG, "forwardMainActivity: " + mImageViewList.size());
|
||||
AdBean bean = mAdList.get(0);
|
||||
if (bean != null && bean.getAnimation() == 1) {
|
||||
intent.putExtra("ad_url", mAdList.get(0).getUrl());
|
||||
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle();
|
||||
LauncherActivity.this.startActivity(intent, bundle);
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
private void forwardEntryActivity() {
|
||||
checkHomeUrl(() -> {
|
||||
this.startActivity(new Intent(this, EntryActivity.class));
|
||||
this.finish();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查域名,链接包才需要动态替换域名
|
||||
*
|
||||
* @param runnable 处理完成后调用runnable.run()
|
||||
*/
|
||||
private void checkHomeUrl(Runnable runnable) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY != 0) {
|
||||
runnable.run();
|
||||
return;
|
||||
}
|
||||
finish();
|
||||
LiveNetManager.get(mContext)
|
||||
.getDomainName(new HttpCallback<DomainUrl>() {
|
||||
@Override
|
||||
public void onSuccess(DomainUrl data) {
|
||||
if (data != null) {
|
||||
CommonAppConfig.HOST = data.getDomain_url();
|
||||
API.get().reloadUrl();
|
||||
}
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
LogUtils.e(error);
|
||||
runnable.run();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -588,8 +631,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
forwardMainActivity();
|
||||
} else {
|
||||
releaseVideo();
|
||||
this.startActivity(new Intent(this, EntryActivity.class));
|
||||
this.finish();
|
||||
forwardEntryActivity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user