From: TrillGates Date: Fri, 3 Sep 2021 10:48:39 +0000 (+0800) Subject: adjust notification issues. X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c787aaac136485ad0714c7ba0e18791e9289af4f;p=iclooplauncher.git adjust notification issues. --- diff --git a/app/release/ICLoopPageLauncher_V41_202109031043_release.apk b/app/release/ICLoopPageLauncher_V42_202109031730_release.apk similarity index 57% rename from app/release/ICLoopPageLauncher_V41_202109031043_release.apk rename to app/release/ICLoopPageLauncher_V42_202109031730_release.apk index 517c64c..cc96928 100644 Binary files a/app/release/ICLoopPageLauncher_V41_202109031043_release.apk and b/app/release/ICLoopPageLauncher_V42_202109031730_release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 4733003..1493ee3 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -12,7 +12,7 @@ "filters": [], "versionCode": 1, "versionName": "1.0", - "outputFile": "ICLoopPageLauncher_V41_202109031043_release.apk" + "outputFile": "ICLoopPageLauncher_V42_202109031730_release.apk" } ] } \ No newline at end of file diff --git a/app/src/main/java/com/ic/launcher/NotificationActivity.java b/app/src/main/java/com/ic/launcher/NotificationActivity.java index c025ae0..17a2b47 100644 --- a/app/src/main/java/com/ic/launcher/NotificationActivity.java +++ b/app/src/main/java/com/ic/launcher/NotificationActivity.java @@ -128,9 +128,10 @@ public class NotificationActivity extends AppCompatActivity { String title = notificationItem.getTitle(); switch (category) { case CATEGORY_SMS: + ICLogger.d("notificationItem.getPhone() ==> " + notificationItem.getPhone()); //跳转到短信详情界面 intent.setAction("com.ic.sms.action.DETAIL"); - intent.putExtra("detailNum", notificationItem.getTitle()); + intent.putExtra("detailNum", notificationItem.getPhone()); break; case CATEGORY_TEMPERATURE: case CATEGORY_BLOOD: diff --git a/app/src/main/java/com/ic/launcher/data/NotificationItem.java b/app/src/main/java/com/ic/launcher/data/NotificationItem.java index 762673c..97b8c47 100644 --- a/app/src/main/java/com/ic/launcher/data/NotificationItem.java +++ b/app/src/main/java/com/ic/launcher/data/NotificationItem.java @@ -7,6 +7,15 @@ public class NotificationItem { private String category; private String type; private int order; + private String phone; + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } public int getId() { return id; diff --git a/app/src/main/java/com/ic/launcher/presenter/NotificationPresenter.java b/app/src/main/java/com/ic/launcher/presenter/NotificationPresenter.java index f08a3ce..d86449c 100644 --- a/app/src/main/java/com/ic/launcher/presenter/NotificationPresenter.java +++ b/app/src/main/java/com/ic/launcher/presenter/NotificationPresenter.java @@ -77,8 +77,10 @@ public class NotificationPresenter extends BasePresenter { String category = query.getString(3); notificationItem.setCategory(category); int order = query.getInt(4); + String phoneNum = query.getString(5); + notificationItem.setPhone(phoneNum); notificationItem.setOrder(order); - long date = query.getLong(5); + long date = query.getLong(6); notificationItem.setDate(date); ICLogger.d("notificationItem == > " + notificationItem.toString()); @@ -90,27 +92,19 @@ public class NotificationPresenter extends BasePresenter { //如果数量大于1,就显示通知界面 query.close(); } + handleTopIcons(); }); } - public void removeNotificationByCategory(String category, String title) { - executorService.execute(() -> { - int delete; - if (TextUtils.isEmpty(title)) { - delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS), - "category=?", - new String[]{category}); - } else { - delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS), - "category=? and title=?", - new String[]{category, title}); - } - ICLogger.d("deleted == > " + delete); - }); + private void handleTopIcons() { + //根据类型修改顶部的值 //如果是短信 - Map tempMap = new HashMap<>(); List value = notificationListValue.getValue(); + if (value == null) { + return; + } + Map tempMap = new HashMap<>(); for (int i = 0; i < value.size(); i++) { NotificationItem notificationItem = value.get(i); String itemCategory = notificationItem.getCategory(); @@ -144,4 +138,21 @@ public class NotificationPresenter extends BasePresenter { contentResolver.insert(Uri.parse(Constants.SETTINGS), contentValues); } } + + public void removeNotificationByCategory(String category, String title) { + executorService.execute(() -> { + int delete; + if (TextUtils.isEmpty(title)) { + delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS), + "category=?", + new String[]{category}); + } else { + delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS), + "category=? and title=?", + new String[]{category, title}); + } + ICLogger.d("deleted == > " + delete); + }); + updateData(); + } } diff --git a/app/src/main/res/layout/item_notification.xml b/app/src/main/res/layout/item_notification.xml index 37ca727..40d7b9e 100644 --- a/app/src/main/res/layout/item_notification.xml +++ b/app/src/main/res/layout/item_notification.xml @@ -21,6 +21,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" + android:ellipsize="marquee" + android:singleLine="true" android:text="通知标题" android:textColor="@color/black" android:textSize="22sp" diff --git a/app/version_code.properties b/app/version_code.properties index 03a514b..48d8d17 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Fri Sep 03 10:43:20 CST 2021 -VERSION_CODE=41 +#Fri Sep 03 17:30:04 CST 2021 +VERSION_CODE=42