version:1.7
fix:优化接口请求 update:增加锁屏密码
This commit is contained in:
@@ -15,10 +15,12 @@ public class MainAContact {
|
||||
void getAppletQRCode();
|
||||
/*获取二维码*/
|
||||
void getQRCode();
|
||||
//获取所有app包名
|
||||
void getAllApp();
|
||||
/*检查更新*/
|
||||
void checkUpdate();
|
||||
/*获取强制下载*/
|
||||
void getForceInstall();
|
||||
/*检查扶小鹰App更新*/
|
||||
void checkFXYUpdate();
|
||||
/*获取所有全局更新*/
|
||||
void getOverallApp();
|
||||
}
|
||||
@@ -27,8 +29,9 @@ public class MainAContact {
|
||||
void setSnInfo(BaseResponse<SnInfo> response);
|
||||
void setAppletQRCode(String url);
|
||||
void setQRCode(Bitmap bitmap);
|
||||
void getAllAppFinish();
|
||||
void checkUpdateFinish();
|
||||
void setForceInstall();
|
||||
void checkFXYUpdateFinish();
|
||||
void setOverallApp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,25 +91,26 @@ public class MainAPresenter implements MainAContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getAppletQRCode() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getQRCodeURL(true, getLifecycle(), new NetInterfaceManager.onNextCallback() {
|
||||
@Override
|
||||
public void onNext(Object o) {
|
||||
Log.e("getAppletQRCode", "onNext: " + o);
|
||||
mView.setAppletQRCode((String) o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Object o) {
|
||||
Log.e("getAppletQRCode", "onError: " + o);
|
||||
mView.setAppletQRCode(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppletQRCode", "onComplete: ");
|
||||
}
|
||||
});
|
||||
// NetInterfaceManager.getInstance()
|
||||
// .getQRCodeURL(true, getLifecycle(), new NetInterfaceManager.onNextCallback() {
|
||||
// @Override
|
||||
// public void onNext(Object o) {
|
||||
// Log.e("getAppletQRCode", "onNext: " + o);
|
||||
// mView.setAppletQRCode((String) o);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Object o) {
|
||||
// Log.e("getAppletQRCode", "onError: " + o);
|
||||
// mView.setAppletQRCode(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// Log.e("getAppletQRCode", "onComplete: ");
|
||||
// }
|
||||
// });
|
||||
mView.setAppletQRCode(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,17 +122,31 @@ public class MainAPresenter implements MainAContact.Presenter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkUpdate() {
|
||||
mView.checkUpdateFinish();
|
||||
public void getAllApp() {
|
||||
NetInterfaceManager.getInstance().getAppWhiteList(new NetInterfaceManager.WhiteListCallback() {
|
||||
@Override
|
||||
public void onComplet() {
|
||||
mView.getAllAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceInstall() {
|
||||
NetInterfaceManager.getInstance().getForceInstall(false, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
public void checkUpdate() {
|
||||
NetInterfaceManager.getInstance().checkAllAppUpdate(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getForceInstall", "onComplete: ");
|
||||
mView.setForceInstall();
|
||||
mView.checkUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkFXYUpdate() {
|
||||
NetInterfaceManager.getInstance().checkFXYAppUpdate(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkFXYUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -81,6 +82,8 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
ImageView iv_appqrcode;
|
||||
@BindView(R.id.iv_exit)
|
||||
ImageView iv_exit;
|
||||
@BindView(R.id.tv_update)
|
||||
TextView tv_update;
|
||||
|
||||
private MainAPresenter mPresenter;
|
||||
|
||||
@@ -138,6 +141,14 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
|
||||
Utils.getBattery(this);
|
||||
Utils.getBatterymAh(this);
|
||||
|
||||
tv_update.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ToastUtil.show("正在检查更新");
|
||||
mPresenter.getAllApp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private TimeTask task;
|
||||
@@ -393,31 +404,36 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
|
||||
@Override
|
||||
public void setAppletQRCode(String url) {
|
||||
if (!TextUtils.isEmpty(url)) {
|
||||
Glide.with(iv_appqrcode)
|
||||
.load(url)
|
||||
.dontAnimate()
|
||||
.placeholder(getDrawable(R.drawable.applet_qrcode))
|
||||
.into(iv_appqrcode);
|
||||
} else {
|
||||
iv_appqrcode.setImageDrawable(getDrawable(R.drawable.applet_qrcode));
|
||||
}
|
||||
// if (!TextUtils.isEmpty(url)) {
|
||||
// Glide.with(iv_appqrcode)
|
||||
// .load(url)
|
||||
// .dontAnimate()
|
||||
// .placeholder(getDrawable(R.drawable.applet_qrcode))
|
||||
// .into(iv_appqrcode);
|
||||
// } else {
|
||||
// iv_appqrcode.setImageDrawable(getDrawable(R.drawable.applet_qrcode));
|
||||
// }
|
||||
mPresenter.getQRCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQRCode(@NotNull Bitmap bitmap) {
|
||||
qr_code.setImageBitmap(bitmap);
|
||||
mPresenter.getAllApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppFinish() {
|
||||
mPresenter.checkUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkUpdateFinish() {
|
||||
mPresenter.getForceInstall();
|
||||
}
|
||||
mPresenter.checkFXYUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForceInstall() {
|
||||
public void checkFXYUpdateFinish() {
|
||||
mPresenter.getOverallApp();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user