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