version:1.1.5
update: bugfixes:优化闹钟自动接听
1
.gitignore
vendored
@@ -16,3 +16,4 @@
|
||||
/app/src/test/java/com/uiui/os/
|
||||
/.idea/
|
||||
/app/proguardbuild/
|
||||
/dependencies.txt
|
||||
|
||||
@@ -15,8 +15,8 @@ android {
|
||||
applicationId "com.xxpatx.os"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 1010
|
||||
versionName "1.0.9"
|
||||
versionCode 1016
|
||||
versionName "1.1.5"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -27,7 +27,7 @@ android {
|
||||
}
|
||||
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "723704391181f6b0b478eecf8e6fcde6"
|
||||
AMAP_KEY: "963a156c0e1b525856d9b1d304666fe9"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -124,15 +124,15 @@
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:restoreAnyVersion="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/AppThemeFitsSystem">
|
||||
<activity
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:resizeableActivity="true"
|
||||
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
android:resizeableActivity="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -143,7 +143,11 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activity.activation.ActivationActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/DialogStylesWithoutClose" />
|
||||
<activity android:name=".activity.control.ControlActivity" />
|
||||
<activity android:name=".activity.quickapp.QuickAppActivity" />
|
||||
<activity
|
||||
@@ -239,7 +243,11 @@
|
||||
android:name=".activity.tts.TtsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/activity_styles" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.update.UpdateActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/activity_styles" />
|
||||
|
||||
<!-- Intent received used to install shortcuts from other applications -->
|
||||
<receiver
|
||||
@@ -270,11 +278,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.InstallResultReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<!-- <receiver-->
|
||||
<!-- android:name=".receiver.SmsReceiver"-->
|
||||
<!-- android:enabled="true"-->
|
||||
@@ -336,6 +339,21 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.InstallResultReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.FileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location"-->
|
||||
<service
|
||||
android:name="com.amap.api.location.APSService"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// IGetInfoInterface.aidl
|
||||
package com.xxpatx.sn;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
|
||||
interface IGetInfoInterface {
|
||||
/**
|
||||
* Demonstrates some basic types that you can use as parameters
|
||||
* and return values in AIDL.
|
||||
*/
|
||||
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
|
||||
double aDouble, String aString);
|
||||
|
||||
/*获取sn*/
|
||||
String getSerial();
|
||||
/*获取WiFi名*/
|
||||
String getWifiSsid();
|
||||
/*写入系统数据库*/
|
||||
boolean SystemPutInt(String name, int value);
|
||||
/*结束进程*/
|
||||
void killBackgroundProcesses(String pkg);
|
||||
/*设置launcher3为默认*/
|
||||
void openLauncher3();
|
||||
/*设置默认桌面*/
|
||||
void setDefaultDesktop(String pkgName, String className);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.xxpatx.os.activity.activation;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.databinding.ActivityActivationBinding;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
|
||||
public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, ActivityActivationBinding> {
|
||||
private static final String TAG = "ActivationActivity";
|
||||
|
||||
@Override
|
||||
public boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_activation;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
return false;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
public void activation(View view) {
|
||||
ApkUtils.openApp(ActivationActivity.this, "com.xxpatx.sn");
|
||||
}
|
||||
|
||||
public void openWifi(View view) {
|
||||
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xxpatx.os.activity.activation;
|
||||
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.databinding.ActivityActivationBinding;
|
||||
|
||||
public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding, ActivityEvent> {
|
||||
|
||||
@Override
|
||||
public ActivityActivationBinding getVDBinding() {
|
||||
return binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,6 +38,11 @@ public class PortAlarmActivity extends BaseMvvmActivity<PortAlarmViewModel, Acti
|
||||
private PortAlarmAdapter mAlarmAdapter;
|
||||
private int mType = 0;
|
||||
|
||||
@Override
|
||||
public boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setfitWindow() {
|
||||
return true;
|
||||
@@ -71,7 +76,7 @@ public class PortAlarmActivity extends BaseMvvmActivity<PortAlarmViewModel, Acti
|
||||
public void onLongClick(AlarmClockData alarmClockData) {
|
||||
boolean clockModify = mMMKV.decodeBool(CommonConfig.DISABLE_CLOCK_MODIFY, false);
|
||||
if (clockModify) {
|
||||
Toaster.showLong("已禁用联系人修改");
|
||||
Toaster.showLong("已禁用闹钟修改");
|
||||
} else {
|
||||
showDialog(alarmClockData);
|
||||
}
|
||||
@@ -216,7 +221,12 @@ public class PortAlarmActivity extends BaseMvvmActivity<PortAlarmViewModel, Acti
|
||||
}
|
||||
|
||||
public void add(View view) {
|
||||
boolean clockModify = mMMKV.decodeBool(CommonConfig.DISABLE_CLOCK_MODIFY, false);
|
||||
if (clockModify) {
|
||||
Toaster.showLong("已禁用闹钟修改");
|
||||
} else {
|
||||
startActivity(new Intent(PortAlarmActivity.this, PortAlarmClockAddActivity.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,11 @@ public class PortAlarmClockAddActivity extends BaseMvvmActivity<PortAlarmClockAd
|
||||
private int mDayType = 1;
|
||||
private int mClockType = 1;
|
||||
|
||||
@Override
|
||||
public boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setfitWindow() {
|
||||
return true;
|
||||
@@ -151,14 +156,14 @@ public class PortAlarmClockAddActivity extends BaseMvvmActivity<PortAlarmClockAd
|
||||
|
||||
private void checkContent() {
|
||||
pvTime.returnData();
|
||||
if (TextUtils.isEmpty(mViewDataBinding.etActivation.getText())) {
|
||||
Toaster.show("请输入标题");
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(mPictrueFilePath)) {
|
||||
Toaster.show("请选择图片");
|
||||
return;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mViewDataBinding.etActivation.getText())) {
|
||||
// Toaster.show("请输入标题");
|
||||
// return;
|
||||
// }
|
||||
// if (TextUtils.isEmpty(mPictrueFilePath)) {
|
||||
// Toaster.show("请选择图片");
|
||||
// return;
|
||||
// }
|
||||
String timeStamp = getTime(mDate);
|
||||
Log.e(TAG, "checkContent: " + timeStamp);
|
||||
Log.e(TAG, "checkContent: " + mPictrueFilePath);
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.xxpatx.os.activity.callwechat;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.xxpatx.os.R;
|
||||
@@ -12,6 +14,7 @@ import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.Contact;
|
||||
import com.xxpatx.os.databinding.ActivityWechatCallBinding;
|
||||
import com.xxpatx.os.service.WeAccessibilityService;
|
||||
import com.xxpatx.os.utils.AccessibilityUtils;
|
||||
|
||||
public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, ActivityWechatCallBinding> {
|
||||
|
||||
@@ -38,6 +41,17 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
@Override
|
||||
protected void initView() {
|
||||
getWindow().setGravity(Gravity.BOTTOM);
|
||||
hideNavigationBar();
|
||||
}
|
||||
|
||||
// 隐藏导航栏
|
||||
private void hideNavigationBar() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,11 +62,19 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
if (contact != null) {
|
||||
mContact = contact;
|
||||
mViewDataBinding.setContact(contact);
|
||||
mViewDataBinding.setTag(!TextUtils.isEmpty(contact.getTag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean checkSettings() {
|
||||
boolean accessibility = AccessibilityUtils.isAccessibilitySettingsOn(this);
|
||||
if (!accessibility) {
|
||||
Toast.makeText(this, "请在无障碍服务中打开 - 关爱守护快捷服务", Toast.LENGTH_LONG).show();
|
||||
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
||||
}
|
||||
return accessibility;
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
public void callPhone(View view) {
|
||||
@@ -65,26 +87,30 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
}
|
||||
|
||||
public void callWechatVideo(View view) {
|
||||
if (TextUtils.isEmpty(mContact.getTag())){
|
||||
if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
Toaster.show("没有设置标签,无法拨打微信视频");
|
||||
return;
|
||||
}
|
||||
if (checkSettings()) {
|
||||
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
||||
intent.putExtra("WechatInfo", mContact);
|
||||
intent.putExtra("call_type", WeAccessibilityService.TYPE_VIDEO);
|
||||
startService(intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
public void callWechatVoice(View view) {
|
||||
if (TextUtils.isEmpty(mContact.getTag())){
|
||||
if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
Toaster.show("没有设置标签,无法拨打微信语音");
|
||||
return;
|
||||
}
|
||||
if (checkSettings()) {
|
||||
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
||||
intent.putExtra("WechatInfo", mContact);
|
||||
intent.putExtra("call_type", WeAccessibilityService.TYPE_VOICE);
|
||||
startService(intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ import com.xxpatx.os.base.GlideEngine;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.databinding.ActivityAddContactBinding;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.utils.GlideLoadUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -117,7 +117,7 @@ public class AddContactActivity extends BaseMvvmActivity<AddContactViewModel, Ac
|
||||
RequestBody requestBody = RequestBody.Companion.create(avatarFile, mediaType);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("avatar", avatarFile.getName(), requestBody);
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("name", name);
|
||||
params.put("mobile", phone);
|
||||
params.put("is_urgent", String.valueOf(mViewDataBinding.toggleButton.isToggleOn()));
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.xxpatx.os.activity.contact;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.provider.ContactsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -21,14 +24,14 @@ import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.SelectMimeType;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener;
|
||||
import com.xiasuhuei321.loadingdialog.view.LoadingDialog;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.GlideEngine;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.databinding.ActivityAddWechatContactBinding;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.utils.ScreenUtil;
|
||||
import com.xiasuhuei321.loadingdialog.view.LoadingDialog;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -46,6 +49,11 @@ public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactV
|
||||
private LoadingDialog mLoadingDialog;
|
||||
private String mPictrueFilePath;
|
||||
|
||||
@Override
|
||||
public boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setfitWindow() {
|
||||
return true;
|
||||
@@ -136,6 +144,9 @@ public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactV
|
||||
Toaster.show("请输入微信群组标签");
|
||||
return;
|
||||
}
|
||||
if (mViewDataBinding.tbSim.isToggleOn() == 1) {
|
||||
createContact(name, phone);
|
||||
} else {
|
||||
File avatarFile;
|
||||
Log.e("checkContact", "mPictrueFilePath: " + mPictrueFilePath);
|
||||
if (TextUtils.isEmpty(mPictrueFilePath)) {
|
||||
@@ -148,12 +159,14 @@ public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactV
|
||||
RequestBody requestBody = RequestBody.Companion.create(avatarFile, mediaType);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("avatar", avatarFile.getName(), requestBody);
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("name", name);
|
||||
params.put("mobile", phone);
|
||||
params.put("tag", groupTag);
|
||||
params.put("is_urgent", String.valueOf(mViewDataBinding.toggleButton.isToggleOn()));
|
||||
mViewModel.addContact(params, body);
|
||||
}
|
||||
|
||||
mLoadingDialog.show();
|
||||
}
|
||||
|
||||
@@ -234,6 +247,47 @@ public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactV
|
||||
return null;
|
||||
}
|
||||
|
||||
public void testAddContacts() {
|
||||
//插入raw_contacts表,并获取_id属性
|
||||
Uri uri = Uri.parse("content://icc/adn");
|
||||
ContentResolver resolver = getContentResolver();
|
||||
ContentValues values = new ContentValues();
|
||||
long contact_id = ContentUris.parseId(resolver.insert(uri, values));
|
||||
//插入data表
|
||||
uri = Uri.parse("content://com.android.contacts/data");
|
||||
//add Name
|
||||
values.put("raw_contact_id", contact_id);
|
||||
values.put(ContactsContract.Data.MIMETYPE, "vnd.android.cursor.item/name");
|
||||
values.put("data2", "zdong");
|
||||
values.put("data1", "xzdong");
|
||||
resolver.insert(uri, values);
|
||||
values.clear();
|
||||
//add Phone
|
||||
values.put("raw_contact_id", contact_id);
|
||||
values.put(ContactsContract.Data.MIMETYPE, "vnd.android.cursor.item/phone_v2");
|
||||
values.put("data2", "2"); //手机
|
||||
values.put("data1", "87654321");
|
||||
resolver.insert(uri, values);
|
||||
values.clear();
|
||||
//add email
|
||||
values.put("raw_contact_id", contact_id);
|
||||
values.put(ContactsContract.Data.MIMETYPE, "vnd.android.cursor.item/email_v2");
|
||||
values.put("data2", "2"); //单位
|
||||
values.put("data1", "xzdong@xzdong.com");
|
||||
resolver.insert(uri, values);
|
||||
}
|
||||
|
||||
public void createContact(String name, String phoneNumber) {
|
||||
Uri simUri = Uri.parse("content://icc/adn");
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("tag", name);
|
||||
values.put("number", phoneNumber);
|
||||
getContentResolver().insert(simUri, values);
|
||||
mLoadingDialog.close();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
public class BtnClick {
|
||||
public void selectPic(View view) {
|
||||
openSelector();
|
||||
|
||||
@@ -32,9 +32,9 @@ import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.bean.Contact;
|
||||
import com.xxpatx.os.databinding.ActivityEditContactBinding;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.utils.ScreenUtil;
|
||||
import com.xiasuhuei321.loadingdialog.view.LoadingDialog;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -209,7 +209,7 @@ public class EditContactActivity extends BaseMvvmActivity<EditContactViewModel,
|
||||
RequestBody requestBody = RequestBody.Companion.create(avatarFile, mediaType);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("avatar", avatarFile.getName(), requestBody);
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("id", mContact.getId());
|
||||
params.put("name", name);
|
||||
params.put("mobile", phone);
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.ActivityControlBinding;
|
||||
import com.xxpatx.os.manager.AmapManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.utils.BrightnessUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -204,20 +203,6 @@ public class ControlActivity extends BaseMvvmActivity<ControlViewModel, Activity
|
||||
return "";
|
||||
}
|
||||
|
||||
private String getConnectWifiSsid() {
|
||||
// WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||
// WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//// //去掉带引号的字符串方法一
|
||||
//// String wifiInfo1 = wifiInfo.getSSID();
|
||||
//// if (wifiInfo1.contains("\"")) {
|
||||
//// wifiInfo1 = wifiInfo1.substring(1, wifiInfo1.length() - 1);
|
||||
//// }
|
||||
////去掉带引号的字符串方法二
|
||||
// String wifiSSID = wifiInfo.getSSID();
|
||||
// String wifiInfo1 = wifiSSID.replaceAll("\"", "");
|
||||
return RemoteManager.getInstance().getConnectWifiSsid();
|
||||
}
|
||||
|
||||
private BluetoothAdapter bluetoothAdapter;
|
||||
|
||||
private void getBluetooth() {
|
||||
@@ -709,7 +694,7 @@ public class ControlActivity extends BaseMvvmActivity<ControlViewModel, Activity
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
Log.e(TAG, "onProgressChanged: i = " + i);
|
||||
RemoteManager.getInstance().putSystemInt(Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
int gamma = BrightnessUtils.convertLinearToGamma(i, 1, 255);
|
||||
Log.e(TAG, "onProgressChanged: gamma = " + gamma);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xxpatx.os.activity.dailyapp;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
@@ -11,18 +12,24 @@ import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.databinding.ActivityDailyappBinding;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.service.NotificationService;
|
||||
import com.xxpatx.os.view.GridSpaceItemDecoration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DailyAppActivity extends BaseMvvmActivity<DailyAppViewModel, ActivityDailyappBinding> {
|
||||
public class DailyAppActivity extends BaseMvvmActivity<DailyAppViewModel, ActivityDailyappBinding> implements NotificationService.NotificationListener{
|
||||
private static final String TAG = "DailyAppActivity";
|
||||
|
||||
private DailyAppAdapter mDailyAppAdapter;
|
||||
|
||||
@Override
|
||||
public void onListenerUpdate() {
|
||||
mViewModel.getPackageList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setfitWindow() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,11 +42,12 @@ public class DailyAppActivity extends BaseMvvmActivity<DailyAppViewModel, Activi
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
// mViewDataBinding.setClick(new BtnClick());
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
NotificationService.setListener(this);
|
||||
mDailyAppAdapter = new DailyAppAdapter();
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
mViewDataBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 5));
|
||||
@@ -49,19 +57,28 @@ public class DailyAppActivity extends BaseMvvmActivity<DailyAppViewModel, Activi
|
||||
mViewDataBinding.recyclerView.addItemDecoration(new GridSpaceItemDecoration(3, 50, 50));
|
||||
}
|
||||
mViewDataBinding.recyclerView.setAdapter(mDailyAppAdapter);
|
||||
mViewDataBinding.ivBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
List<DailyAppBean> appBeanList = AppStatusManager.getInstance().getPackageList();
|
||||
mDailyAppAdapter.setDailyAppBeans(appBeanList);
|
||||
mViewDataBinding.tvAppsize.setText(String.format(getString(R.string.app_size), appBeanList.size()));
|
||||
mViewModel.getDailyAppData().observe(this, new Observer<List<DailyAppBean>>() {
|
||||
@Override
|
||||
public void onChanged(List<DailyAppBean> dailyAppBeans) {
|
||||
mDailyAppAdapter.setDailyAppBeans(dailyAppBeans);
|
||||
mViewDataBinding.tvAppsize.setText(String.format(getString(R.string.app_size), dailyAppBeans.size()));
|
||||
}
|
||||
});
|
||||
mViewModel.getPackageList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.xxpatx.os.activity.dailyapp;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.databinding.ActivityDailyappBinding;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DailyAppViewModel extends BaseViewModel<ActivityDailyappBinding, ActivityEvent> {
|
||||
|
||||
@@ -15,4 +21,15 @@ public class DailyAppViewModel extends BaseViewModel<ActivityDailyappBinding, Ac
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
private MutableLiveData<List<DailyAppBean>> mDailyAppData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<List<DailyAppBean>> getDailyAppData() {
|
||||
return mDailyAppData;
|
||||
}
|
||||
|
||||
public void getPackageList() {
|
||||
List<DailyAppBean> appBeanList = AppStatusManager.getInstance().getPackageList();
|
||||
mDailyAppData.setValue(appBeanList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
// mViewDataBinding.setClick(new BtnClick());
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,6 +118,7 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
if (phoneList == null || phoneList.isEmpty()) {
|
||||
Toaster.showLong("没有设置紧急联系人");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
@@ -280,4 +281,25 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
// public static final int PRECISE_CALL_STATE_DISCONNECTED = 7; //挂断完成
|
||||
// public static final int PRECISE_CALL_STATE_DISCONNECTING = 8; //正在挂断
|
||||
// }
|
||||
|
||||
public class BtnClick{
|
||||
public void call(View view){
|
||||
needDial = true;
|
||||
|
||||
if (phoneList == null || phoneList.isEmpty()) {
|
||||
Toaster.showLong("没有设置紧急联系人");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
Uri data = Uri.parse("tel:" + phoneList.get(0).getMobile());
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
phoneList.remove(0);
|
||||
mSosNnmberAdapter.notifyDataSetChanged();
|
||||
isCalling = true;
|
||||
subscribe.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,12 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ShortcutManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.hardware.camera2.CameraAccessException;
|
||||
import android.hardware.camera2.CameraCharacteristics;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -25,6 +22,7 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
@@ -39,9 +37,12 @@ import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.activation.ActivationActivity;
|
||||
import com.xxpatx.os.activity.phone.PhoneActivity;
|
||||
import com.xxpatx.os.activity.update.UpdateActivity;
|
||||
import com.xxpatx.os.base.BaseFragmentPagerAdapter;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.DesktopIcon;
|
||||
import com.xxpatx.os.bean.MapBean;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
@@ -51,21 +52,21 @@ import com.xxpatx.os.fragment.contact.ContactFragment;
|
||||
import com.xxpatx.os.fragment.home.HomeFragment;
|
||||
import com.xxpatx.os.fragment.settings.SettingsFragment;
|
||||
import com.xxpatx.os.manager.AmapManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.service.NotificationService;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
import com.xxpatx.os.utils.DayUtils;
|
||||
import com.xxpatx.os.utils.TimeUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
import com.xxpatx.os.utils.WiFiUtils;
|
||||
import com.xxpatx.os.view.ScaleCircleNavigator;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBinding> implements RemoteManager.ConnectedListener, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBinding> implements NetworkUtils.OnNetworkStatusChangedListener, NotificationService.NotificationListener {
|
||||
private static final String TAG = "MainActivity";
|
||||
|
||||
|
||||
@@ -102,9 +103,9 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteConnected() {
|
||||
Log.e(TAG, "onRemoteConnected: ");
|
||||
setDefaultDesktop();
|
||||
public void onListenerUpdate() {
|
||||
Log.e(TAG, "onListenerUpdate: ");
|
||||
updateIconBg();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,9 +131,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
@Override
|
||||
public void initView() {
|
||||
// UltimateBarX.addNavigationBarBottomPadding(mViewDataBinding.clBottom);
|
||||
|
||||
getLocationPermission();
|
||||
|
||||
toggleNotificationListenerService(this);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
@@ -185,8 +183,8 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
||||
scaleCircleNavigator.setCircleCount(mFragments.size());
|
||||
scaleCircleNavigator.setNormalCircleColor(Color.DKGRAY);
|
||||
scaleCircleNavigator.setSelectedCircleColor(Color.LTGRAY);
|
||||
scaleCircleNavigator.setNormalCircleColor(getColor(R.color.NormalCircleColor));
|
||||
scaleCircleNavigator.setSelectedCircleColor(getColor(R.color.SelectedCircleColor));
|
||||
scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {
|
||||
@Override
|
||||
public void onClick(int index) {
|
||||
@@ -201,6 +199,8 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
if (mFragments.size() > 1) {
|
||||
mViewDataBinding.viewPager.setCurrentItem(defaultCurrent);
|
||||
}
|
||||
NotificationService.setListener(this);
|
||||
updateIconBg();
|
||||
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener(mOnSystemUiVisibilityChangeListener);
|
||||
@@ -231,6 +231,40 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
private void updateIconBg() {
|
||||
int size0 = NotificationService.getNotificationLength("com.android.dialer");
|
||||
if (size0 == 0) {
|
||||
mViewDataBinding.bg0.setVisibility(View.GONE);
|
||||
} else if (size0 < 99) {
|
||||
mViewDataBinding.bg0.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg0.setText(String.valueOf(size0));
|
||||
} else {
|
||||
mViewDataBinding.bg0.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg0.setText("99+");
|
||||
}
|
||||
|
||||
int size1 = NotificationService.getNotificationLength("com.tencent.mm");
|
||||
if (size1 == 0) {
|
||||
mViewDataBinding.bg1.setVisibility(View.GONE);
|
||||
} else if (size1 < 99) {
|
||||
mViewDataBinding.bg1.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg1.setText(String.valueOf(size1));
|
||||
} else {
|
||||
mViewDataBinding.bg1.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg1.setText("99+");
|
||||
}
|
||||
|
||||
int size2 = NotificationService.getNotificationLength("com.ss.android.ugc.aweme");
|
||||
if (size2 == 0) {
|
||||
mViewDataBinding.bg2.setVisibility(View.GONE);
|
||||
} else if (size2 < 99) {
|
||||
mViewDataBinding.bg2.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg2.setText(String.valueOf(size2));
|
||||
} else {
|
||||
mViewDataBinding.bg2.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.bg2.setText("99+");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
@@ -253,9 +287,41 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
});
|
||||
// mViewModel.getAppList();
|
||||
mViewModel.getActivationData().observe(this, new Observer<Integer>() {
|
||||
@Override
|
||||
public void onChanged(Integer integer) {
|
||||
if (integer == 0) {
|
||||
if (WiFiUtils.getInstance().isNetworkConnected()) {
|
||||
Toaster.showLong("请先激活设备");
|
||||
startActivity(new Intent(MainActivity.this, ActivationActivity.class));
|
||||
}
|
||||
} else {
|
||||
Log.e("getActivationData", "onChanged: 已激活");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mViewModel.getSnIsActivation();
|
||||
|
||||
mViewModel.getAppInfoData().observe(this, new Observer<AppInfo>() {
|
||||
@Override
|
||||
public void onChanged(AppInfo appInfo) {
|
||||
if (appInfo == null) {
|
||||
Log.e("getAppInfoData", "onChanged: not found update");
|
||||
} else {
|
||||
if (ApkUtils.checkAppUpdate(MainActivity.this, appInfo)) {
|
||||
Intent intent = new Intent(MainActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("appUpdateInfo", appInfo);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Log.e("getAppInfoData", "onChanged: not found update");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.checkUpdate();
|
||||
|
||||
registReceiver();
|
||||
RemoteManager.setListener(this);
|
||||
initAmap();
|
||||
}
|
||||
|
||||
@@ -359,6 +425,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
default:
|
||||
case Intent.ACTION_MAIN:
|
||||
mViewDataBinding.viewPager.setCurrentItem(defaultCurrent);
|
||||
mViewModel.checkUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -379,10 +446,19 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
Log.e(TAG, "onResume: ");
|
||||
if (!RemoteManager.isServiceConnected()) {
|
||||
RemoteManager.getInstance().bindInfoService();
|
||||
int activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
mViewModel.getActivationData().setValue(activation);
|
||||
addData();
|
||||
// 判断是否开启监听通知权限
|
||||
if (NotificationManagerCompat.getEnabledListenerPackages(this).contains(getPackageName())) {
|
||||
Intent serviceIntent = new Intent(this, NotificationService.class);
|
||||
startService(serviceIntent);
|
||||
} else {
|
||||
// 去开启 监听通知权限
|
||||
startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
|
||||
}
|
||||
getPermission();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static final String Launcher3 = "com.android.launcher3";
|
||||
@@ -393,12 +469,12 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
int is_activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
Log.e(TAG, "onResume: is_activation = " + is_activation);
|
||||
if (is_activation == 1) {
|
||||
RemoteManager.getInstance().setDefaultDesktop(BuildConfig.APPLICATION_ID, this.getClass().getName());
|
||||
Utils.setDefaultDesktop(this, BuildConfig.APPLICATION_ID, this.getClass().getName());
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
||||
RemoteManager.getInstance().setDefaultDesktop(Launcher3, Launcher3QuickstepClass);
|
||||
Utils.setDefaultDesktop(this, Launcher3, Launcher3QuickstepClass);
|
||||
} else {
|
||||
RemoteManager.getInstance().setDefaultDesktop(Launcher3, Launcher3Class);
|
||||
Utils.setDefaultDesktop(this, Launcher3, Launcher3Class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -438,7 +514,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "onGranted: 获取权限成功");
|
||||
addData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -563,7 +638,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
unregisterAllReceiver();
|
||||
RemoteManager.removeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xxpatx.os.activity.main;
|
||||
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -21,18 +22,22 @@ import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.bean.ActivationBean;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.bean.DesktopIcon;
|
||||
import com.xxpatx.os.bean.NetDesktopIcon;
|
||||
import com.xxpatx.os.bean.SnInfo;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.ActivityMainBinding;
|
||||
import com.xxpatx.os.gson.GsonUtils;
|
||||
import com.xxpatx.os.manager.AppManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.utils.ActivationUtil;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
import com.xxpatx.os.utils.WiFiUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -66,7 +71,9 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
boolean activation = ActivationUtil.isActivation(getCtx());
|
||||
Log.e(TAG, "getweather: is_activation = " + activation);
|
||||
if (!activation) {
|
||||
if (WiFiUtils.getInstance().isNetworkConnected()) {
|
||||
Toaster.show("请先激活设备");
|
||||
}
|
||||
return;
|
||||
}
|
||||
getWeatherNow(location);
|
||||
@@ -261,6 +268,91 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<Integer> mActivationData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Integer> getActivationData() {
|
||||
return mActivationData;
|
||||
}
|
||||
|
||||
public void getSnIsActivation() {
|
||||
NetInterfaceManager.getInstance().getSnIsActivationObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<ActivationBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getSnIsActivation", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<ActivationBean> baseResponse) {
|
||||
Log.e("getSnIsActivation", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
ActivationBean activationBean = baseResponse.data;
|
||||
if (activationBean != null) {
|
||||
MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode(CommonConfig.ACTIVATION_BEAN_KEY, GsonUtils.toJSONString(activationBean));
|
||||
int is_activation = activationBean.getIs_activation();
|
||||
Settings.Global.putInt(getCtx().getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, is_activation);
|
||||
int code_type = activationBean.getCode_type();
|
||||
Settings.Global.putInt(getCtx().getContentResolver(), CommonConfig.UIUI_CODE_TYPE_KEY, code_type);
|
||||
long expire_time = activationBean.getExpire_time();
|
||||
Settings.Global.putLong(getCtx().getContentResolver(), CommonConfig.UIUI_EXPIRE_TIME_KEY, expire_time);
|
||||
mActivationData.setValue(is_activation);
|
||||
} else {
|
||||
mActivationData.setValue(0);
|
||||
}
|
||||
} else {
|
||||
mActivationData.setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getSnIsActivation", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getSnIsActivation", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<AppInfo> mAppInfoData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<AppInfo> getAppInfoData() {
|
||||
return mAppInfoData;
|
||||
}
|
||||
|
||||
public void checkUpdate() {
|
||||
NetInterfaceManager.getInstance().getUpdateObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdate", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppInfo> appInfoBaseResponse) {
|
||||
Log.e("checkUpdate", "onNext: " + appInfoBaseResponse);
|
||||
if (appInfoBaseResponse.code == 200) {
|
||||
AppInfo appInfo = appInfoBaseResponse.data;
|
||||
mAppInfoData.setValue(appInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdate", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdate", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void getDesktopLayout() {
|
||||
@@ -299,7 +391,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
Log.e(TAG, "onRestart: " + ApkUtils.getAppNameByPackage(getCtx(), packagename));
|
||||
Log.e(TAG, "onRestart: " + packagename);
|
||||
NetInterfaceManager.getInstance().getAppUsageRecordControl()
|
||||
.sendappUsageRecord(RemoteManager.getInstance().getSerial(),
|
||||
.sendappUsageRecord(Utils.getSerial(),
|
||||
ApkUtils.getAppNameByPackage(getCtx(), packagename),
|
||||
packagename,
|
||||
AppUsedTimeUtils.getInstance().getStartTime() / 1000,
|
||||
@@ -379,4 +471,6 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.ActivityScreenLockBinding;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
|
||||
public class ScreenLockActivity extends BaseMvvmActivity<ScreenLockViewModel, ActivityScreenLockBinding> {
|
||||
private static final String TAG = "ScreenLockActivity";
|
||||
@@ -155,7 +154,7 @@ public class ScreenLockActivity extends BaseMvvmActivity<ScreenLockViewModel, Ac
|
||||
}
|
||||
|
||||
private void exitDesktop() {
|
||||
RemoteManager.getInstance().openLauncher3();
|
||||
// RemoteManager.getInstance().openLauncher3();
|
||||
finish();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -15,18 +15,22 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.tts.TtsActivity;
|
||||
import com.xxpatx.os.activity.update.UpdateActivity;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.ActivitySettingBinding;
|
||||
import com.xxpatx.os.service.WeAccessibilityService;
|
||||
import com.xxpatx.os.service.main.MainService;
|
||||
import com.xxpatx.os.utils.AccessibilityUtils;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -63,12 +67,29 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mViewDataBinding.setVersionName(BuildConfig.VERSION_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
mViewModel.getAppInfoData().observe(this, new Observer<AppInfo>() {
|
||||
@Override
|
||||
public void onChanged(AppInfo appInfo) {
|
||||
if (appInfo == null) {
|
||||
Log.e("getAppInfoData", "onChanged: not found update");
|
||||
Toaster.show("已是最新版本");
|
||||
} else {
|
||||
if (ApkUtils.checkAppUpdate(SettingActivity.this, appInfo)) {
|
||||
Intent intent = new Intent(SettingActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("appUpdateInfo", appInfo);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Log.e("getAppInfoData", "onChanged: not found update");
|
||||
Toaster.show("已是最新版本");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,23 +252,23 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
||||
}
|
||||
|
||||
public void autoAccept(View view) {
|
||||
boolean floatWindowEnable = mMMKV.decodeBool(CommonConfig.FLOAT_WINDOW, true);
|
||||
if (floatWindowEnable) {
|
||||
Toaster.showLong("因为系统限制,请先关闭悬浮窗功能,开启自动接听后再打开悬浮窗");
|
||||
} else {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(SettingActivity.this)) {
|
||||
boolean autoAccept = mMMKV.decodeBool(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, true);
|
||||
boolean autoAccept = mMMKV.decodeBool(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, false);
|
||||
Log.e(TAG, "autoAccept: autoAccept = " + autoAccept);
|
||||
mViewDataBinding.setAutoAccept(!autoAccept);
|
||||
mMMKV.encode(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, !autoAccept);
|
||||
Intent intent = new Intent(WeAccessibilityService.SETTING_AUTOMATIC_ANSWER_ACTION);
|
||||
intent.putExtra("auto_answer", !autoAccept);
|
||||
sendBroadcast(intent);
|
||||
} else {
|
||||
boolean floatWindowEnable = mMMKV.decodeBool(CommonConfig.FLOAT_WINDOW, true);
|
||||
if (floatWindowEnable) {
|
||||
Toaster.showLong("因为系统限制,请先关闭悬浮窗功能,开启自动接听后再打开悬浮窗");
|
||||
} else {
|
||||
Toast.makeText(SettingActivity.this, "请在无障碍服务中打开 - 关爱守护快捷服务", Toast.LENGTH_LONG).show();
|
||||
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setDialTone(View view) {
|
||||
@@ -273,6 +294,10 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
||||
startActivity(new Intent(Settings.ACTION_SETTINGS));
|
||||
}
|
||||
|
||||
public void checkupdate(View view) {
|
||||
mViewModel.checkUpdate();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
package com.xxpatx.os.activity.setting;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.databinding.ActivitySettingBinding;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class SettingViewModel extends BaseViewModel<ActivitySettingBinding, ActivityEvent> {
|
||||
|
||||
@@ -15,4 +27,40 @@ public class SettingViewModel extends BaseViewModel<ActivitySettingBinding, Acti
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
private MutableLiveData<AppInfo> mAppInfoData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<AppInfo> getAppInfoData() {
|
||||
return mAppInfoData;
|
||||
}
|
||||
|
||||
public void checkUpdate() {
|
||||
NetInterfaceManager.getInstance().getUpdateObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdate", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppInfo> appInfoBaseResponse) {
|
||||
Log.e("checkUpdate", "onNext: " + appInfoBaseResponse);
|
||||
if (appInfoBaseResponse.code == 200) {
|
||||
AppInfo appInfo = appInfoBaseResponse.data;
|
||||
mAppInfoData.setValue(appInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdate", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdate", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.xxpatx.os.activity.update;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.databinding.ActivityUpdateBinding;
|
||||
import com.xxpatx.os.service.main.MainService;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
|
||||
import static com.arialyy.aria.core.inf.IEntity.STATE_RUNNING;
|
||||
|
||||
public class UpdateActivity extends BaseMvvmActivity<UpdateViewModel, ActivityUpdateBinding> {
|
||||
|
||||
private AppInfo mAppInfoData;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_update;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
Intent intent = getIntent();
|
||||
mAppInfoData = (AppInfo) intent.getSerializableExtra("appUpdateInfo");
|
||||
mViewDataBinding.setAppInfo(mAppInfoData);
|
||||
mViewDataBinding.setMsg("检测到新版本,是否更新");
|
||||
}
|
||||
|
||||
|
||||
public class BtnClick {
|
||||
public void empty(View view) {
|
||||
|
||||
}
|
||||
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
public void upgrade(View view) {
|
||||
startService(new Intent(UpdateActivity.this, MainService.class));
|
||||
if (mAppInfoData != null) {
|
||||
DownloadEntity entity = Aria.download(this).getFirstDownloadEntity(mAppInfoData.getApp_url());
|
||||
if (null != entity) {
|
||||
if (entity.isComplete()) {
|
||||
ApkUtils.installApp(UpdateActivity.this, entity.getFilePath());
|
||||
} else {
|
||||
if (entity.getState() == STATE_RUNNING) {
|
||||
Toaster.show("文件正在下载中");
|
||||
finish();
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
Toaster.show("正在下载");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ApkUtils.ariaDownload(UpdateActivity.this, mAppInfoData.getApp_url(), mAppInfoData);
|
||||
Toaster.show("正在下载更新");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.xxpatx.os.activity.update;
|
||||
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.databinding.ActivityUpdateBinding;
|
||||
|
||||
public class UpdateViewModel extends BaseViewModel<ActivityUpdateBinding, ActivityEvent> {
|
||||
|
||||
@Override
|
||||
public ActivityUpdateBinding getVDBinding() {
|
||||
return binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import com.xxpatx.os.databinding.ActivityWeatherBinding;
|
||||
import com.xxpatx.os.manager.AmapManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.utils.ActivationUtil;
|
||||
import com.xxpatx.os.utils.WiFiUtils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
@@ -172,7 +173,9 @@ public class WeatherViewModel extends BaseViewModel<ActivityWeatherBinding, Acti
|
||||
boolean activation = ActivationUtil.isActivation(getCtx());
|
||||
Log.e(TAG, "getweather: is_activation = " + activation);
|
||||
if (!activation) {
|
||||
if (WiFiUtils.getInstance().isNetworkConnected()) {
|
||||
Toaster.show("请先激活设备");
|
||||
}
|
||||
return;
|
||||
}
|
||||
getWeatherNow(location);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CallRecordAdapter extends RecyclerView.Adapter<CallRecordAdapter.Ho
|
||||
|
||||
private Context mContext;
|
||||
private List<RecordsInfo> mRecordsInfoList;
|
||||
private SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("MM/dd HH:mm:ss");
|
||||
private SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("HH:mm");
|
||||
|
||||
public void setRecordsInfoList(List<RecordsInfo> recordsInfoList) {
|
||||
this.mRecordsInfoList = recordsInfoList;
|
||||
@@ -63,13 +63,22 @@ public class CallRecordAdapter extends RecyclerView.Adapter<CallRecordAdapter.Ho
|
||||
switch (recordsInfo.getType()) {
|
||||
default:
|
||||
case CallLog.Calls.INCOMING_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_incoming));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_incoming));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.black));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
break;
|
||||
case CallLog.Calls.OUTGOING_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_outgoing));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_outgoing));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.black));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
break;
|
||||
case CallLog.Calls.MISSED_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_missed));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_missed));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.red));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.red));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.red));
|
||||
break;
|
||||
}
|
||||
holder.tv_time.setText(mSimpleDateFormat.format(new Date(recordsInfo.getDate())));
|
||||
|
||||
@@ -97,6 +97,15 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
return false;
|
||||
}
|
||||
});
|
||||
contactHolder.iv_clear.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnLongClick != null) {
|
||||
mOnLongClick.setOnLongClickListener(contact);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
contactHolder.tv_name.setText(contact.getName());
|
||||
if (DIALER_PACKAGE.equals(contact.getMobile())) {
|
||||
contactHolder.cl_contact.setVisibility(View.GONE);
|
||||
@@ -139,7 +148,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
NiceImageView iv_head2;
|
||||
TextView tv_name;
|
||||
TextView tv_phone;
|
||||
ImageView iv_sim;
|
||||
ImageView iv_sim, iv_clear;
|
||||
|
||||
public ContactHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -150,6 +159,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_phone = itemView.findViewById(R.id.tv_phone);
|
||||
iv_sim = itemView.findViewById(R.id.iv_sim);
|
||||
iv_clear = itemView.findViewById(R.id.iv_clear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.dialog.DailyAppDialog;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.service.NotificationService;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
|
||||
@@ -66,6 +67,16 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
// SendRunningApp(mContext);
|
||||
}
|
||||
});
|
||||
int size = NotificationService.getNotificationLength(dailyAppBean.getPackageName());
|
||||
if (size == 0) {
|
||||
holder.bg.setVisibility(View.GONE);
|
||||
} else if (size < 99) {
|
||||
holder.bg.setVisibility(View.VISIBLE);
|
||||
holder.bg.setText(String.valueOf(size));
|
||||
} else {
|
||||
holder.bg.setVisibility(View.VISIBLE);
|
||||
holder.bg.setText("99+");
|
||||
}
|
||||
}
|
||||
|
||||
private void SendRunningApp(Context context) {
|
||||
@@ -135,12 +146,14 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
ConstraintLayout root;
|
||||
ImageView iv_icon;
|
||||
TextView tv_name;
|
||||
TextView bg;
|
||||
|
||||
Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_icon = itemView.findViewById(R.id.iv_icon);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
bg = itemView.findViewById(R.id.bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,14 +91,9 @@ public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdap
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(mContext)) {
|
||||
Intent intent = new Intent(mContext, CallWechatActivity.class);
|
||||
intent.putExtra("WechatInfo", contact);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
Toast.makeText(mContext, "请在无障碍服务中打开 - 关爱守护快捷服务", Toast.LENGTH_LONG).show();
|
||||
mContext.startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,13 +23,12 @@ import com.xxpatx.os.manager.AmapManager;
|
||||
import com.xxpatx.os.manager.AppManager;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.manager.ConnectManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.push.PushManager;
|
||||
import com.xxpatx.os.service.main.MainService;
|
||||
import com.xxpatx.os.shortcut.ShortcutUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
import com.xxpatx.os.utils.JGYUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
import com.xxpatx.os.utils.WiFiUtils;
|
||||
|
||||
public class BaseApplication extends Application {
|
||||
@@ -69,11 +68,9 @@ public class BaseApplication extends Application {
|
||||
//切换至开发版服务
|
||||
HeConfig.switchToDevService();
|
||||
|
||||
RemoteManager.init(this);
|
||||
ConnectManager.init(this);
|
||||
AppStatusManager.init(this);
|
||||
NetInterfaceManager.init(this);
|
||||
JGYUtils.init(this);
|
||||
try {
|
||||
startService(new Intent(this, MainService.class));
|
||||
} catch (Exception e) {
|
||||
@@ -91,7 +88,7 @@ public class BaseApplication extends Application {
|
||||
public void onSuccess(String response) {
|
||||
Log.e("AliyunPush", "init cloudchannel success");
|
||||
Log.e("AliyunPush", "init cloudchannel success " + pushService.getDeviceId());
|
||||
String sn = RemoteManager.getInstance().getSerial();
|
||||
String sn = Utils.getSerial();
|
||||
if (TextUtils.isEmpty(sn)) {
|
||||
return;
|
||||
}
|
||||
|
||||
48
app/src/main/java/com/xxpatx/os/bean/ActivationBean.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.xxpatx.os.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ActivationBean implements Serializable {
|
||||
private static final long serialVersionUID = 930211633376920464L;
|
||||
|
||||
//是否激活 0否1是
|
||||
int is_activation;
|
||||
//激活码类型 0体验卡 1正式
|
||||
int code_type;
|
||||
//体验到期时间戳 单位秒 0代表没有时间限制
|
||||
long expire_time;
|
||||
//激活时间
|
||||
long activation_time;
|
||||
|
||||
public int getIs_activation() {
|
||||
return is_activation;
|
||||
}
|
||||
|
||||
public void setIs_activation(int is_activation) {
|
||||
this.is_activation = is_activation;
|
||||
}
|
||||
|
||||
public int getCode_type() {
|
||||
return code_type;
|
||||
}
|
||||
|
||||
public void setCode_type(int code_type) {
|
||||
this.code_type = code_type;
|
||||
}
|
||||
|
||||
public long getExpire_time() {
|
||||
return expire_time;
|
||||
}
|
||||
|
||||
public void setExpire_time(long expire_time) {
|
||||
this.expire_time = expire_time;
|
||||
}
|
||||
|
||||
public long getActivation_time() {
|
||||
return activation_time;
|
||||
}
|
||||
|
||||
public void setActivation_time(long activation_time) {
|
||||
this.activation_time = activation_time;
|
||||
}
|
||||
}
|
||||
235
app/src/main/java/com/xxpatx/os/bean/AppInfo.java
Normal file
@@ -0,0 +1,235 @@
|
||||
package com.xxpatx.os.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppInfo implements Serializable {
|
||||
private static final long serialVersionUID = 423463220624853188L;
|
||||
|
||||
private int app_id;
|
||||
private String app_name;
|
||||
private String app_package;
|
||||
private String app_version_name;
|
||||
private long app_version_code;
|
||||
private long app_size;
|
||||
private String app_desc;
|
||||
private String app_url;
|
||||
private String app_img;
|
||||
private String app_preview1;
|
||||
private String app_preview2;
|
||||
private String app_preview3;
|
||||
private String app_developer;
|
||||
private String app_downloads;
|
||||
private double app_score;
|
||||
private int app_category;
|
||||
private int app_subject;
|
||||
private int app_type;
|
||||
private int app_status;
|
||||
private int is_delete;
|
||||
private int is_update;
|
||||
private int is_silent;
|
||||
private String app_md5;
|
||||
private String createtime;
|
||||
|
||||
public int getApp_id() {
|
||||
return app_id;
|
||||
}
|
||||
|
||||
public void setApp_id(int app_id) {
|
||||
this.app_id = app_id;
|
||||
}
|
||||
|
||||
public String getApp_name() {
|
||||
return app_name;
|
||||
}
|
||||
|
||||
public void setApp_name(String app_name) {
|
||||
this.app_name = app_name;
|
||||
}
|
||||
|
||||
public String getApp_package() {
|
||||
return app_package;
|
||||
}
|
||||
|
||||
public void setApp_package(String app_package) {
|
||||
this.app_package = app_package;
|
||||
}
|
||||
|
||||
public String getApp_version_name() {
|
||||
return app_version_name;
|
||||
}
|
||||
|
||||
public void setApp_version_name(String app_version_name) {
|
||||
this.app_version_name = app_version_name;
|
||||
}
|
||||
|
||||
public long getApp_version_code() {
|
||||
return app_version_code;
|
||||
}
|
||||
|
||||
public void setApp_version_code(long app_version_code) {
|
||||
this.app_version_code = app_version_code;
|
||||
}
|
||||
|
||||
public long getApp_size() {
|
||||
return app_size;
|
||||
}
|
||||
|
||||
public void setApp_size(long app_size) {
|
||||
this.app_size = app_size;
|
||||
}
|
||||
|
||||
public String getApp_desc() {
|
||||
return app_desc;
|
||||
}
|
||||
|
||||
public void setApp_desc(String app_desc) {
|
||||
this.app_desc = app_desc;
|
||||
}
|
||||
|
||||
public String getApp_url() {
|
||||
return app_url;
|
||||
}
|
||||
|
||||
public void setApp_url(String app_url) {
|
||||
this.app_url = app_url;
|
||||
}
|
||||
|
||||
public String getApp_img() {
|
||||
return app_img;
|
||||
}
|
||||
|
||||
public void setApp_img(String app_img) {
|
||||
this.app_img = app_img;
|
||||
}
|
||||
|
||||
public String getApp_preview1() {
|
||||
return app_preview1;
|
||||
}
|
||||
|
||||
public void setApp_preview1(String app_preview1) {
|
||||
this.app_preview1 = app_preview1;
|
||||
}
|
||||
|
||||
public String getApp_preview2() {
|
||||
return app_preview2;
|
||||
}
|
||||
|
||||
public void setApp_preview2(String app_preview2) {
|
||||
this.app_preview2 = app_preview2;
|
||||
}
|
||||
|
||||
public String getApp_preview3() {
|
||||
return app_preview3;
|
||||
}
|
||||
|
||||
public void setApp_preview3(String app_preview3) {
|
||||
this.app_preview3 = app_preview3;
|
||||
}
|
||||
|
||||
public String getApp_developer() {
|
||||
return app_developer;
|
||||
}
|
||||
|
||||
public void setApp_developer(String app_developer) {
|
||||
this.app_developer = app_developer;
|
||||
}
|
||||
|
||||
public String getApp_downloads() {
|
||||
return app_downloads;
|
||||
}
|
||||
|
||||
public void setApp_downloads(String app_downloads) {
|
||||
this.app_downloads = app_downloads;
|
||||
}
|
||||
|
||||
public double getApp_score() {
|
||||
return app_score;
|
||||
}
|
||||
|
||||
public void setApp_score(double app_score) {
|
||||
this.app_score = app_score;
|
||||
}
|
||||
|
||||
public int getApp_category() {
|
||||
return app_category;
|
||||
}
|
||||
|
||||
public void setApp_category(int app_category) {
|
||||
this.app_category = app_category;
|
||||
}
|
||||
|
||||
public int getApp_subject() {
|
||||
return app_subject;
|
||||
}
|
||||
|
||||
public void setApp_subject(int app_subject) {
|
||||
this.app_subject = app_subject;
|
||||
}
|
||||
|
||||
public int getApp_type() {
|
||||
return app_type;
|
||||
}
|
||||
|
||||
public void setApp_type(int app_type) {
|
||||
this.app_type = app_type;
|
||||
}
|
||||
|
||||
public int getApp_status() {
|
||||
return app_status;
|
||||
}
|
||||
|
||||
public void setApp_status(int app_status) {
|
||||
this.app_status = app_status;
|
||||
}
|
||||
|
||||
public int getIs_delete() {
|
||||
return is_delete;
|
||||
}
|
||||
|
||||
public void setIs_delete(int is_delete) {
|
||||
this.is_delete = is_delete;
|
||||
}
|
||||
|
||||
public int getIs_update() {
|
||||
return is_update;
|
||||
}
|
||||
|
||||
public void setIs_update(int is_update) {
|
||||
this.is_update = is_update;
|
||||
}
|
||||
|
||||
public int getIs_silent() {
|
||||
return is_silent;
|
||||
}
|
||||
|
||||
public void setIs_silent(int is_silent) {
|
||||
this.is_silent = is_silent;
|
||||
}
|
||||
|
||||
public String getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public String getApp_md5() {
|
||||
return app_md5;
|
||||
}
|
||||
|
||||
public void setApp_md5(String app_md5) {
|
||||
this.app_md5 = app_md5;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class EditContactDialog extends AlertDialog {
|
||||
private ConstraintLayout clEdit, clDelete, clCancel;
|
||||
|
||||
private String mPhoneNumber;
|
||||
private boolean hideDelete = false;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -31,6 +32,9 @@ public class EditContactDialog extends AlertDialog {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
public void setHideDelete(boolean hideDelete) {
|
||||
this.hideDelete = hideDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -89,6 +93,11 @@ public class EditContactDialog extends AlertDialog {
|
||||
} else {
|
||||
|
||||
}
|
||||
if (hideDelete) {
|
||||
clDelete.setVisibility(View.GONE);
|
||||
} else {
|
||||
clDelete.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.xxpatx.os.dialog.DailyAppDialog;
|
||||
import com.xxpatx.os.dialog.ShortcutDialog;
|
||||
import com.xxpatx.os.manager.AppManager;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.service.NotificationService;
|
||||
import com.xxpatx.os.shortcut.ShortcutPkgInfo;
|
||||
@@ -126,14 +125,16 @@ public class AppListFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
if (mDesktopIcons.size() != CommonConfig.DESKTOP_LIST_SIZE) {
|
||||
mDesktopIcons.addAll(new ArrayList<>(Arrays.asList(new DesktopIcon[CommonConfig.DESKTOP_LIST_SIZE - mDesktopIcons.size()])));
|
||||
}
|
||||
//填充空数据
|
||||
// if (mDesktopIcons.size() != CommonConfig.DESKTOP_LIST_SIZE) {
|
||||
// mDesktopIcons.addAll(new ArrayList<>(Arrays.asList(new DesktopIcon[CommonConfig.DESKTOP_LIST_SIZE - mDesktopIcons.size()])));
|
||||
// }
|
||||
|
||||
gridLayout = rootView.findViewById(R.id.list);
|
||||
// if (mContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
// gridLayout.set(3, 3);
|
||||
// } else {
|
||||
gridLayout.set(3, 3);
|
||||
gridLayout.set(2, 3);
|
||||
// }
|
||||
|
||||
gridLayout.setGridAdapter(new MyGridLayout.GridAdatper() {
|
||||
@@ -146,6 +147,29 @@ public class AppListFragment extends BaseFragment {
|
||||
TextView tv = view.findViewById(R.id.tv);
|
||||
TextView bg = view.findViewById(R.id.bg);
|
||||
ConstraintLayout constraintLayout = view.findViewById(R.id.btn_booktag);
|
||||
switch (index % 6) {
|
||||
case 0:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround1));
|
||||
break;
|
||||
case 1:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround2));
|
||||
break;
|
||||
case 2:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround3));
|
||||
break;
|
||||
case 3:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround4));
|
||||
break;
|
||||
case 4:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround5));
|
||||
break;
|
||||
case 5:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround6));
|
||||
break;
|
||||
default:
|
||||
constraintLayout.setBackground(mContext.getDrawable(R.drawable.contact_card_backround1));
|
||||
}
|
||||
|
||||
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
||||
if (desktopIcon != null) {
|
||||
String pkg = desktopIcon.getPackage();
|
||||
@@ -233,7 +257,7 @@ public class AppListFragment extends BaseFragment {
|
||||
case "aios.exit":
|
||||
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
if (is_activation == 0) {
|
||||
RemoteManager.getInstance().openLauncher3();
|
||||
// RemoteManager.getInstance().openLauncher3();
|
||||
} else {
|
||||
startScreenLockActivity();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xxpatx.os.fragment.contact;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -37,6 +40,7 @@ import com.xxpatx.os.utils.TimeUtils;
|
||||
import com.xxpatx.os.view.EquallyDividedItemDecoration;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -206,6 +210,10 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
} else {
|
||||
// mViewDataBinding.clNodata.setVisibility(View.GONE);
|
||||
// mViewDataBinding.rvContact.setVisibility(View.VISIBLE);
|
||||
List<Contact> sim = getSIMContacts();
|
||||
if (sim.size() != 0) {
|
||||
contacts.addAll(sim);
|
||||
}
|
||||
}
|
||||
mContactAdapter.setContactList(contacts);
|
||||
}
|
||||
@@ -269,6 +277,31 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
mEditContactDialog.show();
|
||||
}
|
||||
|
||||
public static final String NAME = "name";
|
||||
public static final String NUMBER = "number";
|
||||
|
||||
private List<Contact> getSIMContacts() {
|
||||
List<Contact> contactList = new ArrayList<>();
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
// 获取Sims卡联系人
|
||||
Uri uri = Uri.parse("content://icc/adn");
|
||||
Cursor phoneCursor = resolver.query(uri, null, null, null, null);
|
||||
if (phoneCursor != null) {
|
||||
final int colName = phoneCursor.getColumnIndex(NAME);
|
||||
final int colNumber = phoneCursor.getColumnIndex(NUMBER);
|
||||
while (phoneCursor.moveToNext()) {
|
||||
String number = phoneCursor.getString(colNumber);
|
||||
// 当手机号码为空的或者为空字段 跳过当前循环
|
||||
String username = phoneCursor.getString(colName);
|
||||
Log.e(TAG, "getSIMContacts: number = " + number + " username = " + username);
|
||||
Contact contact = new Contact(username, number, true);
|
||||
contactList.add(contact);
|
||||
}
|
||||
phoneCursor.close();
|
||||
}
|
||||
return contactList;
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
|
||||
public void toAdd(View view) {
|
||||
|
||||
@@ -43,7 +43,6 @@ import com.xxpatx.os.bean.FamilyAddress;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.PhoneFragmentControlBinding;
|
||||
import com.xxpatx.os.manager.AmapManager;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.utils.BrightnessUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -351,20 +350,6 @@ public class ControlFragment extends BaseMvvmFragment<ControlViewModel, PhoneFra
|
||||
return "";
|
||||
}
|
||||
|
||||
private String getConnectWifiSsid() {
|
||||
// WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||
// WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//// //去掉带引号的字符串方法一
|
||||
//// String wifiInfo1 = wifiInfo.getSSID();
|
||||
//// if (wifiInfo1.contains("\"")) {
|
||||
//// wifiInfo1 = wifiInfo1.substring(1, wifiInfo1.length() - 1);
|
||||
//// }
|
||||
////去掉带引号的字符串方法二
|
||||
// String wifiSSID = wifiInfo.getSSID();
|
||||
// String wifiInfo1 = wifiSSID.replaceAll("\"", "");
|
||||
return RemoteManager.getInstance().getConnectWifiSsid();
|
||||
}
|
||||
|
||||
private BluetoothAdapter bluetoothAdapter;
|
||||
|
||||
private void getBluetooth() {
|
||||
@@ -873,15 +858,16 @@ public class ControlFragment extends BaseMvvmFragment<ControlViewModel, PhoneFra
|
||||
Log.e(TAG, "onProgressChanged: percentage = " + percentage);
|
||||
// tv_brightness.setText(percentage + "%");
|
||||
|
||||
if (RemoteManager.isServiceConnected()) {
|
||||
RemoteManager.getInstance().putSystemInt(Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
} else {
|
||||
Window window = getActivity().getWindow();
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
Log.e(TAG, "onProgressChanged: " + i / 255f);
|
||||
lp.screenBrightness = i / 255f;//0.0-1.0
|
||||
window.setAttributes(lp);
|
||||
}
|
||||
Settings.System.putInt(mCRv, Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
// if (RemoteManager.isServiceConnected()) {
|
||||
// RemoteManager.getInstance().putSystemInt();
|
||||
// } else {
|
||||
// Window window = getActivity().getWindow();
|
||||
// WindowManager.LayoutParams lp = window.getAttributes();
|
||||
// Log.e(TAG, "onProgressChanged: " + i / 255f);
|
||||
// lp.screenBrightness = i / 255f;//0.0-1.0
|
||||
// window.setAttributes(lp);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,6 @@ import com.xxpatx.os.bean.MapBean;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.FragmentHomeBinding;
|
||||
import com.xxpatx.os.dialog.SingleDialog;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.push.PushManager;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
@@ -435,7 +434,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
}
|
||||
|
||||
private void killBackgroundProcesses(String packageName) {
|
||||
RemoteManager.getInstance().killBackgroundProcesses(packageName);
|
||||
// RemoteManager.getInstance().killBackgroundProcesses(packageName);
|
||||
}
|
||||
|
||||
private void refreshMemory() {
|
||||
|
||||
@@ -163,6 +163,11 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
if (mEditContactDialog == null) {
|
||||
mEditContactDialog = new EditContactDialog(getContext());
|
||||
}
|
||||
if (contact.isSimContact()){
|
||||
mEditContactDialog.setHideDelete(true);
|
||||
}else {
|
||||
mEditContactDialog.setHideDelete(false);
|
||||
}
|
||||
mEditContactDialog
|
||||
.setPhoneNumber(contact.getMobile())
|
||||
.setOnClickBottomListener(new EditContactDialog.OnClickBottomListener() {
|
||||
@@ -193,8 +198,13 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
|
||||
public class BtnClick {
|
||||
public void add(View view) {
|
||||
boolean disableModify = mMMKV.decodeBool(CommonConfig.DISABLE_CONTACT_MODIFY, false);
|
||||
if (disableModify){
|
||||
Toaster.showLong("已禁用联系人修改");
|
||||
}else {
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import android.media.AudioAttributes;
|
||||
import android.media.SoundPool;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
@@ -18,6 +20,7 @@ import com.xxpatx.os.activity.selectnumber.SelectNumberActivity;
|
||||
import com.xxpatx.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.FragmentDialerNewBinding;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -80,6 +83,29 @@ public class DialerFragment extends BaseMvvmFragment<DialerViewModel, FragmentDi
|
||||
soundMap.put(9, soundPool.load(mContext, R.raw.s_9, 1));
|
||||
soundMap.put(10, soundPool.load(mContext, R.raw.s_x, 1));
|
||||
soundMap.put(11, soundPool.load(mContext, R.raw.s_j, 1));
|
||||
mViewDataBinding.etPhone.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
Log.e("initView", "beforeTextChanged: " + s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Log.e("initView", "onTextChanged: " + s);
|
||||
if ("*#*#4636#*#*".contentEquals(s)) {
|
||||
ApkUtils.openPackage(mContext, "com.android.settings", "com.android.settings.Settings$TestingSettingsActivity");
|
||||
}else if ("*#*#0011234#*#*".contentEquals(s)){
|
||||
ApkUtils.openPackage(mContext, "com.mediatek.factorymode", "com.mediatek.factorymode.FactoryMode");
|
||||
}else if ("*#*#0011231#*#*".contentEquals(s)){
|
||||
ApkUtils.openPackage(mContext, "com.android.agingtest", "com.android.agingtest.AgingTest");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
Log.e("initView", "afterTextChanged: " + s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,11 +201,11 @@ public class DialerFragment extends BaseMvvmFragment<DialerViewModel, FragmentDi
|
||||
}
|
||||
|
||||
public void call(View view) {
|
||||
if (Utils.hasSimCard(mContext)) {
|
||||
// if (Utils.hasSimCard(mContext)) {
|
||||
callNumber();
|
||||
} else {
|
||||
Toaster.show("请插入SIM卡");
|
||||
}
|
||||
// } else {
|
||||
// Toaster.show("请插入SIM卡");
|
||||
// }
|
||||
}
|
||||
|
||||
public void backSpace(View view) {
|
||||
@@ -200,9 +226,14 @@ public class DialerFragment extends BaseMvvmFragment<DialerViewModel, FragmentDi
|
||||
}
|
||||
|
||||
public void add(View view) {
|
||||
boolean disableModify = mMMKV.decodeBool(CommonConfig.DISABLE_CONTACT_MODIFY, false);
|
||||
if (disableModify) {
|
||||
Toaster.showLong("已禁用联系人修改");
|
||||
} else {
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.activity.main.MainActivity;
|
||||
import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
|
||||
@@ -35,11 +36,16 @@ public class AppStatusManager {
|
||||
this.add("com.android.documentsui");
|
||||
this.add("com.android.calculator2");
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.android.settings");
|
||||
}};
|
||||
|
||||
private static final Set<String> mExcludeApp = new HashSet<String>() {{
|
||||
this.add("com.android.contacts");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.mediatek.camera");
|
||||
}};
|
||||
|
||||
|
||||
private AppStatusManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
@@ -70,13 +76,13 @@ public class AppStatusManager {
|
||||
public void addHidedApp(String pkg) {
|
||||
this.hidedAppSet.add(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public void removeHidedApp(String pkg) {
|
||||
this.hidedAppSet.remove(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public List<DailyAppBean> getPackageList() {
|
||||
@@ -89,6 +95,9 @@ public class AppStatusManager {
|
||||
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
|
||||
for (ResolveInfo packageInfo : resolveinfoList) {
|
||||
String pkg = packageInfo.activityInfo.packageName;
|
||||
if (mExcludeApp.contains(pkg)) {
|
||||
continue;
|
||||
}
|
||||
if (hidedAppSet.contains(pkg)) {
|
||||
Log.e(TAG, "getPackageList: " + pkg);
|
||||
DailyAppBean appSelectBean = new DailyAppBean(packageInfo.activityInfo.loadLabel(pm).toString(),
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
package com.xxpatx.os.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.sn.IGetInfoInterface;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
public class RemoteManager {
|
||||
private static final String TAG = "RemoteManager";
|
||||
|
||||
private static final String SN_KEY = "sn_serial_key";
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static RemoteManager sInstance;
|
||||
private Context mContext;
|
||||
private static boolean mServiceConnected = false;
|
||||
|
||||
private IGetInfoInterface mIGetInfoInterface;
|
||||
private ServiceConnection mIGetInfoConnection;
|
||||
|
||||
private RemoteManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
mIGetInfoConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
Log.e(TAG, "onServiceConnected: mIGetInfoConnection");
|
||||
mIGetInfoInterface = IGetInfoInterface.Stub.asInterface(service);
|
||||
mServiceConnected = true;
|
||||
for (ConnectedListener listener : mListeners) {
|
||||
if (listener != null) {
|
||||
listener.onRemoteConnected();
|
||||
}
|
||||
}
|
||||
try {
|
||||
String sn = mIGetInfoInterface.getSerial();
|
||||
CrashReport.setDeviceModel(mContext, sn);
|
||||
mMMKV.encode(SN_KEY, sn);
|
||||
Log.e(TAG, "onServiceConnected: sn = " + sn);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
Log.e(TAG, "onServiceDisconnected: mIGetInfoConnection");
|
||||
mIGetInfoInterface = null;
|
||||
mServiceConnected = false;
|
||||
bindInfoService();
|
||||
}
|
||||
};
|
||||
bindInfoService();
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
Log.e(TAG, "init: ");
|
||||
sInstance = new RemoteManager(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static RemoteManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init RemoteManager first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static boolean isServiceConnected() {
|
||||
return mServiceConnected;
|
||||
}
|
||||
|
||||
public interface ConnectedListener {
|
||||
void onRemoteConnected();
|
||||
}
|
||||
|
||||
private static Set<ConnectedListener> mListeners = new CopyOnWriteArraySet<>();
|
||||
|
||||
public static void setListener(ConnectedListener listener) {
|
||||
mListeners.add(listener);
|
||||
if (mServiceConnected) {
|
||||
listener.onRemoteConnected();
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeListener(ConnectedListener listener) {
|
||||
mListeners.remove(listener);
|
||||
}
|
||||
|
||||
public void bindInfoService() {
|
||||
if (mIGetInfoInterface == null) {
|
||||
//这是连接aidl服务的代码
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.xxpatx.sn.IGetInfoInterface");
|
||||
intent.setPackage("com.xxpatx.sn");
|
||||
intent.setComponent(new ComponentName("com.xxpatx.sn", "com.xxpatx.sn.service.RemoteService"));
|
||||
mContext.bindService(intent, mIGetInfoConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 获取sn
|
||||
*/
|
||||
public String getSerial() {
|
||||
// if (BuildConfig.DEBUG) return "MTK13220282310";
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
return mIGetInfoInterface.getSerial();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getSerial: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return mMMKV.decodeString(SN_KEY, "");
|
||||
}
|
||||
|
||||
public boolean putSystemInt(String name, int value) {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
return mIGetInfoInterface.SystemPutInt(name, value);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "putSystemInt: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void killBackgroundProcesses(String pkg) {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
mIGetInfoInterface.killBackgroundProcesses(pkg);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
|
||||
public String getConnectWifiSsid() {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
return mIGetInfoInterface.getWifiSsid();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return "获取失败";
|
||||
}
|
||||
|
||||
public void openLauncher3() {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
mIGetInfoInterface.openLauncher3();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "openLauncher3: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultDesktop(String pkgName, String className) {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
mIGetInfoInterface.setDefaultDesktop(pkgName, className);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setDefaultDesktop: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,11 @@ import com.uiui.video.bean.VideoInfo;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.alarm.AlarmClockData;
|
||||
import com.xxpatx.os.alarm.AlarmUtils;
|
||||
import com.xxpatx.os.bean.ActivationBean;
|
||||
import com.xxpatx.os.bean.ActivityBean;
|
||||
import com.xxpatx.os.bean.AddressInfo;
|
||||
import com.xxpatx.os.bean.AlarmClockId;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.ArticleList;
|
||||
import com.xxpatx.os.bean.BaiduMapGeoBean;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
@@ -45,11 +47,11 @@ import com.xxpatx.os.disklrucache.CacheHelper;
|
||||
import com.xxpatx.os.gson.GsonUtils;
|
||||
import com.xxpatx.os.manager.ConnectManager;
|
||||
import com.xxpatx.os.manager.ConnectMode;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.api.amap.GeocodingApi;
|
||||
import com.xxpatx.os.network.api.qweather.LookupApi;
|
||||
import com.xxpatx.os.network.api.uiui.ActivityListApi;
|
||||
import com.xxpatx.os.network.api.uiui.AddressIndexApi;
|
||||
import com.xxpatx.os.network.api.uiui.AppUpdate;
|
||||
import com.xxpatx.os.network.api.uiui.AppUsageRecordApi;
|
||||
import com.xxpatx.os.network.api.uiui.ArticleCategorysListApi;
|
||||
import com.xxpatx.os.network.api.uiui.ArticleListApi;
|
||||
@@ -63,6 +65,7 @@ import com.xxpatx.os.network.api.uiui.GoodsTypeApi;
|
||||
import com.xxpatx.os.network.api.uiui.GoodsTypeListApi;
|
||||
import com.xxpatx.os.network.api.uiui.HealthCodeApi;
|
||||
import com.xxpatx.os.network.api.uiui.KnowledgeVideoListApi;
|
||||
import com.xxpatx.os.network.api.uiui.SnIsActivationApi;
|
||||
import com.xxpatx.os.network.api.uiui.contact.MailListAddApi;
|
||||
import com.xxpatx.os.network.api.uiui.contact.MailListDeleteApi;
|
||||
import com.xxpatx.os.network.api.uiui.RegionListApi;
|
||||
@@ -94,6 +97,7 @@ import com.xxpatx.os.network.api.uiui.sn.SosRecordApi;
|
||||
import com.xxpatx.os.network.api.uiui.sn.UpdateAddressApi;
|
||||
import com.xxpatx.os.network.api.uiui.sn.UpdateAlarmClockApi;
|
||||
import com.xxpatx.os.network.interceptor.RepeatRequestInterceptor;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -323,119 +327,119 @@ public class NetInterfaceManager {
|
||||
*/
|
||||
public Observable<BaseResponse<SnInfo>> getSnInfoControl() {
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.getSninfo(RemoteManager.getInstance().getSerial())
|
||||
.getSninfo(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<FamilyAddress>> getFamilyAddressControl() {
|
||||
return mRetrofit.create(FamilyAddressApi.class)
|
||||
.getFamilyAddress(RemoteManager.getInstance().getSerial())
|
||||
.getFamilyAddress(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<UserAvatarInfo>> getUserAvatarInfoControl() {
|
||||
return mRetrofit.create(UserInfoControl.class)
|
||||
.getUserAvatarInfo(RemoteManager.getInstance().getSerial())
|
||||
.getUserAvatarInfo(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getRunningAppObservable(String json) {
|
||||
return mRetrofit.create(RunNewApp.class)
|
||||
.sendRunningInfo(RemoteManager.getInstance().getSerial(), json)
|
||||
.sendRunningInfo(Utils.getSerial(), json)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<SystemSettings>> getsettingControl() {
|
||||
return mRetrofit.create(SettingApi.class)
|
||||
.getSetting(RemoteManager.getInstance().getSerial())
|
||||
.getSetting(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getSOSRecordObservable(String longitude, String latitude, String address) {
|
||||
return mRetrofit.create(SosRecordApi.class)
|
||||
.sendSosRecord(RemoteManager.getInstance().getSerial(), longitude, latitude, address)
|
||||
.sendSosRecord(Utils.getSerial(), longitude, latitude, address)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAlarmObservable(int id) {
|
||||
return mRetrofit.create(UpdateAlarmClockApi.class)
|
||||
.updateAlarm(RemoteManager.getInstance().getSerial(), id)
|
||||
.updateAlarm(Utils.getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateDesktopObservable(String jsonArray) {
|
||||
return mRetrofit.create(UpdateDesktopApi.class)
|
||||
.updateLayout(RemoteManager.getInstance().getSerial(), jsonArray)
|
||||
.updateLayout(Utils.getSerial(), jsonArray)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<NetDesktopIcon>>> getDesktopLayoutObservable() {
|
||||
return mRetrofit.create(GetDesktopApi.class)
|
||||
.getDesktopLayout(RemoteManager.getInstance().getSerial())
|
||||
.getDesktopLayout(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<GoodsList>> getGoodsListObservable() {
|
||||
return mRetrofit.create(GoodsListApi.class)
|
||||
.getGoodsList(RemoteManager.getInstance().getSerial())
|
||||
.getGoodsList(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<GoodsList>> getGoodsListObservable(int type) {
|
||||
return mRetrofit.create(GoodsTypeListApi.class)
|
||||
.getGoodsList(RemoteManager.getInstance().getSerial(), type)
|
||||
.getGoodsList(Utils.getSerial(), type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<CategoryBean>>> getCategorysObservable() {
|
||||
return mRetrofit.create(CategorysApi.class)
|
||||
.getArticleCategorys(RemoteManager.getInstance().getSerial())
|
||||
.getArticleCategorys(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArticleList>> getArticleListObservable() {
|
||||
return mRetrofit.create(ArticleListApi.class)
|
||||
.getArticleList(RemoteManager.getInstance().getSerial())
|
||||
.getArticleList(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArticleList>> getArticleListObservable(int id) {
|
||||
return mRetrofit.create(ArticleCategorysListApi.class)
|
||||
.getArticleList(RemoteManager.getInstance().getSerial(), id)
|
||||
.getArticleList(Utils.getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<Contact>>> getContactListObservable() {
|
||||
return mRetrofit.create(GetMailList.class)
|
||||
.getContact(RemoteManager.getInstance().getSerial())
|
||||
.getContact(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getAdminSnSettingObservable() {
|
||||
return mRetrofit.create(GetAdminSnSettingApi.class)
|
||||
.getAdminSnSetting(RemoteManager.getInstance().getSerial())
|
||||
.getAdminSnSetting(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAppIconObservable(String pkg, String label, int type) {
|
||||
return mRetrofit.create(UpdateAppIconApi.class)
|
||||
.appIconUpdate(RemoteManager.getInstance().getSerial(), pkg, type, label)
|
||||
.appIconUpdate(Utils.getSerial(), pkg, type, label)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -456,7 +460,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse> getMailListDeleteObservable(String id) {
|
||||
return mRetrofit.create(MailListDeleteApi.class)
|
||||
.deleteMailList(RemoteManager.getInstance().getSerial(), id)
|
||||
.deleteMailList(Utils.getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -476,7 +480,7 @@ public class NetInterfaceManager {
|
||||
public Observable<BaseResponse<List<AlarmClockData>>> getAlarmClockObservable() {
|
||||
return mRetrofit
|
||||
.create(AlarmClockApi.class)
|
||||
.getAlarmClock(RemoteManager.getInstance().getSerial(), 0)
|
||||
.getAlarmClock(Utils.getSerial(), 0)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -484,7 +488,7 @@ public class NetInterfaceManager {
|
||||
public Observable<BaseResponse<List<AlarmClockData>>> getAlarmClockObservable(int type) {
|
||||
return mRetrofit
|
||||
.create(AlarmClockApi.class)
|
||||
.getAlarmClock(RemoteManager.getInstance().getSerial(), type)
|
||||
.getAlarmClock(Utils.getSerial(), type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -496,6 +500,13 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<AlarmClockId>> getAlarmClockAddObservable(Map<String, String> params) {
|
||||
return mRetrofit.create(AlarmClockAddApi.class)
|
||||
.addAlarmClock(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getAlarmClockEditObservable(Map<String, String> params, MultipartBody.Part body) {
|
||||
return mRetrofit.create(AlarmClockEditApi.class)
|
||||
.editAlarmClock(params, body)
|
||||
@@ -505,28 +516,28 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<AlarmClockData>> getAlarmClockByIdObservable(int id) {
|
||||
return mRetrofit.create(AlarmClockQueryApi.class)
|
||||
.getAlarmClockById(RemoteManager.getInstance().getSerial(), id)
|
||||
.getAlarmClockById(Utils.getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> deleteAlarmClockObservable(int id) {
|
||||
return mRetrofit.create(AlarmClockDeleteApi.class)
|
||||
.alarmClockDelete(RemoteManager.getInstance().getSerial(), id)
|
||||
.alarmClockDelete(Utils.getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArrayList<VideoInfo>>> getLivenVideoListObservable() {
|
||||
return mRetrofit.create(LivenVideoListApi.class)
|
||||
.getLivenVideoList(RemoteManager.getInstance().getSerial())
|
||||
.getLivenVideoList(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArrayList<VideoInfo>>> getKnowledgeVideoListObservable() {
|
||||
return mRetrofit.create(KnowledgeVideoListApi.class)
|
||||
.getKnowledgeVideoList(RemoteManager.getInstance().getSerial())
|
||||
.getKnowledgeVideoList(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -540,7 +551,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<ServeBean>> getServeObservable() {
|
||||
return mRetrofit.create(ServeApi.class)
|
||||
.getServe(RemoteManager.getInstance().getSerial())
|
||||
.getServe(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -554,54 +565,68 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<WxpayBean>> getOrderPayObservable(String order_sn, String order_id) {
|
||||
return mRetrofit.create(OrderPayApi.class)
|
||||
.orderPay(RemoteManager.getInstance().getSerial(), order_sn, order_id, BuildConfig.APPLICATION_ID)
|
||||
.orderPay(Utils.getSerial(), order_sn, order_id, BuildConfig.APPLICATION_ID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getOrderPayCheckObservable(String order_sn, String order_id) {
|
||||
return mRetrofit.create(OrderPayCheckApi.class)
|
||||
.checkOrder(RemoteManager.getInstance().getSerial(), order_sn, order_id)
|
||||
.checkOrder(Utils.getSerial(), order_sn, order_id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<OrderIndexData>> getAllOrderObservable() {
|
||||
return mRetrofit.create(AllOrderApi.class)
|
||||
.getOrderIndex(RemoteManager.getInstance().getSerial())
|
||||
.getOrderIndex(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<OrderIndexData>> getOrderIndexObservable(int status) {
|
||||
return mRetrofit.create(OrderIndexApi.class)
|
||||
.getOrderIndex(RemoteManager.getInstance().getSerial(), status)
|
||||
.getOrderIndex(Utils.getSerial(), status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ExpressData>> getOrderExpressObservable(String order_sn, String order_id) {
|
||||
return mRetrofit.create(OrderExpressApi.class)
|
||||
.getOrderExpress(RemoteManager.getInstance().getSerial(), order_sn, order_id)
|
||||
.getOrderExpress(Utils.getSerial(), order_sn, order_id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<AddressInfo>>> getAddressIndexObservable() {
|
||||
return mRetrofit.create(AddressIndexApi.class)
|
||||
.getAddressList(RemoteManager.getInstance().getSerial())
|
||||
.getAddressList(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAddressObservable(String address, double longitude, double latitude) {
|
||||
return mRetrofit.create(UpdateAddressApi.class)
|
||||
.updateAddress(RemoteManager.getInstance().getSerial(), address, longitude, latitude)
|
||||
.updateAddress(Utils.getSerial(), address, longitude, latitude)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
public Observable<BaseResponse<ActivationBean>> getSnIsActivationObservable() {
|
||||
return mRetrofit.create(SnIsActivationApi.class)
|
||||
.getSnIsActivation(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<AppInfo>> getUpdateObservable() {
|
||||
return mRetrofit.create(AppUpdate.class)
|
||||
.getAppUpdate(BuildConfig.APPLICATION_ID, "0", 1)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public RegionListApi getRegionListApi() {
|
||||
return mRetrofit.create(RegionListApi.class);
|
||||
}
|
||||
@@ -616,7 +641,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<UserId>> getUserIDObservable() {
|
||||
return mRetrofit.create(GetUserIDApi.class)
|
||||
.getUserID(RemoteManager.getInstance().getSerial())
|
||||
.getUserID(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -683,7 +708,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<ActivityBean>>> getActivityListObservable() {
|
||||
return mRetrofit.create(ActivityListApi.class)
|
||||
.getActivityList(RemoteManager.getInstance().getSerial(), 1, 1, getUserId())
|
||||
.getActivityList(Utils.getSerial(), 1, 1, getUserId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -793,7 +818,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<DemandBean>>> getDemandListObservable() {
|
||||
return mRetrofit.create(DemandListApi.class)
|
||||
.getDemandList(RemoteManager.getInstance().getSerial(), 1, 1, getUserId())
|
||||
.getDemandList(Utils.getSerial(), 1, 1, getUserId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -913,7 +938,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<HealthCode>>> getHealthCodeObservable() {
|
||||
return mRetrofit.create(HealthCodeApi.class)
|
||||
.getArticleDetails(RemoteManager.getInstance().getSerial())
|
||||
.getArticleDetails(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ public class UrlAddress {
|
||||
* 新接口
|
||||
* SN
|
||||
*/
|
||||
/*获取设备是否激活*/
|
||||
public static final String GET_SN_IS_ACTIVATION = "sn/getSnIsActivation";
|
||||
/*爱心提醒通知成功接口*/
|
||||
public static final String UPDATE_ALARM_CLOCK = "updateAlarmClock";
|
||||
/*上传截屏图片*/
|
||||
@@ -33,7 +35,8 @@ public class UrlAddress {
|
||||
public static final String UPDATE_ADDRESS = "sn/update-address";
|
||||
/*获取设备家庭地址*/
|
||||
public static final String FAMILY_ADDRESS = "sn/family-address";
|
||||
|
||||
/*根据包名获取更新*/
|
||||
public final static String GET_NEWESTAPPUPDATE = "app/newestAppUpdate";
|
||||
|
||||
/*获取抢购列表*/
|
||||
public static final String GET_GOODS_LIST = "getGoodsList";
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.xxpatx.os.network.api.uiui;
|
||||
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppUpdate {
|
||||
@GET(UrlAddress.GET_NEWESTAPPUPDATE)
|
||||
Observable<BaseResponse<AppInfo>> getAppUpdate(
|
||||
@Query("packageName") String packageName,
|
||||
@Query("versionCode") String versionCode,
|
||||
@Query("type") int type
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xxpatx.os.network.api.uiui;
|
||||
|
||||
import com.xxpatx.os.bean.ActivationBean;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnIsActivationApi {
|
||||
@GET(UrlAddress.GET_SN_IS_ACTIVATION)
|
||||
Observable<BaseResponse<ActivationBean>> getSnIsActivation(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -20,4 +20,9 @@ public interface AlarmClockAddApi {
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
|
||||
@POST(UrlAddress.ALARM_CLOCK_ADD)
|
||||
Observable<BaseResponse<AlarmClockId>> addAlarmClock(
|
||||
@QueryMap Map<String, String> params
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,12 @@ public class NotificationService extends NotificationListenerService {
|
||||
StatusBarNotification[] statusBarNotifications = getActiveNotifications();
|
||||
for (StatusBarNotification sbn : statusBarNotifications) {
|
||||
String pkg = sbn.getPackageName();
|
||||
Log.e(TAG, "onListenerUpdate: " + pkg);
|
||||
if ("android".equals(pkg)
|
||||
|| "cn.etouch.ecalendar".equals(pkg)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
Log.e(TAG, "onListenerUpdate: pkg = " + pkg);
|
||||
if (notificationMap.get(pkg) == null) {
|
||||
notificationMap.put(pkg, new ArrayList<>());
|
||||
notificationMap.get(pkg).add(sbn);
|
||||
@@ -59,7 +64,7 @@ public class NotificationService extends NotificationListenerService {
|
||||
@Override
|
||||
public void onListenerConnected() {
|
||||
super.onListenerConnected();
|
||||
Log.e(TAG, "onListenerUpdate: " + getActiveNotifications().length);
|
||||
Log.e(TAG, "onListenerConnected: length = " + getActiveNotifications().length);
|
||||
updateNotification();
|
||||
for (NotificationListener listener : mListener) {
|
||||
listener.onListenerUpdate();
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WeAccessibilityService extends AccessibilityService {
|
||||
public static final int TYPE_VOICE = 0;
|
||||
public static final int TYPE_VIDEO = 1;
|
||||
|
||||
private static final int WAIT_TIME = 500;
|
||||
private static final int WAIT_TIME = 1000;
|
||||
|
||||
private int mCallType = TYPE_VOICE;
|
||||
|
||||
@@ -106,7 +106,6 @@ public class WeAccessibilityService extends AccessibilityService {
|
||||
|
||||
@Override
|
||||
public void onAccessibilityEvent(AccessibilityEvent event) {
|
||||
Log.e(TAG, "onAccessibilityEvent: ");
|
||||
Log.v(TAG, "onAccessibilityEvent: event = " + event.toString());
|
||||
if (finished) {
|
||||
finished = false;
|
||||
@@ -156,7 +155,6 @@ public class WeAccessibilityService extends AccessibilityService {
|
||||
break;
|
||||
case CLICK_TAG:
|
||||
step(Property.TEXT, mTagName, Step.CLICK_NAME);
|
||||
|
||||
break;
|
||||
case CLICK_NAME://点击item
|
||||
step(Property.TEXT, mName, Step.CLICK_INFO);
|
||||
@@ -164,7 +162,6 @@ public class WeAccessibilityService extends AccessibilityService {
|
||||
case CLICK_INFO://进入个人信息页面
|
||||
step(Property.TEXT, DIALER_TEXT, Step.CLICK_CALL);
|
||||
break;
|
||||
|
||||
case CLICK_CALL://打视频或者电话
|
||||
if (mCallType == TYPE_VIDEO) {
|
||||
step(Property.TEXT, VIDEO_TEXT, Step.WAITING);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xxpatx.os.service.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
@@ -11,8 +12,8 @@ import com.xxpatx.os.alarm.AlarmUtils;
|
||||
import com.xxpatx.os.bean.AlarmClockId;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -80,13 +81,47 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
addFinishStatu = 0;
|
||||
for (AlarmClockData alarmClockData : localAddAlarm) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("time", alarmClockData.getTime());
|
||||
params.put("type", String.valueOf(alarmClockData.getType()));
|
||||
params.put("title", alarmClockData.getTitle());
|
||||
params.put("remind_type", "0");
|
||||
params.put("is_onoff", "1");
|
||||
|
||||
if (TextUtils.isEmpty(alarmClockData.getFile())) {
|
||||
NetInterfaceManager.getInstance().getAlarmClockAddObservable(params)
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AlarmClockId>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("addAlarmClock", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AlarmClockId> alarmClockIdBaseResponse) {
|
||||
Log.e("addAlarmClock", "onNext: " + alarmClockIdBaseResponse);
|
||||
if (alarmClockIdBaseResponse.code == 200) {
|
||||
alarmClockData.setIs_local(false);
|
||||
AlarmUtils.getInstance().updateAlarmClock(alarmClockData, alarmClockIdBaseResponse.data.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("addAlarmClock", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
addFinishStatu += 1;
|
||||
Log.e("addAlarmClock", "onComplete: " + addFinishStatu);
|
||||
if (addFinishStatu == localAddAlarm.size()) {
|
||||
mView.addAlarmClockFinish();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
File picFile = new File(alarmClockData.getFile());
|
||||
MediaType mediaType = MediaType.Companion.parse("image/png");
|
||||
RequestBody requestBody = RequestBody.Companion.create(picFile, mediaType);
|
||||
@@ -125,30 +160,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
}
|
||||
});
|
||||
}
|
||||
// Observable.concat(getAddObservableList(localAddAlarm))
|
||||
// .compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
// .subscribe(new Observer<BaseResponse<AlarmClockId>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(@NonNull Disposable d) {
|
||||
// Log.e("addAlarmClock", "onSubscribe: ");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(@NonNull BaseResponse<AlarmClockId> baseResponse) {
|
||||
// Log.e("addAlarmClock", "onSubscribe: " + baseResponse);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(@NonNull Throwable e) {
|
||||
// Log.e("addAlarmClock", "onError: " + e.getMessage());
|
||||
// onComplete();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// Log.e("addAlarmClock", "onSubscribe: ");
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +180,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
private Observable<BaseResponse<AlarmClockId>> getAddObservable(AlarmClockData alarmClockData) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("time", alarmClockData.getTime());
|
||||
params.put("type", String.valueOf(alarmClockData.getType()));
|
||||
params.put("title", alarmClockData.getTitle());
|
||||
|
||||
@@ -21,6 +21,8 @@ import com.arialyy.annotations.Download;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.task.DownloadTask;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
@@ -31,19 +33,21 @@ import com.xxpatx.os.activity.noti.NoticeActivity;
|
||||
import com.xxpatx.os.alarm.AlarmClockData;
|
||||
import com.xxpatx.os.alarm.AlarmUtils;
|
||||
import com.xxpatx.os.base.rx.BaseRxService;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.manager.RemoteManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.receiver.SmsReceiver;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
import com.xxpatx.os.utils.CmdUtil;
|
||||
import com.xxpatx.os.utils.ForegroundAppUtil;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -350,7 +354,7 @@ public class MainService extends BaseRxService
|
||||
private static Observable<BaseResponse> getSendFile(String path, MultipartBody.Part body) {
|
||||
return NetInterfaceManager.getInstance()
|
||||
.getScreenshotApi()
|
||||
.sendScreenshot(RemoteManager.getInstance().getSerial(), body)
|
||||
.sendScreenshot(Utils.getSerial(), body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -466,7 +470,7 @@ public class MainService extends BaseRxService
|
||||
// AppUsedTimeUtils.getInstance().setEndTime(System.currentTimeMillis());
|
||||
if (!TextUtils.isEmpty(packagename)) {
|
||||
NetInterfaceManager.getInstance().getAppUsageRecordControl()
|
||||
.sendappUsageRecord(RemoteManager.getInstance().getSerial(),
|
||||
.sendappUsageRecord(Utils.getSerial(),
|
||||
ApkUtils.getAppNameByPackage(context, packagename),
|
||||
packagename,
|
||||
AppUsedTimeUtils.getInstance().getStartTime() / 1000,
|
||||
@@ -595,8 +599,8 @@ public class MainService extends BaseRxService
|
||||
mBallParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
mBallParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
// mBallParams.gravity = Gravity.TOP;
|
||||
int x = mMMKV.decodeInt(Float_Window_X, 0);
|
||||
int y = mMMKV.decodeInt(Float_Window_Y, 0);
|
||||
int x = mMMKV.decodeInt(Float_Window_X, 360);
|
||||
int y = mMMKV.decodeInt(Float_Window_Y, -783);
|
||||
mBallParams.x = x;
|
||||
mBallParams.y = y;
|
||||
mWindowManager.addView(mBallView, mBallParams);
|
||||
@@ -608,6 +612,7 @@ public class MainService extends BaseRxService
|
||||
for (String pkg : pkgList) {
|
||||
if (pkg.equalsIgnoreCase(BuildConfig.APPLICATION_ID)
|
||||
|| "com.xxpatx.sn".equals(pkg)
|
||||
|| "com.tencent.mm".equals(pkg)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -681,7 +686,8 @@ public class MainService extends BaseRxService
|
||||
lastY = nowY;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
|
||||
Log.e(TAG, "onTouch: x = " + mBallParams.x);
|
||||
Log.e(TAG, "onTouch: y = " + mBallParams.y);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -703,10 +709,34 @@ public class MainService extends BaseRxService
|
||||
void taskComplete(DownloadTask task) {
|
||||
// 在这里处理任务完成的状态
|
||||
Log.e(TAG, "taskComplete: " + task.getFilePath());
|
||||
String jsonString = task.getExtendField();
|
||||
Log.e(TAG, "taskComplete: " + "下载完成:" + jsonString);
|
||||
AppInfo ariaDownloadInfo = getAriaDownloadInfo(jsonString);
|
||||
if (ariaDownloadInfo != null) {
|
||||
ApkUtils.installApp(MainService.this, task.getFilePath());
|
||||
Toaster.show("下载完成: " + "\t" + ariaDownloadInfo.getApp_name());
|
||||
}
|
||||
}
|
||||
|
||||
@Download.onTaskFail
|
||||
void taskFail(DownloadTask task, Exception e) {
|
||||
|
||||
}
|
||||
|
||||
private AppInfo getAriaDownloadInfo(String jsonString) {
|
||||
if (!TextUtils.isEmpty(jsonString)) {
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<AppInfo>() {
|
||||
}.getType();
|
||||
AppInfo ariaDownloadInfo = null;
|
||||
try {
|
||||
ariaDownloadInfo = gson.fromJson(jsonString, type);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getAriaDownloadInfo: " + e.getMessage());
|
||||
}
|
||||
return ariaDownloadInfo;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,19 +19,27 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.activity.quickapp.QuickAppActivity;
|
||||
import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.DesktopIcon;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.gson.GsonUtils;
|
||||
import com.xxpatx.os.manager.AppManager;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.receiver.InstallResultReceiver;
|
||||
import com.xxpatx.os.shortcut.ShortcutPkgInfo;
|
||||
import com.xxpatx.os.shortcut.ShortcutUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.Collator;
|
||||
@@ -663,6 +671,141 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过路径安装APK,兼容Android 9以上
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param filePath apk文件路径
|
||||
*/
|
||||
public static void installApp(Context context, String filePath) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
installAppatPie(context, filePath);
|
||||
} else {
|
||||
installApps(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean installApps(String apkPath) {
|
||||
Toaster.show("正在安装应用");
|
||||
Process process = null;
|
||||
BufferedReader successResult = null;
|
||||
BufferedReader errorResult = null;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder errorMsg = new StringBuilder();
|
||||
try {
|
||||
process = new ProcessBuilder("pm", "install", "-i", BuildConfig.APPLICATION_ID, "--user", "0", apkPath).start();
|
||||
successResult = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
errorResult = new BufferedReader(new InputStreamReader(process.getErrorStream()));
|
||||
String s;
|
||||
while ((s = successResult.readLine()) != null) {
|
||||
successMsg.append(s);
|
||||
}
|
||||
while ((s = errorResult.readLine()) != null) {
|
||||
errorMsg.append(s);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("installApps1", e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (successResult != null) {
|
||||
successResult.close();
|
||||
}
|
||||
if (errorResult != null) {
|
||||
errorResult.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("installApps2", e.getMessage());
|
||||
}
|
||||
if (process != null) {
|
||||
process.destroy();
|
||||
}
|
||||
}
|
||||
Log.e("result", "" + errorMsg.toString());
|
||||
//如果含有“success”认为安装成功
|
||||
Log.e("installApp", successMsg.toString());
|
||||
// if (!successMsg.toString().equalsIgnoreCase("success")) {
|
||||
// install(context, new File(apkPath));
|
||||
// }
|
||||
return successMsg.toString().equalsIgnoreCase("success");
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public static void installAppatPie(Context context, String apkFilePath) {
|
||||
File file = new File(apkFilePath);
|
||||
PackageInstaller packageInstaller = context.getPackageManager().getPackageInstaller();
|
||||
PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams(PackageInstaller
|
||||
.SessionParams.MODE_FULL_INSTALL);
|
||||
sessionParams.setSize(file.length());
|
||||
int sessionId = createSession(packageInstaller, sessionParams);
|
||||
if (sessionId != -1) {
|
||||
boolean copySuccess = copyApkFile(packageInstaller, sessionId, apkFilePath);
|
||||
if (copySuccess) {
|
||||
install(packageInstaller, sessionId, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private static boolean copyApkFile(PackageInstaller pi, int sessionId, String apkFilePath) {
|
||||
boolean success = false;
|
||||
File apkFile = new File(apkFilePath);
|
||||
PackageInstaller.Session session = null;
|
||||
try {
|
||||
session = pi.openSession(sessionId);
|
||||
OutputStream out = session.openWrite("app.apk", 0, apkFile.length());
|
||||
FileInputStream input = new FileInputStream(apkFile);
|
||||
int read = 0;
|
||||
byte[] buffer = new byte[65536];
|
||||
// while (read != -1) {
|
||||
// read = input.read(buffer);
|
||||
// out.write(buffer, 0, read);
|
||||
// }
|
||||
while (true) {
|
||||
read = input.read(buffer);
|
||||
if (read == -1) {
|
||||
session.fsync(out);
|
||||
success = true;
|
||||
out.close();
|
||||
input.close();
|
||||
break;
|
||||
}
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("fht", "copyApkFile" + e.getMessage());
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private static void install(PackageInstaller packageInstaller, int sessionId, Context context) {
|
||||
try {
|
||||
PackageInstaller.Session session = packageInstaller.openSession(sessionId);
|
||||
Intent intent = new Intent(context, InstallResultReceiver.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
||||
context,
|
||||
1, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
);
|
||||
session.commit(pendingIntent.getIntentSender());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private static int createSession(PackageInstaller packageInstaller, PackageInstaller.SessionParams sessionParams) {
|
||||
int sessionId = -1;
|
||||
try {
|
||||
sessionId = packageInstaller.createSession(sessionParams);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 静默卸载应用
|
||||
*
|
||||
@@ -764,4 +907,65 @@ public class ApkUtils {
|
||||
return uid / PER_USER_RANGE;
|
||||
}
|
||||
|
||||
public static boolean checkAppUpdate(Context context, AppInfo appUpdateInfo) {
|
||||
String packageName = appUpdateInfo.getApp_package();
|
||||
long versionCode = appUpdateInfo.getApp_version_code();
|
||||
return checkAppUpdate(context, packageName, versionCode);
|
||||
}
|
||||
|
||||
public static boolean checkAppUpdate(Context context, String packageName, long versionCode) {
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (packageInfo == null) {
|
||||
return true;
|
||||
} else {
|
||||
long appVersionCode;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
appVersionCode = packageInfo.getLongVersionCode();
|
||||
} else {
|
||||
appVersionCode = packageInfo.versionCode;
|
||||
}
|
||||
if (appVersionCode < versionCode) {
|
||||
return true;
|
||||
} else {
|
||||
Log.e(TAG, "checkUpdate: " + packageName + "\t已经是最新版");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void ariaDownload(Context context, String url, AppInfo ariaDownloadInfo) {
|
||||
Log.e(TAG, "ariaDownload: " + ariaDownloadInfo);
|
||||
String fileName = Utils.getFileNamefromURL(url);
|
||||
String app_md5 = ariaDownloadInfo.getApp_md5();
|
||||
Log.e("ariaDownload", "app_md5 = " + app_md5);
|
||||
File file = new File(Utils.getDownLoadPath(context) + fileName);
|
||||
if (file.exists() && !file.isDirectory()) {
|
||||
String fileMd5 = com.blankj.utilcode.util.FileUtils.getFileMD5ToString(file);
|
||||
Log.e("ariaDownload", "fileMD5 = " + fileMd5);
|
||||
if (fileMd5.equalsIgnoreCase(app_md5)) {
|
||||
installApp(context, file.getAbsolutePath());
|
||||
} else {
|
||||
file.delete();
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(Utils.getDownLoadPath(context) + fileName)
|
||||
.ignoreFilePathOccupy()
|
||||
.setExtendField(GsonUtils.toJSONString(ariaDownloadInfo))
|
||||
.create(); //启动下载}
|
||||
}
|
||||
} else {
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(Utils.getDownLoadPath(context) + fileName)
|
||||
.ignoreFilePathOccupy()
|
||||
.setExtendField(GsonUtils.toJSONString(ariaDownloadInfo))
|
||||
.create(); //启动下载}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.xxpatx.os.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.os.PowerManager;
|
||||
|
||||
|
||||
public class JGYUtils {
|
||||
private static final String TAG = "JGYUtils";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static JGYUtils sInstance;
|
||||
private Context mContext;
|
||||
private ContentResolver resolver;
|
||||
|
||||
private JGYUtils(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
this.resolver = mContext.getContentResolver();
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new JGYUtils(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static JGYUtils getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init JGYUtils first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public boolean isScreenOn() {
|
||||
PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
//true为打开,false为关闭
|
||||
return powerManager.isInteractive();
|
||||
}
|
||||
}
|
||||
@@ -221,5 +221,21 @@ public class WiFiUtils {
|
||||
return mWifi.getState() == NetworkInfo.State.CONNECTED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断网络连接状态
|
||||
*
|
||||
* @return true:网络已链接, false:网络已断开连接
|
||||
*/
|
||||
public boolean isNetworkConnected() {
|
||||
if (mContext != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) mContext
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo mNetworkInfo = mConnectivityManager
|
||||
.getActiveNetworkInfo();
|
||||
if (mNetworkInfo != null) {
|
||||
return mNetworkInfo.isAvailable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
|
||||
@@ -19,6 +20,7 @@ import com.facebook.rebound.SpringUtil;
|
||||
import com.xxpatx.os.R;
|
||||
|
||||
public class ToggleButton extends View {
|
||||
private static final String TAG = "ToggleButton";
|
||||
private SpringSystem springSystem;
|
||||
private Spring spring;
|
||||
/**
|
||||
@@ -28,11 +30,11 @@ public class ToggleButton extends View {
|
||||
/**
|
||||
* 开启颜色
|
||||
*/
|
||||
private int onColor = Color.parseColor("#f62626");
|
||||
private int onColor = Color.parseColor("#32CD32");
|
||||
/**
|
||||
* 关闭颜色
|
||||
*/
|
||||
private int offBorderColor = Color.parseColor("#e7e4e4");
|
||||
private int offBorderColor = Color.parseColor("#f62626");
|
||||
/**
|
||||
* 灰色带颜色
|
||||
*/
|
||||
@@ -168,6 +170,7 @@ public class ToggleButton extends View {
|
||||
|
||||
public void toggle(boolean animate) {
|
||||
toggleOn = !toggleOn;
|
||||
Log.e(TAG, "toggle: toggleOn = " + toggleOn);
|
||||
takeEffect(animate);
|
||||
if (listener != null) {
|
||||
listener.onToggle(toggleOn);
|
||||
@@ -216,6 +219,7 @@ public class ToggleButton extends View {
|
||||
}
|
||||
|
||||
public int isToggleOn() {
|
||||
Log.e(TAG, "isToggleOn: " + toggleOn);
|
||||
return toggleOn ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_call_incoming.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_call_missed.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_call_outgoing.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 903 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_location_refresh.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_menu.png
Normal file
|
After Width: | Height: | Size: 689 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_record_remove.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 857 B |
BIN
app/src/main/res/drawable-hdpi/icon_sos_dialer.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#5b5b5c" />
|
||||
<solid android:color="#E3E3E3" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
android:color="@color/red" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="20dp"
|
||||
android:topRightRadius="20dp"
|
||||
android:bottomLeftRadius="20dp"
|
||||
android:bottomRightRadius="20dp" />
|
||||
android:topLeftRadius="24dp"
|
||||
android:topRightRadius="24dp"
|
||||
android:bottomLeftRadius="24dp"
|
||||
android:bottomRightRadius="24dp" />
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/dialog_background.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ffffff" />
|
||||
<stroke
|
||||
android:width="0.8dp"
|
||||
android:color="#ffffff" />
|
||||
<!-- 圆角 -->
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/sos_dialer_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/sos_text_color" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="4dp"-->
|
||||
<!-- android:left="12dp"-->
|
||||
<!-- android:right="12dp"-->
|
||||
<!-- android:top="4dp" />-->
|
||||
</shape>
|
||||
17
app/src/main/res/drawable/tv_activation_normnl.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#E84446" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="4dp"
|
||||
android:bottomRightRadius="4dp"
|
||||
android:topLeftRadius="4dp"
|
||||
android:topRightRadius="4dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="8dp"
|
||||
android:left="12dp"
|
||||
android:right="12dp"
|
||||
android:top="8dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/update_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="32dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="6dp"
|
||||
android:left="32dp"
|
||||
android:right="32dp"
|
||||
android:top="6dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/update_cancel_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/lightGray" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="32dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="6dp"
|
||||
android:left="32dp"
|
||||
android:right="32dp"
|
||||
android:top="6dp" />
|
||||
</shape>
|
||||
84
app/src/main/res/layout/activity_activation.xml
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.activation.ActivationActivity">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.activity.activation.ActivationActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{click::exit}">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.5">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_activation"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:gravity="center"
|
||||
android:maxLength="13"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="请先激活设备后使用"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_activation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@drawable/tv_activation_normnl"
|
||||
android:onClick="@{click::activation}"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="激活设备"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/et_activation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:background="@drawable/tv_activation_normnl"
|
||||
android:onClick="@{click::openWifi}"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="WiFi设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bt_activation" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -264,6 +264,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="#FAF8F8"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="64dp"
|
||||
android:background="@drawable/general_setting_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -88,7 +90,8 @@
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:onClick="@{click::selectPic}"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:is_circle="true"
|
||||
@@ -105,8 +108,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="保存至本机"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -145,8 +148,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -163,8 +166,8 @@
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -203,8 +206,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="号码"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -221,8 +224,8 @@
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -242,8 +245,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="设为紧急联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#404146">
|
||||
android:background="#FAF8F8">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="64dp"
|
||||
android:background="@drawable/general_setting_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -116,8 +117,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -134,8 +135,8 @@
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -174,8 +175,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="号码"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -192,8 +193,8 @@
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -232,8 +233,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="微信"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -251,8 +252,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -272,8 +273,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="设为紧急联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -289,6 +290,35 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="8dp"
|
||||
android:background="@drawable/add_wechat_contact_background">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="保存到SIM卡"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.xxpatx.os.view.ToggleButton
|
||||
android:id="@+id/tb_sim"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
|
||||
@@ -122,9 +122,11 @@
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@null"
|
||||
android:backgroundTint="#4880FF"
|
||||
android:onClick="@{click::add}"
|
||||
android:src="@drawable/fb_alarm_add"
|
||||
app:borderWidth="0dp"
|
||||
app:fabCustomSize="80dp"
|
||||
app:layout_behavior="com.xxpatx.os.view.FAB_Float_on_Scroll" />
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.activity.dailyapp.DailyAppActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -26,6 +29,7 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:onClick="@{click::exit}"
|
||||
android:src="@drawable/exit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -18,12 +18,13 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#404146">
|
||||
android:background="#FAF8F8">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="64dp"
|
||||
android:background="@drawable/general_setting_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -137,8 +138,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -156,8 +157,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{contact.name}"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -196,8 +197,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="号码"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -215,8 +216,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{contact.mobile}"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -255,8 +256,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="微信"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -274,8 +275,8 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{contact.tag}"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/ok_button"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -295,8 +296,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="设为紧急联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -6,25 +6,43 @@
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.activity.emergency.EmergencyActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView18"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_sos"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:gravity="center"
|
||||
android:text="紧急呼叫功能已开启"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/sos_text_color"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_countdown"
|
||||
@@ -32,7 +50,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="倒计时(3)秒"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/sos_text_color"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
@@ -45,7 +63,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="将自动呼叫以下号码"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/sos_text_color"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
@@ -55,11 +73,11 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_finish"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
android:layout_height="160dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout7"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4"
|
||||
tools:layout_editor_absoluteX="32dp"
|
||||
tools:listitem="@layout/item_sosnumber" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_finish"
|
||||
@@ -69,11 +87,35 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/close"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:background="@drawable/sos_dialer_background"
|
||||
android:onClick="@{click::call}"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView19"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/icon_sos_dialer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -44,7 +44,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -71,17 +71,37 @@
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{click::dialer}">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon0"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_dialer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="24dp"
|
||||
android:text="9"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon0"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname10"
|
||||
@@ -106,14 +126,32 @@
|
||||
android:id="@+id/iv_icon1"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_wechat"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="24dp"
|
||||
android:text="9"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon1"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname1"
|
||||
@@ -138,14 +176,31 @@
|
||||
android:id="@+id/iv_icon2"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_tiktok"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="24dp"
|
||||
android:text="9"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon2"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname2"
|
||||
@@ -170,13 +225,14 @@
|
||||
android:id="@+id/iv_icon3"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/com_android_camera"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname3"
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
<variable
|
||||
name="dial_tone"
|
||||
type="Boolean" />
|
||||
|
||||
<variable
|
||||
name="versionName"
|
||||
type="String" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -46,7 +50,7 @@
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="通用设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -92,7 +96,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="悬浮按钮"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -106,7 +110,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{float_window_enable?"已开启":"未开启"}'
|
||||
android:textColor="@{float_window_enable?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -131,9 +135,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
android:text="语音播报"
|
||||
android:text="短信语音播报"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -143,11 +147,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:onClick="@{click::testTts}"
|
||||
android:maxLines="1"
|
||||
android:text='@{voice_broadcast?"已开启":"未开启"}'
|
||||
android:textColor="@{voice_broadcast?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -171,9 +174,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
android:text="自动接听"
|
||||
android:text="微信自动接听"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -187,7 +190,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{auto_accept?"已开启":"未开启"}'
|
||||
android:textColor="@{auto_accept?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -213,7 +216,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="拨号提示音"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -227,7 +230,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{dial_tone?"已开启":"未开启"}'
|
||||
android:textColor="@{dial_tone?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -254,7 +257,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="网络设置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -267,7 +270,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="未开启"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -304,7 +307,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="亮度字体设置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -317,7 +320,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="未开启"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -354,7 +357,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="防误触设置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -367,7 +370,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="未开启"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -404,7 +407,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="系统其他设置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -417,7 +420,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="未开启"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="28sp"
|
||||
android:textSize="25sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -442,6 +445,55 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:onClick="@{click::checkupdate}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
android:text="检测更新"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="@{versionName}"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="23sp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/imageView13"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView13"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_more"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/lightGray"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="防止误触设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -88,7 +88,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="音量键禁用"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -102,7 +102,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{disable_key?"已开启":"未开启"}'
|
||||
android:textColor="@{disable_key?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -128,7 +128,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="修改联系人禁用"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -142,7 +142,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{disable_contact?"已开启":"未开启"}'
|
||||
android:textColor="@{disable_contact?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -168,7 +168,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="设置访问禁用"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -182,7 +182,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="未开启"
|
||||
android:textColor="@color/setting_disable_color"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -207,7 +207,7 @@
|
||||
android:maxLines="1"
|
||||
android:text="闹钟设置禁用"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -221,7 +221,7 @@
|
||||
android:maxLines="1"
|
||||
android:text='@{disable_clock?"已开启":"未开启"}'
|
||||
android:textColor="@{disable_clock?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="28sp"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
164
app/src/main/res/layout/activity_update.xml
Normal file
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.update.UpdateActivity">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="appInfo"
|
||||
type="com.xxpatx.os.bean.AppInfo" />
|
||||
|
||||
<variable
|
||||
name="msg"
|
||||
type="String" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.activity.update.UpdateActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/dialog_background"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:src="@drawable/icon_close"
|
||||
android:layout_height="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:onClick="@{click::exit}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="检查更新"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:minHeight="50dp"
|
||||
android:minLines="2"
|
||||
android:text="@{msg}"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="提示消息提示消息提示消息提示消息提示消息" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@{appInfo.app_version_name}"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/negtive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/update_cancel_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click.exit}"
|
||||
android:singleLine="true"
|
||||
android:text="取消"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/positive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/update_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click.upgrade}"
|
||||
android:singleLine="true"
|
||||
android:text="更新"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -13,6 +13,13 @@
|
||||
<variable
|
||||
name="Contact"
|
||||
type="com.xxpatx.os.bean.Contact" />
|
||||
|
||||
<variable
|
||||
name="tag"
|
||||
type="Boolean" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -209,7 +216,8 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/icon_wechat_call_voice"
|
||||
android:onClick="@{click::callWechatVoice}">
|
||||
android:onClick="@{click::callWechatVoice}"
|
||||
android:visibility="@{tag==true?View.VISIBLE:View.GONE}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -218,8 +226,8 @@
|
||||
android:singleLine="true"
|
||||
android:text="拨打微信语音"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -233,7 +241,8 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/icon_wechat_call_video"
|
||||
android:onClick="@{click::callWechatVideo}">
|
||||
android:onClick="@{click::callWechatVideo}"
|
||||
android:visibility="@{tag==true?View.VISIBLE:View.GONE}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -242,8 +251,8 @@
|
||||
android:singleLine="true"
|
||||
android:text="拨打微信视频"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -266,8 +275,8 @@
|
||||
android:singleLine="true"
|
||||
android:text="拨打电话"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -290,8 +299,8 @@
|
||||
android:singleLine="true"
|
||||
android:text="取消"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="633dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.xxpatx.os.view.MyGridLayout
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
@@ -57,4 +65,6 @@
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -22,6 +22,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -66,7 +67,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="#F7F7F7"
|
||||
android:background="#FAF8F8"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout17"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -78,6 +79,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
tools:listitem="@layout/item_contact"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
android:id="@+id/cl_weather"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="165dp"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{click::openCalendar}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -92,6 +92,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -43,7 +44,7 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_delete"
|
||||
android:src="@drawable/icon_menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -54,6 +55,8 @@
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="#FAF8F8"
|
||||
tools:listitem="@layout/item_call_record"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -284,26 +284,39 @@
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="144dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/setting_card_location_background"
|
||||
android:background="@drawable/card_location_background"
|
||||
android:onClick="@{click::getAddress}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/cl_contact">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView14"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::getAddress}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_location_refresh"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="3"
|
||||
android:text="我的位置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="22sp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="19sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/imageView14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -8,22 +8,34 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_call_incoming"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="80dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_state"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -39,7 +51,7 @@
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -50,7 +62,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/noti_font_color"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
@@ -70,26 +82,12 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_incoming"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_remove"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_remove"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/icon_remove"
|
||||
android:src="@drawable/icon_record_remove"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="8dp"
|
||||
android:background="@drawable/contact_adapter_bg"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -21,16 +19,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sim"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/sim_card"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="80dp"
|
||||
@@ -42,15 +30,14 @@
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_sim"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_clear"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head">
|
||||
|
||||
@@ -61,7 +48,7 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="22sp"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -76,11 +63,37 @@
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="phone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sim"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/sim_card"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clear"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.322" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
@@ -97,5 +110,11 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -43,9 +43,11 @@
|
||||
app:layout_constraintVertical_bias="0.126" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_head">
|
||||
@@ -57,7 +59,7 @@
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="36sp"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -13,15 +13,33 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="24dp"
|
||||
android:text="9"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
|
||||
@@ -15,26 +15,29 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minEms="4"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="@color/sos_text_color"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="拨号" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minEms="11"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/sos_text_color"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_name"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="21321331" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -27,7 +27,10 @@
|
||||
<color name="progress_bg">#F1B3B3</color>
|
||||
<color name="actions_item_pressed">#2a2b35</color>
|
||||
<color name="default_background_color">#8e6afb</color>
|
||||
|
||||
<color name="main_default_text_gray">#808080</color>
|
||||
<color name="NormalCircleColor">#99FFFFFF</color>
|
||||
<color name="SelectedCircleColor">#ffffff</color>
|
||||
<color name="sos_text_color">#ff5257</color>
|
||||
|
||||
<color name="voice_color">#00D56B</color>
|
||||
<color name="weathet_bg_color">#ffffff</color>
|
||||
@@ -41,7 +44,7 @@
|
||||
<color name="app_bg_color">#FDF6DC</color>
|
||||
|
||||
<color name="noti_color">#eae8e8</color>
|
||||
<color name="noti_font_color">#bbbaba</color>
|
||||
<color name="noti_font_color">#B5B5B5</color>
|
||||
<color name="line_color">#182237</color>
|
||||
<color name="title_gray">#858585</color>
|
||||
<color name="title_red">#F44250</color>
|
||||
|
||||