version:1.1.5
update: bugfixes:优化闹钟自动接听
This commit is contained in:
@@ -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) {
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
startActivity(intent);
|
||||
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)) {
|
||||
callNumber();
|
||||
} else {
|
||||
Toaster.show("请插入SIM卡");
|
||||
}
|
||||
// if (Utils.hasSimCard(mContext)) {
|
||||
callNumber();
|
||||
// } else {
|
||||
// Toaster.show("请插入SIM卡");
|
||||
// }
|
||||
}
|
||||
|
||||
public void backSpace(View view) {
|
||||
@@ -200,8 +226,13 @@ public class DialerFragment extends BaseMvvmFragment<DialerViewModel, FragmentDi
|
||||
}
|
||||
|
||||
public void add(View view) {
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
startActivity(intent);
|
||||
boolean disableModify = mMMKV.decodeBool(CommonConfig.DISABLE_CONTACT_MODIFY, false);
|
||||
if (disableModify) {
|
||||
Toaster.showLong("已禁用联系人修改");
|
||||
} else {
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user