优化更新功能和ui
This commit is contained in:
@@ -59,16 +59,15 @@ public class UpgradeAppNetWorkManager {
|
||||
* 获取app升级信息
|
||||
*/
|
||||
public void getAppUpgradeInfo(Context context, String screenType) {
|
||||
String sn = "X20202203105S688HZ";
|
||||
int versionCode = 2070000;
|
||||
String versionName = "2.7.0";
|
||||
String screenType1 = "1";
|
||||
// String sn = "X20202203105S688HZ";
|
||||
// int versionCode = 2070000;
|
||||
// String versionName = "2.7.0";
|
||||
|
||||
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
// String versionCode = AppUtils.getAppVersionCode();
|
||||
// String versionName = AppUtils.getAppVersionName();
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
int versionCode = AppUtils.getAppVersionCode();
|
||||
String versionName = AppUtils.getAppVersionName();
|
||||
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, versionCode, versionName, screenType1);
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, versionCode, versionName, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mUpgradeApiService.getUpgradeInfo("apps_control", requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -76,24 +75,22 @@ public class UpgradeAppNetWorkManager {
|
||||
.subscribe(new Observer<UpgradeAppInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.d("liyz", "UpgradeAppInfo ------> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull UpgradeAppInfo info) {
|
||||
Log.d("liyz", "onNext -------> " + info.code + "----msg =" + info.msg);
|
||||
if (info != null && info.getData() != null) {
|
||||
Log.d("liyz", "UpgradeAppInfo url = " + info.getData().getApp_url() + "----code = " + info.getData().getVersion_code());
|
||||
//TODO 弹框
|
||||
if (info.getData().getVersion_code() >= versionCode) {
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog("appupgrade", info.getData().getApp_url());
|
||||
if (info != null && info.getData() != null && info.getData().size() > 0) {
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "---info.getData().get(0).getVersion_code() = " + info.getData().get(0).getVersion_code());
|
||||
Log.d("liyz", "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "----code = " + info.getData().get(0).getVersion_code());
|
||||
if (info.getData().get(0).getVersion_code() > versionCode) {
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.getData().get(0).getApp_url().substring(info.getData().get(0).getApp_url().lastIndexOf("/")+1), info.getData().get(0).getApp_url());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
Log.e("liyz", "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.ipcupgrade
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
@@ -49,9 +50,11 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
}
|
||||
|
||||
/**
|
||||
* 去下载 TODO 成功或者失败
|
||||
* 去下载
|
||||
*/
|
||||
fun downloadApp() {
|
||||
Log.d("liyz", "UpgradeAppDialog tag = $tag ---- downloarUrl = $downloarUrl")
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
|
||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
|
||||
dismiss()
|
||||
@@ -67,7 +70,6 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
}
|
||||
tag = name
|
||||
downloarUrl = url
|
||||
Log.d("liyz", "tag = $tag ---- downloarUrl = $downloarUrl")
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
// CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade()
|
||||
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.os.Process;
|
||||
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -13,6 +14,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -51,6 +53,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
initModules();
|
||||
|
||||
//查询是否有版本的更新
|
||||
queryAppUpgrade();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +64,15 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
return ProcessUtils.isMainProcess(this);
|
||||
}
|
||||
|
||||
private void queryAppUpgrade() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade();
|
||||
}
|
||||
},3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化异常采集配置
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:textSize="43px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bindingcar_title" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_title" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
@@ -38,7 +38,7 @@
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bindingcar_tips" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_tips" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
|
||||
@@ -9,17 +9,17 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class AppInfo implements Serializable {
|
||||
private IdInfo _id;
|
||||
private String bk_inst_id;
|
||||
private int bk_inst_id;
|
||||
private String bk_inst_name;
|
||||
private String bk_supplier_account;
|
||||
private int screen_type; //1,司机屏,2乘客屏
|
||||
private String screen_type; //1,司机屏,2乘客屏
|
||||
private String sn;
|
||||
private long last_time;
|
||||
private String last_time;
|
||||
private String app_url;
|
||||
private String bk_obj_id;
|
||||
private int version_code;
|
||||
private String version_name;
|
||||
private long create_time;
|
||||
private String create_time;
|
||||
|
||||
public IdInfo get_id() {
|
||||
return _id;
|
||||
@@ -29,11 +29,11 @@ public class AppInfo implements Serializable {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public String getBk_inst_id() {
|
||||
public int getBk_inst_id() {
|
||||
return bk_inst_id;
|
||||
}
|
||||
|
||||
public void setBk_inst_id(String bk_inst_id) {
|
||||
public void setBk_inst_id(int bk_inst_id) {
|
||||
this.bk_inst_id = bk_inst_id;
|
||||
}
|
||||
|
||||
@@ -53,11 +53,11 @@ public class AppInfo implements Serializable {
|
||||
this.bk_supplier_account = bk_supplier_account;
|
||||
}
|
||||
|
||||
public int getScreen_type() {
|
||||
public String getScreen_type() {
|
||||
return screen_type;
|
||||
}
|
||||
|
||||
public void setScreen_type(int screen_type) {
|
||||
public void setScreen_type(String screen_type) {
|
||||
this.screen_type = screen_type;
|
||||
}
|
||||
|
||||
@@ -69,14 +69,6 @@ public class AppInfo implements Serializable {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public long getLast_time() {
|
||||
return last_time;
|
||||
}
|
||||
|
||||
public void setLast_time(long last_time) {
|
||||
this.last_time = last_time;
|
||||
}
|
||||
|
||||
public String getApp_url() {
|
||||
return app_url;
|
||||
}
|
||||
@@ -109,11 +101,19 @@ public class AppInfo implements Serializable {
|
||||
this.version_name = version_name;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
public String getLast_time() {
|
||||
return last_time;
|
||||
}
|
||||
|
||||
public void setLast_time(String last_time) {
|
||||
this.last_time = last_time;
|
||||
}
|
||||
|
||||
public String getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ import java.util.List;
|
||||
* @since 6/21/22
|
||||
*/
|
||||
public class IdInfo implements Serializable {
|
||||
private String timestamp;
|
||||
private long timestamp;
|
||||
private String date;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,21 @@ package com.mogo.eagle.core.data.bindingcar;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description app升级管理
|
||||
* @since: 6/21/22
|
||||
*/
|
||||
public class UpgradeAppInfo extends BaseData {
|
||||
public AppInfo data;
|
||||
public ArrayList<AppInfo> data;
|
||||
|
||||
public AppInfo getData() {
|
||||
public ArrayList<AppInfo> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(AppInfo data) {
|
||||
public void setData(ArrayList<AppInfo> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user