From f151e203da870dbe281defcb1daf84a1a38ecac1 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 29 十二月 2025 09:59:57 +0800
Subject: [PATCH] Merge branch 'master' into google
---
app/src/main/java/com/hdl/photovoltaic/ui/me/AsRegardsActivity.java | 95 ++++++++++++-----------------------------------
1 files changed, 24 insertions(+), 71 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/AsRegardsActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/AsRegardsActivity.java
index 0c5ca04..382ce06 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/me/AsRegardsActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/AsRegardsActivity.java
@@ -8,7 +8,8 @@
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
-import android.os.Build;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
import android.os.Bundle;
import android.view.View;
@@ -34,7 +35,7 @@
import com.hdl.photovoltaic.ui.StartActivity;
import com.hdl.photovoltaic.utils.BadgeUtils;
import com.hdl.photovoltaic.widget.FlashingBoxDialog;
-import com.hdl.photovoltaic.widget.apkwgtupload.ApkDownLoadService;
+import com.hdl.photovoltaic.widget.FlashingIconBoxDialog;
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.hdl.photovoltaic.widget.UpdateConfirmationCancelDialog;
@@ -141,15 +142,6 @@
Intent intent = new Intent();
intent.setClass(_mActivity, ContactUsActivity.class);
startActivity(intent);
- String json = "{\"expandData\":{\"expantContent\":\"{\\\"createTime\\\":1763705189605,\\\"homeName\\\":\\\"鏅鸿兘妯″紡娴嬭瘯\\\",\\\"isRead\\\":false,\\\"msgId\\\":1991742202645020673,\\\"type\\\":\\\"EVENT\\\",\\\"homeId\\\":1990254883420880898,\\\"status\\\":\\\"UNTREATED\\\"}\",\"homeId\":1990254883420880898,\"messageType\":\"Alarm\"},\"aps\":{\"badge\":2,\"alert\":{\"title\":\"event\",\"body\":\"Battery voltage low\"}}}";
-//// Gson gson = new Gson();
-//// Type type = new TypeToken<Map<String, String>>() {
-//// }.getType();
-//// Map<String, String> map = gson.fromJson(json, type);
-// Map<String, String> map = JSONObject.parseObject(json, new TypeReference<Map<String, String>>() {
-// });
-// showCustomNotification("妯℃嫙鏍囬", "妯℃嫙鏁版嵁", map);
-//// HdlPushLogic.getInstance().pushDataProcessing("", "", json);
}
});
@@ -157,6 +149,7 @@
private void initView() {
viewBinding.toolbarTopRl.topBarView.setBackgroundColor(getColor(R.color.text_00000000));
+ viewBinding.asRegardsVersionUpdatingRl.setVisibility(View.GONE);
viewBinding.toolbarTopRl.topTitleTv.setText(R.string.me_regard);
viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE);
String versionsStr = _mActivity.getResources().getString(R.string.app_version_number) + " " + AppConfigManage.getVersionName();
@@ -190,11 +183,24 @@
updateConfirmationCancelDialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() {
@Override
public void Confirm() {
- Intent intent = new Intent(_mActivity, ApkDownLoadService.class);
- intent.putExtra("updateUrl", mNewVersionBean.getPackageUrl());
- intent.putExtra("downLoadName", HdlAppUpdateLogic.getInstance().getApkFileName());
- intent.putExtra("downLoadType", "0");
- _mActivity.startService(intent);
+ FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity, 1500);
+ flashingBoxDialog.setContent(getString(R.string.loading_not_supported));
+ flashingBoxDialog.show();
+// try {
+// PackageManager packageManager = getPackageManager();
+// PackageInfo packageInfo = packageManager.getPackageInfo("com.android.vending", 0);
+// String versionName = packageInfo.versionName; // 鑾峰彇鐗堟湰鍙�
+// int versionCode = packageInfo.versionCode; // 鑾峰彇鐗堟湰浠g爜
+// // 鍦ㄦ澶勫鐞嗙増鏈俊鎭�
+// } catch (PackageManager.NameNotFoundException e) {
+// e.printStackTrace();
+// // 澶勭悊寮傚父锛屼緥濡傝胺姝孭lay鍟嗗簵搴旂敤鏈畨瑁�
+// }
+//
+// String packageName = "com.hdl.photovoltaic"; // 鏇挎崲涓轰綘鎯宠烦杞埌鐨勫簲鐢ㄧ殑鍖呭悕
+// Intent intent = new Intent(Intent.ACTION_VIEW);
+// intent.setData(Uri.parse("market://details?id=" + packageName));
+// startActivity(intent);
updateConfirmationCancelDialog.dismiss();
}
@@ -210,60 +216,7 @@
}, this, ShowErrorMode.YES);
}
- private void showCustomNotification(String title, String message, Map<String, String> data) {
- NotificationManager notificationManager =
- (NotificationManager) _mActivity.getSystemService(Context.NOTIFICATION_SERVICE);
+
- // 鍒涘缓閫氱煡娓犻亾锛圓ndroid 8.0+锛�
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- createNotificationChannel(notificationManager);
- }
-
- NotificationCompat.Builder builder = new NotificationCompat.Builder(_mActivity, "fcm_channel")
- .setSmallIcon(R.drawable.notification_logo)
- .setContentTitle(title)
- .setContentText(message)
- .setAutoCancel(true)
- .setNumber(5)
- .setWhen(System.currentTimeMillis());
-
-
- // 璁剧疆鐐瑰嚮鎰忓浘
- Intent intent = createNotificationIntent(data);
- PendingIntent pendingIntent = PendingIntent.getActivity(
- _mActivity, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
- builder.setContentIntent(pendingIntent);
-
- // 鏄剧ず閫氱煡
- notificationManager.notify((int) System.currentTimeMillis(), builder.build());
- }
-
- private Intent createNotificationIntent(Map<String, String> data) {
- Intent intent = new Intent(_mActivity, StartActivity.class);
- intent.putExtra("from_fcm", true);
- intent.putExtra("pushData", JSON.toJSON(data).toString());
-// if (data != null) {
-// for (Map.Entry<String, String> entry : data.entrySet()) {
-// intent.putExtra(entry.getKey(), entry.getValue());
-// }
-// }
-
-// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
- return intent;
- }
-
- @RequiresApi(api = Build.VERSION_CODES.O)
- private void createNotificationChannel(NotificationManager notificationManager) {
- NotificationChannel channel = new NotificationChannel(
- "fcm_channel",
- "FCM 娑堟伅",
- NotificationManager.IMPORTANCE_HIGH
- );
- channel.setDescription("Firebase Cloud Messaging 閫氱煡");
- // 鍚敤瑙掓爣
- channel.setShowBadge(true);
- notificationManager.createNotificationChannel(channel);
- BadgeUtils.setBadgeCount(_mActivity, 7);
- }
+
}
\ No newline at end of file
--
Gitblit v1.8.0