version:1.2.0
fix: update:修复通知栏开关显示错误,客服联系方式可隐藏
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
|||||||
applicationId "com.xxpatx.os"
|
applicationId "com.xxpatx.os"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1020
|
versionCode 1021
|
||||||
versionName "1.1.9"
|
versionName "1.2.0"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
|||||||
Log.e(TAG, "initView: dialTone = " + dialTone);
|
Log.e(TAG, "initView: dialTone = " + dialTone);
|
||||||
mViewDataBinding.setDialTone(dialTone);
|
mViewDataBinding.setDialTone(dialTone);
|
||||||
|
|
||||||
int code = Settings.System.getInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, 1);
|
int code = Settings.System.getInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, 0);
|
||||||
boolean statusBar = code == 1;
|
boolean statusBar = code == 1;
|
||||||
Log.e(TAG, "setStatusBar: statusBar = " + statusBar);
|
Log.e(TAG, "setStatusBar: statusBar = " + statusBar);
|
||||||
mViewDataBinding.setStatusBar(statusBar);
|
mViewDataBinding.setStatusBar(statusBar);
|
||||||
@@ -285,7 +285,7 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setStatusBar(View view) {
|
public void setStatusBar(View view) {
|
||||||
int code = Settings.System.getInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, 1);
|
int code = Settings.System.getInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, 0);
|
||||||
boolean statusBar = code == 1;
|
boolean statusBar = code == 1;
|
||||||
String statusbarStatus;
|
String statusbarStatus;
|
||||||
if (statusBar) {
|
if (statusBar) {
|
||||||
@@ -297,7 +297,7 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
|||||||
// statusIntent.setPackage("com.android.settings");
|
// statusIntent.setPackage("com.android.settings");
|
||||||
sendBroadcast(statusIntent);
|
sendBroadcast(statusIntent);
|
||||||
|
|
||||||
Log.e(TAG, "setStatusBar: statusBar = " + statusBar);
|
Log.e(TAG, "setStatusBar: old statusBar = " + statusBar);
|
||||||
mViewDataBinding.setStatusBar(!statusBar);
|
mViewDataBinding.setStatusBar(!statusBar);
|
||||||
Settings.System.putInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, code == 1 ? 0 : 1);
|
Settings.System.putInt(getContentResolver(), CommonConfig.ACTION_STATUS_BAR_STATE, code == 1 ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xxpatx.os.adapter;
|
package com.xxpatx.os.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -14,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.xxpatx.os.R;
|
import com.xxpatx.os.R;
|
||||||
|
import com.xxpatx.os.activity.service.ServiceActivity;
|
||||||
import com.xxpatx.os.bean.BaseResponse;
|
import com.xxpatx.os.bean.BaseResponse;
|
||||||
import com.xxpatx.os.bean.DailyAppBean;
|
import com.xxpatx.os.bean.DailyAppBean;
|
||||||
import com.xxpatx.os.dialog.DailyAppDialog;
|
import com.xxpatx.os.dialog.DailyAppDialog;
|
||||||
@@ -49,7 +51,14 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||||
DailyAppBean dailyAppBean = mDailyAppBeans.get(position);
|
DailyAppBean dailyAppBean = mDailyAppBeans.get(position);
|
||||||
holder.iv_icon.setImageDrawable(dailyAppBean.getIcon(mContext));
|
String packageName = dailyAppBean.getPackageName();
|
||||||
|
switch (packageName) {
|
||||||
|
case "xxpatx.os.service":
|
||||||
|
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_wechat_service));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
holder.iv_icon.setImageDrawable(dailyAppBean.getIcon(mContext));
|
||||||
|
}
|
||||||
holder.tv_name.setText(dailyAppBean.getAppName());
|
holder.tv_name.setText(dailyAppBean.getAppName());
|
||||||
holder.root.setOnLongClickListener(new View.OnLongClickListener() {
|
holder.root.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -61,13 +70,18 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
|||||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
ApkUtils.openPackage(mContext, dailyAppBean.getPackageName(), dailyAppBean.getClassName());
|
switch (packageName) {
|
||||||
AppUsedTimeUtils.getInstance().setAppPackageName(dailyAppBean.getPackageName());
|
case "xxpatx.os.service":
|
||||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
mContext.startActivity(new Intent(mContext, ServiceActivity.class));
|
||||||
// SendRunningApp(mContext);
|
break;
|
||||||
|
default:
|
||||||
|
ApkUtils.openPackage(mContext, packageName, dailyAppBean.getClassName());
|
||||||
|
AppUsedTimeUtils.getInstance().setAppPackageName(packageName);
|
||||||
|
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int size = NotificationService.getNotificationLength(dailyAppBean.getPackageName());
|
int size = NotificationService.getNotificationLength(packageName);
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
holder.bg.setVisibility(View.GONE);
|
holder.bg.setVisibility(View.GONE);
|
||||||
} else if (size < 99) {
|
} else if (size < 99) {
|
||||||
@@ -79,41 +93,6 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showDialog(DailyAppBean dailyAppBean) {
|
private void showDialog(DailyAppBean dailyAppBean) {
|
||||||
DailyAppDialog dailyAppDialog = new DailyAppDialog(mContext);
|
DailyAppDialog dailyAppDialog = new DailyAppDialog(mContext);
|
||||||
|
|||||||
@@ -17,6 +17,15 @@ public class DailyAppBean implements Serializable {
|
|||||||
String packageName;
|
String packageName;
|
||||||
String className;
|
String className;
|
||||||
|
|
||||||
|
public DailyAppBean(String packageName) {
|
||||||
|
this.packageName = packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DailyAppBean(String appName, String packageName) {
|
||||||
|
this.appName = appName;
|
||||||
|
this.packageName = packageName;
|
||||||
|
}
|
||||||
|
|
||||||
public DailyAppBean(String appName, String packageName, String className) {
|
public DailyAppBean(String appName, String packageName, String className) {
|
||||||
this.appName = appName;
|
this.appName = appName;
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
|
|||||||
@@ -326,7 +326,6 @@ public class AppListFragment extends BaseFragment {
|
|||||||
case "com.xxpatx.sn":
|
case "com.xxpatx.sn":
|
||||||
case "aios.daily.app":
|
case "aios.daily.app":
|
||||||
case "aios.appstore":
|
case "aios.appstore":
|
||||||
case "xxpatx.os.service":
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
showHideDialog(desktopIcon);
|
showHideDialog(desktopIcon);
|
||||||
|
|||||||
@@ -108,6 +108,11 @@ public class AppStatusManager {
|
|||||||
dailyAppBeanList.add(appSelectBean);
|
dailyAppBeanList.add(appSelectBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (hidedAppSet.contains("xxpatx.os.service")) {
|
||||||
|
DailyAppBean serviceIcon = new DailyAppBean("客服中心","xxpatx.os.service");
|
||||||
|
dailyAppBeanList.add(0, serviceIcon);
|
||||||
|
}
|
||||||
|
|
||||||
return dailyAppBeanList;
|
return dailyAppBeanList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -427,10 +427,12 @@ public class ApkUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DesktopIcon dailyIcon = new DesktopIcon();
|
if (!AppStatusManager.getInstance().getHidedAppSet().contains("xxpatx.os.service")) {
|
||||||
dailyIcon.setTitle("客服中心");
|
DesktopIcon dailyIcon = new DesktopIcon();
|
||||||
dailyIcon.setPackage("xxpatx.os.service");
|
dailyIcon.setTitle("客服中心");
|
||||||
desktopIcons.add(0, dailyIcon);
|
dailyIcon.setPackage("xxpatx.os.service");
|
||||||
|
desktopIcons.add(0, dailyIcon);
|
||||||
|
}
|
||||||
|
|
||||||
List<ShortcutPkgInfo> shortcutPkgInfos = ShortcutUtils.getInstance().getShortcutList();
|
List<ShortcutPkgInfo> shortcutPkgInfos = ShortcutUtils.getInstance().getShortcutList();
|
||||||
desktopIcons.addAll(shortcutPkgInfos);
|
desktopIcons.addAll(shortcutPkgInfos);
|
||||||
|
|||||||
Reference in New Issue
Block a user