version:4.0
fix: update:增加主页几个管控
This commit is contained in:
@@ -104,7 +104,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
mCustomFragment = new CustomFragment();
|
||||
mFragments.add(mCustomFragment);
|
||||
|
||||
mMainPresenter.getDesktopLayout();
|
||||
mMainPresenter.getSystemSettings();
|
||||
ArrayList<DesktopIcon> desktopIcons = ApkUtils.queryFilterAppInfo(this);
|
||||
|
||||
int x = 0;
|
||||
@@ -416,6 +416,11 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemSettings() {
|
||||
mMainPresenter.getDesktopLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopLayoutFinish() {
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.uiui.aios.base.BaseView;
|
||||
|
||||
public class MainContact {
|
||||
public interface Presenter extends BasePresenter<MainView> {
|
||||
/*获取系统设置*/
|
||||
void getSystemSettings();
|
||||
/*获取桌面布局*/
|
||||
void getDesktopLayout();
|
||||
/*更新桌面布局*/
|
||||
@@ -16,6 +18,7 @@ public class MainContact {
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
void setSystemSettings();
|
||||
void getDesktopLayoutFinish();
|
||||
void updateDesktopLayoutFinish();
|
||||
void sendAPPUsageFinish();
|
||||
|
||||
@@ -52,6 +52,27 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
this.mView = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSettings() {
|
||||
NetInterfaceManager.getInstance().getSystemSettings(true, getLifecycle(), new NetInterfaceManager.SosNumberCallback() {
|
||||
@Override
|
||||
public void setSosNumber(String json) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEmpty() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setSystemSettings();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopLayout() {
|
||||
NetInterfaceManager.getInstance().getDesktopLayoutObservable()
|
||||
|
||||
@@ -55,6 +55,10 @@ public class SystemSettings implements Serializable {
|
||||
int setting_charge;
|
||||
int setting_other_appInstaller;
|
||||
|
||||
int is_health;
|
||||
int is_shopping;
|
||||
int is_info;
|
||||
|
||||
|
||||
public int getQch_restore() {
|
||||
return qch_restore;
|
||||
@@ -393,6 +397,30 @@ public class SystemSettings implements Serializable {
|
||||
this.setting_other_appInstaller = setting_other_appInstaller;
|
||||
}
|
||||
|
||||
public int getIs_health() {
|
||||
return is_health;
|
||||
}
|
||||
|
||||
public void setIs_health(int is_health) {
|
||||
this.is_health = is_health;
|
||||
}
|
||||
|
||||
public int getIs_shopping() {
|
||||
return is_shopping;
|
||||
}
|
||||
|
||||
public void setIs_shopping(int is_shopping) {
|
||||
this.is_shopping = is_shopping;
|
||||
}
|
||||
|
||||
public int getIs_info() {
|
||||
return is_info;
|
||||
}
|
||||
|
||||
public void setIs_info(int is_info) {
|
||||
this.is_info = is_info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
|
||||
@@ -65,6 +65,7 @@ import com.uiui.aios.utils.ApkUtils;
|
||||
import com.uiui.aios.utils.AppUtil;
|
||||
import com.uiui.aios.utils.NetStateUtils;
|
||||
import com.uiui.aios.utils.SchemeUtils;
|
||||
import com.uiui.aios.utils.ToastUtil;
|
||||
import com.uiui.aios.utils.Utils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -144,7 +145,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
||||
private NotificationAdapter notificationAdapter;
|
||||
// private AlarmClockAdapter alarmClockAdapter;
|
||||
private SOSNnmberAdapter sosNnmberAdapter;
|
||||
private MMKV mmkv;
|
||||
private MMKV mMMKV;
|
||||
private Activity mContext;
|
||||
private ContentResolver mCRv;
|
||||
|
||||
@@ -192,7 +193,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
mmkv = MMKV.defaultMMKV();
|
||||
mMMKV = MMKV.defaultMMKV();
|
||||
}
|
||||
|
||||
|
||||
@@ -526,6 +527,11 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
||||
}
|
||||
|
||||
private void openScheme(String uri) {
|
||||
int is_health = mMMKV.decodeInt("is_health", 0);
|
||||
if (is_health == 0) {
|
||||
ToastUtil.show("AI健康功能已关闭");
|
||||
return;
|
||||
}
|
||||
SingleDialog dialog = new SingleDialog(mContext);
|
||||
dialog.setTitle("温馨提示")
|
||||
.setMessage("网络不可用")
|
||||
|
||||
@@ -794,7 +794,7 @@ public class NetInterfaceManager {
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
public void getSystemSettings(boolean refresh, BehaviorSubject<FragmentEvent> lifecycle, SosNumberCallback callback) {
|
||||
public void getSystemSettings(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, SosNumberCallback callback) {
|
||||
ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
||||
if (refresh) {
|
||||
connectMode = ConnectMode.DEFAULT;
|
||||
@@ -821,9 +821,9 @@ public class NetInterfaceManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void getSystemSettings(BehaviorSubject<FragmentEvent> lifecycle, SosNumberCallback callback) {
|
||||
public void getSystemSettings(BehaviorSubject<ActivityEvent> lifecycle, SosNumberCallback callback) {
|
||||
getsettingControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, FragmentEvent.DESTROY))
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(getSystemSettingsObserver(callback));
|
||||
}
|
||||
|
||||
@@ -849,6 +849,9 @@ public class NetInterfaceManager {
|
||||
Log.e("getSystemSettings", "onNext: " + settingsBaseResponse);
|
||||
if (settingsBaseResponse.code == 200) {
|
||||
SystemSettings systemSettings = settingsBaseResponse.data;
|
||||
mMMKV.encode("is_health", systemSettings.getIs_health());
|
||||
mMMKV.encode("is_shopping", systemSettings.getIs_shopping());
|
||||
mMMKV.encode("is_info", systemSettings.getIs_info());
|
||||
String setting_sos = systemSettings.getSetting_sos();
|
||||
if (TextUtils.isEmpty(setting_sos)) {
|
||||
mCacheHelper.put(URLAddress.GET_SETTINGS, "");
|
||||
|
||||
Reference in New Issue
Block a user