version:1.0.0
fix: update:修改样式图标
@@ -127,7 +127,6 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
contactHolder.cl_contact.setVisibility(View.GONE);
|
||||
contactHolder.iv_head2.setVisibility(View.VISIBLE);
|
||||
contactHolder.tv_phone.setText("");
|
||||
Glide.with(contactHolder.iv_head).load(R.drawable.home_dialer_icon_circle).error(R.drawable.home_dialer_icon_circle).into(contactHolder.iv_head);
|
||||
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
||||
Glide.with(contactHolder.iv_head).load(R.drawable.icon_contact_add).error(R.drawable.icon_contact_add).into(contactHolder.iv_head);
|
||||
} else {
|
||||
@@ -172,7 +171,6 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
root = itemView.findViewById(R.id.root);
|
||||
cl_contact = itemView.findViewById(R.id.cl_contact);
|
||||
iv_head = itemView.findViewById(R.id.iv_head);
|
||||
iv_head2 = itemView.findViewById(R.id.iv_head2);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_phone = itemView.findViewById(R.id.tv_phone);
|
||||
iv_sim = itemView.findViewById(R.id.iv_sim);
|
||||
|
||||
@@ -19,8 +19,8 @@ import com.vscool.os.activity.contact.ContactListActivity;
|
||||
import com.vscool.os.activity.service.ServiceActivity;
|
||||
import com.vscool.os.bean.DailyAppBean;
|
||||
import com.vscool.os.config.CommonConfig;
|
||||
import com.vscool.os.config.PackagesName;
|
||||
import com.vscool.os.dialog.DailyAppDialog;
|
||||
import com.vscool.os.manager.AppManager;
|
||||
import com.vscool.os.manager.AppStatusManager;
|
||||
import com.vscool.os.service.NotificationService;
|
||||
import com.vscool.os.utils.ApkUtils;
|
||||
@@ -50,16 +50,7 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
DailyAppBean dailyAppBean = mDailyAppBeans.get(position);
|
||||
String packageName = dailyAppBean.getPackageName();
|
||||
switch (packageName) {
|
||||
case AppManager.SERVICE_PACKAGE:
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_wechat_service));
|
||||
break;
|
||||
case AppManager.CONTACT_PACKAGE:
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.com_android_contacts));
|
||||
break;
|
||||
default:
|
||||
holder.iv_icon.setImageDrawable(dailyAppBean.getIcon(mContext));
|
||||
}
|
||||
holder.iv_icon.setImageDrawable(dailyAppBean.getIcon(mContext));
|
||||
holder.tv_name.setText(dailyAppBean.getAppName());
|
||||
holder.root.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
@@ -72,10 +63,10 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (packageName) {
|
||||
case AppManager.SERVICE_PACKAGE:
|
||||
case PackagesName.VSCOOL_SERVICE:
|
||||
mContext.startActivity(new Intent(mContext, ServiceActivity.class));
|
||||
break;
|
||||
case AppManager.CONTACT_PACKAGE:
|
||||
case PackagesName.VSCOOL_CONTACTS:
|
||||
mContext.startActivity(new Intent(mContext, ContactListActivity.class));
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -87,16 +87,6 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
holder.tv_remind_type.setText("每天");
|
||||
holder.tv_remind_type.setBackgroundResource(R.drawable.tv_times_bg_loop);
|
||||
break;
|
||||
case AlarmUtils.WORKING_DAY:
|
||||
holder.tv_time.setText(alarmClockData.getTime());
|
||||
holder.tv_remind_type.setText("周一至周五");
|
||||
holder.tv_remind_type.setBackgroundResource(R.drawable.tv_times_bg_work);
|
||||
break;
|
||||
case AlarmUtils.OFF_DAY:
|
||||
holder.tv_time.setText(alarmClockData.getTime());
|
||||
holder.tv_remind_type.setText("周六至周日");
|
||||
holder.tv_remind_type.setBackgroundResource(R.drawable.tv_times_bg_offday);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
String title = alarmClockData.getTitle();
|
||||
@@ -114,19 +104,6 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
holder.tv_status.setText("已关闭");
|
||||
holder.toggleButton2.setToggleOff(false);
|
||||
}
|
||||
int type = alarmClockData.getClazz();
|
||||
switch (type){
|
||||
case 1:
|
||||
default:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_medicine_pressed));
|
||||
break;
|
||||
case 2:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_look_pressed));
|
||||
break;
|
||||
case 3:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_reserve_pressed));
|
||||
break;
|
||||
}
|
||||
String voice = alarmClockData.getVoice();
|
||||
if (TextUtils.isEmpty(voice)) {
|
||||
holder.cl_voice.setVisibility(View.GONE);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.vscool.os.bean;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -12,10 +10,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.vscool.os.BuildConfig;
|
||||
import com.vscool.os.R;
|
||||
import com.vscool.os.manager.AppManager;
|
||||
import com.vscool.os.utils.IconUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -94,44 +88,6 @@ public class DesktopIcon implements Serializable, Parcelable {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public Drawable getIcon(Context context) {
|
||||
switch (mPackage) {
|
||||
case AppManager.ADD_NAME:
|
||||
return context.getDrawable(R.drawable.home_icon_add);
|
||||
case AppManager.SERVICE_PACKAGE:
|
||||
return context.getDrawable(R.drawable.icon_wechat_service);
|
||||
case AppManager.CONTACT_PACKAGE:
|
||||
return context.getDrawable(R.drawable.com_android_contacts);
|
||||
case AppManager.EXIT_DESKTOP:
|
||||
return context.getDrawable(R.drawable.exit_icon);
|
||||
case "aios.daily.app":
|
||||
return context.getDrawable(R.drawable.icon_daily_app);
|
||||
case "aios.appstore":
|
||||
return context.getDrawable(R.drawable.com_android_appstore);
|
||||
default:
|
||||
PackageManager pm = context.getPackageManager();
|
||||
ApplicationInfo info = null;
|
||||
try {
|
||||
info = pm.getApplicationInfo(mPackage, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (info == null) {
|
||||
return null;
|
||||
} else {
|
||||
int i = IconUtils.appClassNameList.indexOf(mPackage);
|
||||
if (i != -1) {
|
||||
String val = IconUtils.appIconList.get(i);
|
||||
int resID = context.getResources().getIdentifier(val, "drawable", BuildConfig.APPLICATION_ID);
|
||||
if (resID != 0) {
|
||||
return context.getResources().getDrawable(resID);
|
||||
}
|
||||
}
|
||||
return info.loadIcon(pm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static DesktopIcon creatDesktopIcon(Context context, ResolveInfo resolveInfo) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
DesktopIcon desktopIcon = new DesktopIcon();
|
||||
|
||||
32
app/src/main/java/com/vscool/os/config/PackagesName.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.vscool.os.config;
|
||||
|
||||
public class PackagesName {
|
||||
/*uiui浏览器*/
|
||||
public static final String VSCOOL_UIUI_BROWSER = "com.uiui.browser";
|
||||
|
||||
/*添加应用*/
|
||||
public static final String ADD_PKG = "icon.os.add";
|
||||
/*更多应用*/
|
||||
public static final String VSCOOL_DAILY_APP = "xxpatx.os.daily.app";
|
||||
/*桌面设置*/
|
||||
public static final String VSCOOL_DESKTOP_SETTING = "xxpatx.os.desktop.setting";
|
||||
/*更多应用*/
|
||||
public static final String VSCOOL_USER_CENTER = "xxpatx.os.user.center";
|
||||
/*联系客服*/
|
||||
public static final String VSCOOL_SERVICE = "xxpatx.os.service";
|
||||
/*爱心闹钟*/
|
||||
public static final String VSCOOL_ALARM_CLOCK = "xxpatx.os.alarm.clock";
|
||||
/*SOS*/
|
||||
public static final String VSCOOL_SOS = "xxpatx.os.sos";
|
||||
/*电话*/
|
||||
public static final String VSCOOL_DIALER = "xxpatx.os.dialer";
|
||||
/*手电筒*/
|
||||
public static final String VSCOOL_FLASHLIGHT = "xxpatx.os.flashlight";
|
||||
/*联系人*/
|
||||
public static final String VSCOOL_CONTACTS = "xxpatx.os.contact";
|
||||
/*图库*/
|
||||
public static final String VSCOOL_GALLERY = "xxpatx.os.gallery";
|
||||
/*退出桌面*/
|
||||
public static final String VSCOOL_EXIT_DESKTOP = "xxpatx.os.exit";
|
||||
|
||||
}
|
||||
@@ -21,11 +21,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.vscool.os.BuildConfig;
|
||||
import com.vscool.os.R;
|
||||
import com.vscool.os.activity.contact.ContactListActivity;
|
||||
import com.vscool.os.activity.dailyapp.DailyAppActivity;
|
||||
@@ -35,17 +33,18 @@ import com.vscool.os.base.BaseFragment;
|
||||
import com.vscool.os.bean.BaseResponse;
|
||||
import com.vscool.os.bean.DesktopIcon;
|
||||
import com.vscool.os.config.CommonConfig;
|
||||
import com.vscool.os.config.PackagesName;
|
||||
import com.vscool.os.dialog.DailyAppDialog;
|
||||
import com.vscool.os.dialog.ShortcutDialog;
|
||||
import com.vscool.os.manager.AppManager;
|
||||
import com.vscool.os.manager.AppStatusManager;
|
||||
import com.vscool.os.manager.DesktopIconManager;
|
||||
import com.vscool.os.network.NetInterfaceManager;
|
||||
import com.vscool.os.service.NotificationService;
|
||||
import com.vscool.os.shortcut.ShortcutPkgInfo;
|
||||
import com.vscool.os.shortcut.ShortcutUtils;
|
||||
import com.vscool.os.utils.ApkUtils;
|
||||
import com.vscool.os.utils.AppUsedTimeUtils;
|
||||
import com.vscool.os.utils.IconUtils;
|
||||
import com.vscool.os.utils.Utils;
|
||||
import com.vscool.os.view.MyGridLayout;
|
||||
|
||||
@@ -149,28 +148,6 @@ 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) {
|
||||
@@ -182,7 +159,6 @@ public class AppListFragment extends BaseFragment {
|
||||
iv_app.setVisibility(View.GONE);
|
||||
}
|
||||
Log.e(TAG, "getView: " + pkg);
|
||||
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||
int size = NotificationService.getNotificationLength(pkg);
|
||||
if (size == 0) {
|
||||
bg.setVisibility(View.GONE);
|
||||
@@ -194,7 +170,7 @@ public class AppListFragment extends BaseFragment {
|
||||
bg.setText("99+");
|
||||
}
|
||||
|
||||
if ("aios.daily.app".equals(pkg)) {
|
||||
if (PackagesName.VSCOOL_DAILY_APP.equals(pkg)) {
|
||||
long appSize = AppStatusManager.getInstance().getPackageListSize();
|
||||
if (appSize == 0) {
|
||||
bg.setVisibility(View.GONE);
|
||||
@@ -203,20 +179,7 @@ public class AppListFragment extends BaseFragment {
|
||||
bg.setText(String.valueOf(appSize));
|
||||
}
|
||||
}
|
||||
if (i != -1) {
|
||||
String val = IconUtils.appIconList.get(i);
|
||||
int resID = mContext.getResources().getIdentifier(val, "drawable", BuildConfig.APPLICATION_ID);
|
||||
if (resID == 0) {
|
||||
Log.e(TAG, "getView: not found src : " + pkg);
|
||||
iv.setImageDrawable(desktopIcon.getIcon(mContext));
|
||||
} else {
|
||||
iv.setImageDrawable(mContext.getResources().getDrawable(resID));
|
||||
// desktopIcon.setIcon(mContext.getResources().getDrawable(resID));
|
||||
}
|
||||
} else {
|
||||
|
||||
iv.setImageDrawable(desktopIcon.getIcon(mContext));
|
||||
}
|
||||
iv.setImageDrawable(DesktopIconManager.getInstance().getPackageIcon(pkg));
|
||||
tv.setText(desktopIcon.getTitle());
|
||||
// linearLayout.setEnabled(true);
|
||||
} else {
|
||||
@@ -254,13 +217,13 @@ public class AppListFragment extends BaseFragment {
|
||||
return;
|
||||
}
|
||||
switch (desktopIcon.getPackage()) {
|
||||
case AppManager.SERVICE_PACKAGE:
|
||||
case PackagesName.VSCOOL_SERVICE:
|
||||
startActivity(new Intent(mContext, ServiceActivity.class));
|
||||
break;
|
||||
case AppManager.CONTACT_PACKAGE:
|
||||
case PackagesName.VSCOOL_CONTACTS:
|
||||
startActivity(new Intent(mContext, ContactListActivity.class));
|
||||
break;
|
||||
case "aios.daily.app":
|
||||
case PackagesName.VSCOOL_DAILY_APP:
|
||||
startActivity(new Intent(mContext, DailyAppActivity.class));
|
||||
break;
|
||||
case "aios.exit":
|
||||
@@ -299,7 +262,7 @@ public class AppListFragment extends BaseFragment {
|
||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||
// SendRunningApp(mContext);
|
||||
break;
|
||||
case AppManager.EXIT_DESKTOP:
|
||||
case PackagesName.VSCOOL_EXIT_DESKTOP:
|
||||
Utils.openLauncher3(mContext);
|
||||
break;
|
||||
default:
|
||||
@@ -331,9 +294,9 @@ public class AppListFragment extends BaseFragment {
|
||||
switch (pkg) {
|
||||
case "aios.exit":
|
||||
case "com.vscool.shbd":
|
||||
case "aios.daily.app":
|
||||
case PackagesName.VSCOOL_DAILY_APP:
|
||||
case "aios.appstore":
|
||||
case AppManager.EXIT_DESKTOP:
|
||||
case PackagesName.VSCOOL_EXIT_DESKTOP:
|
||||
break;
|
||||
default:
|
||||
showHideDialog(desktopIcon);
|
||||
@@ -390,7 +353,7 @@ public class AppListFragment extends BaseFragment {
|
||||
ShortcutDialog shortcutDialog = new ShortcutDialog(mContext);
|
||||
shortcutDialog.setTitle("删除快捷方式");
|
||||
shortcutDialog.setMessage(label);
|
||||
shortcutDialog.setIconImage(shortcutPkgInfo.getIcon(mContext));
|
||||
// shortcutDialog.setIconImage(shortcutPkgInfo.getIcon(mContext));
|
||||
shortcutDialog.setAppIconImage(ApkUtils.getAppDrawable(mContext, pkg));
|
||||
shortcutDialog.setOnClickBottomListener(new ShortcutDialog.OnClickBottomListener() {
|
||||
@Override
|
||||
@@ -421,7 +384,7 @@ public class AppListFragment extends BaseFragment {
|
||||
DailyAppDialog dailyAppDialog = new DailyAppDialog(mContext);
|
||||
dailyAppDialog.setTitle("移到日常应用");
|
||||
dailyAppDialog.setMessage(label);
|
||||
dailyAppDialog.setIconImage(desktopIcon.getIcon(mContext));
|
||||
dailyAppDialog.setIconImage(DesktopIconManager.getInstance().getPackageIcon(pkg));
|
||||
dailyAppDialog.setOnClickBottomListener(new DailyAppDialog.OnClickBottomListener() {
|
||||
@Override
|
||||
public void onPositiveClick() {
|
||||
@@ -438,41 +401,6 @@ public class AppListFragment extends BaseFragment {
|
||||
dailyAppDialog.show();
|
||||
}
|
||||
|
||||
private void sendRunningApp(Context context) {
|
||||
String packageName = AppUsedTimeUtils.getInstance().getAppPackageName();
|
||||
long time = AppUsedTimeUtils.getInstance().getStartTime();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_package", packageName);
|
||||
jsonObject.addProperty("version_name", ApkUtils.getAPPVersionName(context, packageName));
|
||||
jsonObject.addProperty("start_time", time / 1000);
|
||||
String jsonString = jsonObject.toString();
|
||||
Log.e(TAG, "sendRunningApp: " + jsonString);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getRunningAppObservable(jsonString)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("sendRunningApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e("sendRunningApp", "onSubscribe: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("sendRunningApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("sendRunningApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setAppList(ArrayList<DesktopIcon> appList) {
|
||||
this.mDesktopIcons = appList;
|
||||
}
|
||||
|
||||
@@ -32,13 +32,6 @@ public class AppManager {
|
||||
private static final String SHOW_PACKAGE_KEY = "SHOW_PACKAGE_KEY";
|
||||
private static final String ADD_PACKAGE_KEY = "ADD_PACKAGE_KEY";
|
||||
|
||||
/*客服中心 自定义包名*/
|
||||
public static final String SERVICE_PACKAGE = "xxpatx.os.service";
|
||||
/*联系人 自定义包名*/
|
||||
public static final String CONTACT_PACKAGE = "xxpatx.os.contact";
|
||||
/*退出 自定义包名*/
|
||||
public static final String EXIT_DESKTOP = "xxpatx.os.exit";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static AppManager sInstance;
|
||||
private Context mContext;
|
||||
|
||||
@@ -134,15 +134,15 @@ public class AppStatusManager {
|
||||
dailyAppBeanList.add(appSelectBean);
|
||||
}
|
||||
}
|
||||
if (hidedAppSet.contains(AppManager.CONTACT_PACKAGE)) {
|
||||
DailyAppBean contactIcon = new DailyAppBean("联系人", AppManager.CONTACT_PACKAGE);
|
||||
dailyAppBeanList.add(0, contactIcon);
|
||||
}
|
||||
// if (hidedAppSet.contains(PackagesName.VSCOOL_CONTACTS)) {
|
||||
// DailyAppBean contactIcon = new DailyAppBean("联系人", PackagesName.VSCOOL_CONTACTS);
|
||||
// dailyAppBeanList.add(0, contactIcon);
|
||||
// }
|
||||
|
||||
if (hidedAppSet.contains(AppManager.SERVICE_PACKAGE)) {
|
||||
DailyAppBean serviceIcon = new DailyAppBean("客服中心", AppManager.SERVICE_PACKAGE);
|
||||
dailyAppBeanList.add(0, serviceIcon);
|
||||
}
|
||||
// if (hidedAppSet.contains(PackagesName.VSCOOL_SERVICE)) {
|
||||
// DailyAppBean serviceIcon = new DailyAppBean("客服中心", PackagesName.VSCOOL_SERVICE);
|
||||
// dailyAppBeanList.add(0, serviceIcon);
|
||||
// }
|
||||
|
||||
return dailyAppBeanList;
|
||||
}
|
||||
|
||||
@@ -3,13 +3,20 @@ package com.vscool.os.manager;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.vscool.os.BuildConfig;
|
||||
import com.vscool.os.R;
|
||||
import com.vscool.os.bean.DockApp;
|
||||
import com.vscool.os.config.CommonConfig;
|
||||
import com.vscool.os.config.PackagesName;
|
||||
import com.vscool.os.utils.IconUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -65,5 +72,33 @@ public class DesktopIconManager {
|
||||
return "com.android.camera2"; // 没有找到相机应用
|
||||
}
|
||||
|
||||
|
||||
public Drawable getPackageIcon(String pkg) {
|
||||
switch (pkg) {
|
||||
case PackagesName.VSCOOL_SERVICE:
|
||||
return mContext.getDrawable(R.drawable.icon_wechat_service);
|
||||
case PackagesName.VSCOOL_EXIT_DESKTOP:
|
||||
return mContext.getDrawable(R.drawable.exit_icon);
|
||||
default:
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
ApplicationInfo info = null;
|
||||
try {
|
||||
info = pm.getApplicationInfo(pkg, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (info == null) {
|
||||
return null;
|
||||
} else {
|
||||
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||
if (i != -1) {
|
||||
String val = IconUtils.appIconList.get(i);
|
||||
int resID = mContext.getResources().getIdentifier(val, "drawable", BuildConfig.APPLICATION_ID);
|
||||
if (resID != 0) {
|
||||
return mContext.getResources().getDrawable(resID);
|
||||
}
|
||||
}
|
||||
return info.loadIcon(pm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,8 @@ import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
private static String TAG = "BootReceiver";
|
||||
private static final String TAG = "BootReceiver";
|
||||
public static final String BOOT_COMPLETED = "zuoyeos.action.BOOT_COMPLETED";
|
||||
public static final String SOS = "zuoyeos.action.SOS";
|
||||
|
||||
static {
|
||||
getLockedState();
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ShortcutUtils {
|
||||
values.put(ShortcutHelper.KEY_PACKAGENAME, shortcutPkgInfo.getPackageName());
|
||||
values.put(ShortcutHelper.KEY_CLASS, shortcutPkgInfo.getClazz());
|
||||
values.put(ShortcutHelper.KEY_PACKAGE, shortcutPkgInfo.getPackage());
|
||||
values.put(ShortcutHelper.KEY_ICON, drawableToBitmap(shortcutPkgInfo.getIcon(mContext)));
|
||||
// values.put(ShortcutHelper.KEY_ICON, drawableToBitmap(shortcutPkgInfo.getIcon(mContext)));
|
||||
values.put(ShortcutHelper.KEY_TIMESTAMP, System.currentTimeMillis());
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.vscool.os.bean.AppInfo;
|
||||
import com.vscool.os.bean.DesktopIcon;
|
||||
import com.vscool.os.bean.TestAppInfo;
|
||||
import com.vscool.os.config.CommonConfig;
|
||||
import com.vscool.os.config.PackagesName;
|
||||
import com.vscool.os.gson.GsonUtils;
|
||||
import com.vscool.os.manager.AppManager;
|
||||
import com.vscool.os.manager.AppStatusManager;
|
||||
@@ -318,7 +319,7 @@ public class ApkUtils {
|
||||
// DesktopIcon dailyIcon = new DesktopIcon();
|
||||
//// dailyIcon.setIcon(context.getDrawable(R.drawable.icon_daily_app));
|
||||
// dailyIcon.setTitle("日常应用");
|
||||
// dailyIcon.setPackage("aios.daily.app");
|
||||
// dailyIcon.setPackage(PackagesName.AIOS_DAILY_APP);
|
||||
// desktopIcons.add(0, dailyIcon);
|
||||
|
||||
// DesktopIcon familyIcon = new DesktopIcon();
|
||||
@@ -434,26 +435,26 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if (!AppStatusManager.getInstance().getHidedAppSet().contains(AppManager.SERVICE_PACKAGE)) {
|
||||
DesktopIcon dailyIcon = new DesktopIcon();
|
||||
dailyIcon.setTitle("客服中心");
|
||||
dailyIcon.setPackage(AppManager.SERVICE_PACKAGE);
|
||||
desktopIcons.add(0, dailyIcon);
|
||||
}
|
||||
// if (!AppStatusManager.getInstance().getHidedAppSet().contains(PackagesName.VSCOOL_SERVICE)) {
|
||||
// DesktopIcon dailyIcon = new DesktopIcon();
|
||||
// dailyIcon.setTitle("客服中心");
|
||||
// dailyIcon.setPackage(PackagesName.VSCOOL_SERVICE);
|
||||
// desktopIcons.add(0, dailyIcon);
|
||||
// }
|
||||
|
||||
if (!AppStatusManager.getInstance().getHidedAppSet().contains(AppManager.CONTACT_PACKAGE)) {
|
||||
DesktopIcon contactIcon = new DesktopIcon();
|
||||
contactIcon.setTitle("联系人");
|
||||
contactIcon.setPackage(AppManager.CONTACT_PACKAGE);
|
||||
// TODO: 2024/10/22 2024-10-22 18:30:22 隐藏了客服中心将会报错
|
||||
desktopIcons.add(contactIcon);
|
||||
}
|
||||
// if (!AppStatusManager.getInstance().getHidedAppSet().contains(PackagesName.VSCOOL_CONTACTS)) {
|
||||
// DesktopIcon contactIcon = new DesktopIcon();
|
||||
// contactIcon.setTitle("联系人");
|
||||
// contactIcon.setPackage(PackagesName.VSCOOL_CONTACTS);
|
||||
// // TODO: 2024/10/22 2024-10-22 18:30:22 隐藏了客服中心将会报错
|
||||
// desktopIcons.add(contactIcon);
|
||||
// }
|
||||
|
||||
if (isTablet()) {
|
||||
DesktopIcon exitIcon = new DesktopIcon();
|
||||
// exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||
exitIcon.setTitle("退出桌面");
|
||||
exitIcon.setPackage(AppManager.EXIT_DESKTOP);
|
||||
exitIcon.setPackage(PackagesName.VSCOOL_EXIT_DESKTOP);
|
||||
desktopIcons.add(exitIcon);
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 226 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9.0 KiB |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 设置选择和未选中时显示的drawable -->
|
||||
<item android:drawable="@drawable/icon_alarm_look" android:state_checked="false" />
|
||||
|
||||
<item android:drawable="@drawable/icon_alarm_look_pressed" android:state_checked="true" />
|
||||
|
||||
</selector>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 设置选择和未选中时显示的drawable -->
|
||||
<item android:drawable="@drawable/icon_alarm_medicine" android:state_checked="false" />
|
||||
|
||||
<item android:drawable="@drawable/icon_alarm_medicine_pressed" android:state_checked="true" />
|
||||
|
||||
</selector>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#e5004f" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="32dp"
|
||||
android:bottomRightRadius="32dp"
|
||||
android:topLeftRadius="32dp"
|
||||
android:topRightRadius="32dp" />
|
||||
|
||||
<padding
|
||||
android:left="12dp"
|
||||
android:right="12dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 设置选择和未选中时显示的drawable -->
|
||||
<item android:drawable="@drawable/tv_times_bg" android:state_checked="false" />
|
||||
|
||||
<item android:drawable="@drawable/tv_times_bg_offday" android:state_checked="true" />
|
||||
|
||||
</selector>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 设置选择和未选中时显示的drawable -->
|
||||
<item android:drawable="@drawable/icon_alarm_reserve" android:state_checked="false" />
|
||||
|
||||
<item android:drawable="@drawable/icon_alarm_reserve_pressed" android:state_checked="true" />
|
||||
|
||||
</selector>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#ffb70d" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="32dp"
|
||||
android:bottomRightRadius="32dp"
|
||||
android:topLeftRadius="32dp"
|
||||
android:topRightRadius="32dp" />
|
||||
|
||||
<padding
|
||||
android:left="12dp"
|
||||
android:right="12dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 设置选择和未选中时显示的drawable -->
|
||||
<item android:drawable="@drawable/tv_times_bg" android:state_checked="false" />
|
||||
|
||||
<item android:drawable="@drawable/tv_times_bg_work" android:state_checked="true" />
|
||||
|
||||
</selector>
|
||||
@@ -176,7 +176,6 @@
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_accessibility"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView19"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -205,7 +204,6 @@
|
||||
android:layout_height="89dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@drawable/card_add_contact_background"
|
||||
android:onClick="@{click::addContact}"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -214,7 +212,6 @@
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_family_space"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -312,7 +309,6 @@
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_appstore"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView31"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -325,7 +321,6 @@
|
||||
android:layout_height="89dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@drawable/card_calendar_background"
|
||||
android:onClick="@{click::openCalendar}"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
@@ -348,7 +343,6 @@
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_app"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_app"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -372,7 +366,6 @@
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_clock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -168,7 +168,6 @@
|
||||
android:layout_height="89dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/card_accessibility_background"
|
||||
android:onClick="@{click::openSettings}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -327,7 +326,6 @@
|
||||
android:layout_height="89dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/card_appstore_background"
|
||||
android:onClick="@{click::toAppstore}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -410,7 +408,6 @@
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="89dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/card_location_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/cl_contact">
|
||||
|
||||
@@ -140,7 +140,6 @@
|
||||
android:id="@+id/rb_all"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/tv_times_bg_medicine"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:textColor="@color/radio_botton_gray"
|
||||
@@ -151,7 +150,6 @@
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/tv_times_bg_look"
|
||||
android:button="@null"
|
||||
android:textColor="@color/radio_botton_gray"
|
||||
android:textSize="9sp" />
|
||||
@@ -161,7 +159,6 @@
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/tv_times_bg_reserve"
|
||||
android:button="@null"
|
||||
android:textColor="@color/radio_botton_gray"
|
||||
android:textSize="9sp" />
|
||||
|
||||