From 8286e51ae7a2c32f79ea7a6672d762b0ebf6a127 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sun, 29 Sep 2024 17:57:25 +0800
Subject: [PATCH 01/40] Update UserAgreement.md
---
UserAgreement.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UserAgreement.md b/UserAgreement.md
index bb7809e..9a362b9 100644
--- a/UserAgreement.md
+++ b/UserAgreement.md
@@ -24,7 +24,7 @@ QQ 版本列表实用工具不面向中国大陆境内公众用户提供服务
## 三、软件的获取
-您可以直接从 GitHub 平台获取 QQ 版本列表实用工具本体及其附带开源许可和知识产权相关文本的源代码。 获取应用后,您需要按照该应用提示的步骤正确使用。
+您可以直接从 GitHub 平台获取 QQ 版本列表实用工具本体及其附带开源许可和知识产权相关文本的源代码。获取应用后,您需要按照该应用提示的步骤正确使用。
如果您从未经 GitHub 或相关官方平台获取本应用,QQ 版本列表实用工具无法保证该应用能够正常使用,并对因此给您造成的损失不予负责。
From f70d3023d5acb15964f38dd57971c7a8603518f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Tue, 1 Oct 2024 12:49:31 +0800
Subject: [PATCH 02/40] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 3ad1d88..7d98e9e 100644
--- a/README.md
+++ b/README.md
@@ -160,11 +160,11 @@ QQ、TIM、微信、企业微信、微信输入法使用腾讯应用宝([腾
在 QQ 版本列表实用工具界面,点击底部锥形瓶按钮即可看到“腾讯应用宝更新获取(实验性)”选项,点击即可进入“腾讯应用宝更新获取(实验性)”对话框。之后按提示进行操作即可。
-#### TDS 腾讯端服务 Shiply 发布平台更新获取(实验性)
+#### TDS 腾讯端服务 Shiply 容器与发布平台更新获取(实验性)
-腾讯 QQ 使用 [TDS 腾讯端服务 Shiply 发布平台](https://shiply.tds.qq.com/),根据 QQ 号(uin)及其终端信息分发小范围灰度测试安装包。当您所使用的 Android QQ 收到官方升级弹窗提醒时,可使用 QQ 版本列表实用工具提供的 TDS 腾讯端服务 Shiply 发布平台更新获取(实验性)尝试获取升级安装包下载直链。
+腾讯 QQ 使用 [TDS 腾讯端服务 Shiply 容器与发布平台](https://shiply.tds.qq.com/),根据 QQ 号(uin)及其终端信息分发小范围灰度测试安装包。当您所使用的 Android QQ 收到官方升级弹窗提醒时,可使用 QQ 版本列表实用工具提供的 TDS 腾讯端服务 Shiply 容器与发布平台更新获取(实验性)尝试获取升级安装包下载直链。
-在 QQ 版本列表实用工具界面,点击底部锥形瓶按钮即可看到“Shiply 平台更新获取(实验性)”选项,点击即可进入“Shiply 平台更新获取(实验性)”对话框。
+在 QQ 版本列表实用工具界面,点击底部锥形瓶按钮即可看到“TDS 腾讯端服务 Shiply 容器与发布平台更新获取(实验性)”选项,点击即可进入“Shiply 平台更新获取(实验性)”对话框。
对话框含有两个输入框,分别是“uin”和“版本”。请在“uin”输入框填写收到官方升级弹窗提醒的 QQ 号,在“版本”输入框填写收到官方升级弹窗提醒时正在使用的 QQ 版本。
From 495ba2f985017f5d05354cc640b6653c7a28d109 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:24:06 +0800
Subject: [PATCH 03/40] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 7d98e9e..21c1ade 100644
--- a/README.md
+++ b/README.md
@@ -266,6 +266,7 @@ QQ 版本列表实用工具的诞生离不开以下开源项目,感谢以下
- [Apache Maven](https://maven.apache.org/),Licensed under [Apache License Version 2.0](https://github.com/apache/maven/blob/master/LICENSE)
- [Gradle](https://gradle.org/),Licensed under [Apache License Version 2.0](https://github.com/gradle/gradle/blob/master/LICENSE)
- [Material Symbols / Material Icons(Google)](https://fonts.google.com/icons),Licensed under [Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)
+- [Obtainium(ImranR98)](https://github.com/ImranR98/Obtainium),Licensed under [GNU General Public License Version 3](https://github.com/ImranR98/Obtainium/blob/main/LICENSE.md)
## 商业服务鸣谢
From 4537b16d9da5493d10454ee0dc9d59dada9f5abd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:24:45 +0800
Subject: [PATCH 04/40] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 21c1ade..79fa45f 100644
--- a/README.md
+++ b/README.md
@@ -266,7 +266,7 @@ QQ 版本列表实用工具的诞生离不开以下开源项目,感谢以下
- [Apache Maven](https://maven.apache.org/),Licensed under [Apache License Version 2.0](https://github.com/apache/maven/blob/master/LICENSE)
- [Gradle](https://gradle.org/),Licensed under [Apache License Version 2.0](https://github.com/gradle/gradle/blob/master/LICENSE)
- [Material Symbols / Material Icons(Google)](https://fonts.google.com/icons),Licensed under [Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)
-- [Obtainium(ImranR98)](https://github.com/ImranR98/Obtainium),Licensed under [GNU General Public License Version 3](https://github.com/ImranR98/Obtainium/blob/main/LICENSE.md)
+- [Obtainium(Imran)](https://github.com/ImranR98/Obtainium),Licensed under [GNU General Public License Version 3](https://github.com/ImranR98/Obtainium/blob/main/LICENSE.md)
## 商业服务鸣谢
From 34997da21951ee8c0301aa15d229e01fb7e6e796 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Fri, 4 Oct 2024 00:20:27 +0800
Subject: [PATCH 05/40] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?=
=?UTF-8?q?=E9=A1=B9=EF=BC=8C=E8=B0=83=E6=95=B4=E8=B5=84=E6=BA=90=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=B9=B3=E5=8F=B0=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 Android Gradle 插件版本更新到8.7.0
- 更新 gradle-wrapper.properties 中的 Gradle 分发版本到 8.10.2
- 调整资源文件中的平台名称,从 "Shiply 分发平台" 更改为 "Shiply 容器与发布平台"
- 修复部分资源文件中的英文术语描述
---
.idea/gradle.xml | 1 +
app/build.gradle.kts | 2 +-
app/proguard-rules.pro | 5 ++++-
app/src/main/res/values-ar-rSA/strings.xml | 6 +++---
app/src/main/res/values-en-rUS/strings.xml | 6 +++---
app/src/main/res/values-es-rES/strings.xml | 6 +++---
app/src/main/res/values-fr-rFR/strings.xml | 6 +++---
app/src/main/res/values-ja-rJP/strings.xml | 6 +++---
app/src/main/res/values-ko-rKR/strings.xml | 6 +++---
app/src/main/res/values-ru-rRU/strings.xml | 6 +++---
app/src/main/res/values-zh-rCN/strings.xml | 6 +++---
app/src/main/res/values-zh-rHK/strings.xml | 6 +++---
app/src/main/res/values/strings.xml | 6 +++---
build.gradle.kts | 2 +-
gradle.properties | 3 ++-
gradle/wrapper/gradle-wrapper.properties | 2 +-
16 files changed, 40 insertions(+), 35 deletions(-)
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 0897082..7b3006b 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,6 +4,7 @@
-
+
\ No newline at end of file
diff --git a/PersonalInformationThird-PartySharingList.md b/PersonalInformationThird-PartySharingList.md
new file mode 100644
index 0000000..f6f68d0
--- /dev/null
+++ b/PersonalInformationThird-PartySharingList.md
@@ -0,0 +1,28 @@
+# 个人信息第三方共享清单
+
+1. 本清单仅反映您在全部功能模式下,我们对您的信息与第三方共享的情况。
+2. 为了完成相应的功能,我们会接入第三方的应用开发工具包(SDK)来获得技术支持,比如帮助我们统计了解产品用户分布和数据分析,我们可能会向此类合作伙伴提供以下个人信息。我们在不同时期可能会选择使用其中部分合作方或变更合作方,故清单内的合作伙伴可能会进行调整。
+
+## OkHttp3
+
+- **第三方主体名称**:Square
+- **使用场景描述**:网络请求
+- **共享的个人信息类型**:无
+- **使用的系统权限**:无
+- **第三方隐私政策或用户协议或官网链接**:https://square.github.io/okhttp/
+
+## Google Analytics
+
+- **第三方主体名称**:Google LLC
+- **使用场景描述**:统计分析,被 Firebase Cloud Messaging 所绑定
+- **共享的个人信息类型**:移动设备标识符、基于网络地址的地理位置信息、Firebase 安装 ID
+- **使用的系统权限**:无
+- **第三方隐私政策或用户协议或官网链接**:https://www.google.com/analytics/terms/
+
+## Firebase Cloud Messaging
+
+- **第三方主体名称**:Google LLC
+- **使用场景描述**:推送消息通知
+- **共享的个人信息类型**:Firebase 安装 ID
+- **使用的系统权限**:通知权限
+- **第三方隐私政策或用户协议或官网链接**:https://firebase.google.com/support/privacy
diff --git a/README.md b/README.md
index b36514e..6d9872d 100644
--- a/README.md
+++ b/README.md
@@ -268,6 +268,7 @@ QQ 版本列表实用工具的诞生离不开以下开源项目,感谢以下
- [Material Symbols / Material Icons(Google)](https://fonts.google.com/icons),Licensed under [Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)
- [Obtainium(Imran)](https://github.com/ImranR98/Obtainium),Licensed under [GNU General Public License Version 3](https://github.com/ImranR98/Obtainium/blob/main/LICENSE.md)
- [Secrets Gradle Plugin for Android(Google)](https://github.com/google/secrets-gradle-plugin),Licensed under [Apache License Version 2.0](https://github.com/google/secrets-gradle-plugin/blob/main/LICENSE)
+- [Firebase Android Open Source Development(Google)](https://firebase.google.com/),Licensed under [Apache License Version 2.0](https://github.com/firebase/firebase-android-sdk/blob/main/LICENSE)
## 商业服务鸣谢
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 713e10d..77ec9e2 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -22,6 +22,7 @@ plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
+ id("com.google.gms.google-services")
kotlin("plugin.serialization") version "2.0.20"
}
@@ -47,7 +48,7 @@ android {
minSdk = 24
targetSdk = 35
versionCode = gitCommitCount
- versionName = "1.4.0-$gitCommitHash"
+ versionName = "1.4.1-$gitCommitHash"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
@@ -112,4 +113,8 @@ dependencies {
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.viewpager2:viewpager2:1.1.0")
implementation("androidx.fragment:fragment-ktx:1.8.4")
+ implementation(platform("com.google.firebase:firebase-bom:33.4.0"))
+ implementation("com.google.firebase:firebase-analytics")
+ implementation("com.google.firebase:firebase-messaging")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 537f0cd..8abbb6b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -19,7 +19,8 @@
xmlns:tools="http://schemas.android.com/tools">
-
+
+
@@ -53,6 +54,28 @@
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
new file mode 100644
index 0000000..138bcb5
--- /dev/null
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
@@ -0,0 +1,38 @@
+package com.xiaoniu.qqversionlist.service
+
+import android.app.NotificationManager
+import android.app.PendingIntent
+import android.content.Intent
+import androidx.core.app.NotificationCompat
+import com.google.firebase.messaging.FirebaseMessagingService
+import com.google.firebase.messaging.RemoteMessage
+import com.xiaoniu.qqversionlist.R
+
+class FirebaseMessagingService : FirebaseMessagingService() {
+ override fun onNewToken(token: String) {
+ super.onNewToken(token)
+ }
+
+ override fun onMessageReceived(remoteMessage: RemoteMessage) {
+ if (!remoteMessage.data.isNotEmpty()) {
+ // 创建一个 Intent,用于点击通知后跳转到某个 Activity
+ val intent = Intent().apply {}
+ val pendingIntent = PendingIntent.getActivity(
+ this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
+ )
+
+ // 创建 Notification
+ val notificationBuilder = NotificationCompat.Builder(
+ this, getString(R.string.rainbow_notification_channel_id)
+ ).setSmallIcon(R.drawable.qv_logo_notification)
+ .setContentTitle(remoteMessage.notification!!.title)
+ .setContentText(remoteMessage.notification!!.body)
+ .setPriority(NotificationCompat.PRIORITY_DEFAULT).setContentIntent(pendingIntent)
+ .setAutoCancel(true)
+
+ // 获取 NotificationManager 并发送通知
+ val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.notify(1, notificationBuilder.build())
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index bcd0a9f..1ffbd70 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -19,8 +19,11 @@
package com.xiaoniu.qqversionlist.ui
+import android.Manifest
import android.annotation.SuppressLint
import android.app.DownloadManager
+import android.app.NotificationChannel
+import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
@@ -41,8 +44,11 @@ import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import androidx.activity.enableEdgeToEdge
+import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintSet
+import androidx.core.app.NotificationManagerCompat
+import androidx.core.content.ContextCompat
import androidx.core.text.method.LinkMovementMethodCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
@@ -53,13 +59,19 @@ import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.airbnb.paris.extensions.style
+import com.google.android.gms.common.ConnectionResult
+import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.material.button.MaterialButton
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import com.google.android.material.materialswitch.MaterialSwitch
import com.google.android.material.progressindicator.CircularProgressIndicatorSpec
import com.google.android.material.progressindicator.IndeterminateDrawable
import com.google.android.material.progressindicator.LinearProgressIndicator
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.MaterialAutoCompleteTextView
+import com.google.firebase.analytics.ktx.analytics
+import com.google.firebase.ktx.Firebase
+import com.google.firebase.messaging.ktx.messaging
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonElement
@@ -75,6 +87,7 @@ import com.xiaoniu.qqversionlist.databinding.ActivityMainBinding
import com.xiaoniu.qqversionlist.databinding.DialogAboutBinding
import com.xiaoniu.qqversionlist.databinding.DialogExpBackBinding
import com.xiaoniu.qqversionlist.databinding.DialogExperimentalFeaturesBinding
+import com.xiaoniu.qqversionlist.databinding.DialogFirebaseFirstInfoBinding
import com.xiaoniu.qqversionlist.databinding.DialogFormatDefineBinding
import com.xiaoniu.qqversionlist.databinding.DialogGuessBinding
import com.xiaoniu.qqversionlist.databinding.DialogLoadingBinding
@@ -97,6 +110,7 @@ import com.xiaoniu.qqversionlist.util.StringUtil.trimSubstringAtStart
import com.xiaoniu.qqversionlist.util.VersionBeanUtil
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import okhttp3.MediaType.Companion.toMediaTypeOrNull
@@ -413,6 +427,11 @@ class MainActivity : AppCompatActivity() {
DataStoreUtil.getBooleanKV("downloadOnSystemManager", false)
switchAutoCheckUpdates.isChecked =
DataStoreUtil.getBooleanKV("autoCheckUpdates", false)
+ switchPushNotifViaFcm.isVisible =
+ Firebase.messaging.isAutoInitEnabled && GoogleApiAvailability.getInstance()
+ .isGooglePlayServicesAvailable(this@MainActivity) == ConnectionResult.SUCCESS
+ switchPushNotifViaFcm.isChecked =
+ DataStoreUtil.getBooleanKV("rainbowFCMSubscribed", false)
}
val dialogSetting = MaterialAlertDialogBuilder(this)
@@ -758,6 +777,40 @@ class MainActivity : AppCompatActivity() {
}
}
}
+ switchPushNotifViaFcm.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked != DataStoreUtil.getBooleanKV(
+ "rainbowFCMSubscribed",
+ false
+ )
+ ) {
+ if (isChecked) {
+ if (!NotificationManagerCompat.from(this@MainActivity)
+ .areNotificationsEnabled()
+ ) askNotificationPermission()
+ if (!NotificationManagerCompat.from(this@MainActivity)
+ .areNotificationsEnabled()
+ ) switchPushNotifViaFcm.isChecked = false
+ else if (!checkNotificationChannelEnabled(
+ getString(R.string.rainbow_notification_channel_id)
+ )
+ ) {
+ switchPushNotifViaFcm.isChecked = false
+ dialogError(
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
+ true
+ )
+ } else {
+ switchPushNotifViaFcm.isEnabled = false
+ Firebase.analytics.setAnalyticsCollectionEnabled(true)
+ subscribeWithTimeout(10000L, switchPushNotifViaFcm)
+ }
+ } else {
+ switchPushNotifViaFcm.isEnabled = false
+ Firebase.analytics.setAnalyticsCollectionEnabled(true)
+ unsubscribeWithTimeout(10000L, switchPushNotifViaFcm)
+ }
+ }
+ }
}
true
}
@@ -956,6 +1009,82 @@ class MainActivity : AppCompatActivity() {
}
}
}
+
+ dialogFirebase.setOnClickListener {
+ // 必须检测 Google Play 服务是否可用,因为 Firebase 服务依赖于 Google Play 服务
+ if (GoogleApiAvailability.getInstance()
+ .isGooglePlayServicesAvailable(this@MainActivity) == ConnectionResult.SUCCESS
+ ) {
+ if (Firebase.messaging.isAutoInitEnabled != true) {
+ if (SDK_INT >= Build.VERSION_CODES.O) {
+ val channelTitle =
+ getString(R.string.rainbow_notification_channel_title)
+ val channelDescription =
+ getString(R.string.rainbow_notification_channel_description)
+ val channelId =
+ getString(R.string.rainbow_notification_channel_id)
+ val channelImportance =
+ NotificationManager.IMPORTANCE_DEFAULT
+ val notificationChannel = NotificationChannel(
+ channelId, channelTitle, channelImportance
+ )
+ notificationChannel.description = channelDescription
+ val notificationManager =
+ getSystemService(NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.createNotificationChannel(
+ notificationChannel
+ )
+ }
+
+ val dialogFirebaseFirstInfoBinding =
+ DialogFirebaseFirstInfoBinding.inflate(layoutInflater)
+
+ val dialogFirebaseInfo =
+ MaterialAlertDialogBuilder(this@MainActivity)
+ .setTitle(R.string.initFirebaseService)
+ .setIcon(R.drawable.flask_line)
+ .setView(dialogFirebaseFirstInfoBinding.root)
+ .show()
+
+ dialogFirebaseFirstInfoBinding.firebaseInfoCancel.setOnClickListener {
+ dialogFirebaseInfo.dismiss()
+ }
+
+ dialogFirebaseFirstInfoBinding.firebaseInfoNext.setOnClickListener {
+ if (!NotificationManagerCompat.from(this@MainActivity)
+ .areNotificationsEnabled()
+ ) askNotificationPermission()
+
+ Firebase.apply {
+ messaging.isAutoInitEnabled = true
+ analytics.setAnalyticsCollectionEnabled(true)
+ /*messaging.subscribeToTopic("rainbowUpdates")
+ .addOnCompleteListener { task ->
+ if (task.isSuccessful) DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed",
+ true
+ ) else DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed",
+ false
+ )
+ }*/
+ }
+
+ dialogFirebaseInfo.dismiss()
+ }
+
+
+ } else {
+ showToast(getString(R.string.initializedFirebaseService))
+ Firebase.analytics.setAnalyticsCollectionEnabled(true)
+ }
+ } else {
+ dialogError(
+ Exception(getString(R.string.cannotFindGooglePlayServices)),
+ true
+ )
+ }
+ }
}
true
}
@@ -2139,6 +2268,152 @@ class MainActivity : AppCompatActivity() {
}
}
+ // 检查特定通知渠道是否被用户关闭
+ private fun checkNotificationChannelEnabled(channelId: String): Boolean {
+ val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
+ if (SDK_INT >= Build.VERSION_CODES.O) {
+ val channel = notificationManager.getNotificationChannel(channelId)
+ return channel?.importance != NotificationManager.IMPORTANCE_NONE
+ } else {
+ // 对于 API 级别 < 26 的设备,默认返回 true
+ return true
+ }
+ }
+
+
+ // Declare the launcher at the top of your Activity/Fragment:
+ private val requestPermissionLauncher = registerForActivityResult(
+ ActivityResultContracts.RequestPermission(),
+ ) { isGranted: Boolean ->
+ if (isGranted) {
+ // FCM SDK (and your app) can post notifications.
+ } else {
+ dialogError(
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
+ true
+ )
+ }
+ }
+
+ private fun askNotificationPermission() {
+ // This is only necessary for API level >= 33 (TIRAMISU)
+ if (SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (ContextCompat.checkSelfPermission(
+ this, Manifest.permission.POST_NOTIFICATIONS
+ ) == PackageManager.PERMISSION_GRANTED
+ ) {
+ // FCM SDK (and your app) can post notifications.
+ } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) {
+ dialogError(
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
+ true
+ )
+ } else {
+ // Directly ask for the permission
+ requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)
+ }
+ } else {
+ if (checkNotificationChannelEnabled(getString(R.string.rainbow_notification_channel_id))) {
+ // FCM SDK (and your app) can post notifications.
+ } else {
+ dialogError(
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
+ true
+ )
+ }
+ }
+ }
+
+ private fun subscribeWithTimeout(
+ timeoutMillis: Long, switchPushNotifViaFcm: MaterialSwitch
+ ) {
+ var status = false
+ val job = lifecycleScope.launch {
+ Firebase.messaging.subscribeToTopic("rainbowUpdates").addOnCanceledListener {
+ status = true
+ showToast(getString(R.string.subscribeFailed))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = false
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", false
+ )
+ }.addOnSuccessListener {
+ status = true
+ showToast(getString(R.string.subscribeSuccess))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = true
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", true
+ )
+ }.addOnFailureListener {
+ status = true
+ showToast(getString(R.string.subscribeFailed))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = false
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", false
+ )
+ }
+ }
+ lifecycleScope.launch {
+ for (i in 1..100) if (status) break else delay(timeoutMillis / 100)
+ if (!status) {
+ job.cancel()
+ showToast(getString(R.string.subscribeTimeout))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = false
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", false
+ )
+ }
+ }
+ }
+
+ private fun unsubscribeWithTimeout(
+ timeoutMillis: Long, switchPushNotifViaFcm: MaterialSwitch
+ ) {
+ var status = false
+ val job = lifecycleScope.launch {
+ Firebase.messaging.unsubscribeFromTopic("rainbowUpdates").addOnCanceledListener {
+ status = true
+ showToast(getString(R.string.unsubscribeFailed))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = true
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", true
+ )
+ }.addOnSuccessListener {
+ status = true
+ showToast(getString(R.string.unsubscribeSuccess))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = false
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", false
+ )
+ }.addOnFailureListener {
+ status = true
+ showToast(getString(R.string.unsubscribeFailed))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = true
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", true
+ )
+ }
+ }
+ lifecycleScope.launch {
+ for (i in 1..100) if (status) break else delay(timeoutMillis / 100)
+ if (!status) {
+ job.cancel()
+ showToast(getString(R.string.unsubscribeTimeout))
+ switchPushNotifViaFcm.isEnabled = true
+ switchPushNotifViaFcm.isChecked = true
+ DataStoreUtil.putBooleanKV(
+ "rainbowFCMSubscribed", true
+ )
+ }
+ }
+ }
+
companion object {
@SuppressLint("StaticFieldLeak")
private lateinit var context: Context
diff --git a/app/src/main/res/drawable/lightbulb_fill.xml b/app/src/main/res/drawable/lightbulb_fill.xml
new file mode 100644
index 0000000..fa2f7a5
--- /dev/null
+++ b/app/src/main/res/drawable/lightbulb_fill.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/qv_logo_notification.xml b/app/src/main/res/drawable/qv_logo_notification.xml
new file mode 100644
index 0000000..b65ba3f
--- /dev/null
+++ b/app/src/main/res/drawable/qv_logo_notification.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dialog_experimental_features.xml b/app/src/main/res/layout/dialog_experimental_features.xml
index 6750e42..763b5a9 100644
--- a/app/src/main/res/layout/dialog_experimental_features.xml
+++ b/app/src/main/res/layout/dialog_experimental_features.xml
@@ -55,11 +55,23 @@
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingTop="8dp"
- android:paddingBottom="16dp"
+ android:paddingBottom="8dp"
android:text="@string/getUpdateFromTDSShiplyDistributionPlatform"
android:textColor="?attr/colorOnSurface"
app:drawableEndCompat="@drawable/arrow_right_s_line" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dialog_setting.xml b/app/src/main/res/layout/dialog_setting.xml
index c287732..6e8a59e 100644
--- a/app/src/main/res/layout/dialog_setting.xml
+++ b/app/src/main/res/layout/dialog_setting.xml
@@ -92,6 +92,14 @@
android:paddingBottom="8dp"
android:text="@string/autoCheckForUpdates" />
+
+
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 初始化 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ rainbow_notification_channel_id
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml
index 2bd1de0..d91bebb 100644
--- a/app/src/main/res/values-en-rUS/strings.xml
+++ b/app/src/main/res/values-en-rUS/strings.xml
@@ -159,4 +159,22 @@
TIM
The enumerating TIM versions function is an experimental feature included in QQ Versions Tool, which may have unpredictable stability issues. Please clearly understand and ensure that you have sufficient capability to identify and bear the risks.
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ Initialize Firebase Services
+ After initializing Firebase services, a registration token will be generated locally by the Firebase SDK, and the identifier and configuration data will be uploaded to the Firebase server. This action cannot be reversed once enabled. Do you want to continue?
+ rainbow_notification_channel_id
+ Google Play services are not detected on the current device, so Firebase services cannot be used on this device.
+ Version List Updates
+ Via Firebase Cloud Messaging
+ Enabling Firebase services allows the use of the following features: \n- Update reminders for version lists via Firebase Cloud Messaging
+ Firebase Cloud Messaging is integrated with Google Analytics. Using Firebase Cloud Messaging will inevitably upload your activity information from this software.
+ Continue
+ Firebase services has been initialized and cannot be reversed.
+ To receive notifications for version list updates, system notification permissions must be enabled; otherwise, you will not be able to receive version list update notifications.
+ Push system notifications when the version list is updated (via Firebase Cloud Messaging)
+ Unsubscribing Timeout
+ Unsubscribing Success
+ Unsubscribing Failed
+ Subscribing Timeout
+ Subscribing Success
+ Subscribing Failed
diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml
index 5e012cc..d9b12e9 100644
--- a/app/src/main/res/values-es-rES/strings.xml
+++ b/app/src/main/res/values-es-rES/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 启用 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ 版本列表更新
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml
index c136b06..3eecb6e 100644
--- a/app/src/main/res/values-fr-rFR/strings.xml
+++ b/app/src/main/res/values-fr-rFR/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 启用 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ rainbow_notification_channel_id
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml
index 5e012cc..d9b12e9 100644
--- a/app/src/main/res/values-ja-rJP/strings.xml
+++ b/app/src/main/res/values-ja-rJP/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 启用 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ 版本列表更新
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml
index 5e012cc..d9b12e9 100644
--- a/app/src/main/res/values-ko-rKR/strings.xml
+++ b/app/src/main/res/values-ko-rKR/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 启用 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ 版本列表更新
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml
index 5e012cc..d9b12e9 100644
--- a/app/src/main/res/values-ru-rRU/strings.xml
+++ b/app/src/main/res/values-ru-rRU/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 启用 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ 版本列表更新
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 5e012cc..ab88be8 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 初始化 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ rainbow_notification_channel_id
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index 01915c9..f4bf9b1 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -159,4 +159,22 @@
TIM 猜版
TIM 猜版功能為 QQ 版本列表實用工具附帶的實驗性功能,可能存在無法預知的穩定性問題。請明確並確保自身具備足夠的風險辨識和承受能力。
猜版類型添加 QQ 9.0.8.14600 空格直鏈格式
+ 初始化 Firebase 服務
+ 初始化 Firebase 服務後,將立即在本地由 Firebase SDK 生成註冊令牌,並將標識符和配置數據上傳到 Firebase 伺服器。此操作一经啟用即無法撤銷,是否繼續?
+ rainbow_notification_channel_id
+ 當前設備未檢測到 Google Play 服務,因此無法在當前設備中使用 Firebase 提供的服務。
+ 版本列表更新
+ 透過 Firebase 雲訊息傳遞
+ 啟用 Firebase 服務可使用以下功能:\n- 透過 Firebase 雲訊息傳遞的版本清單更新提醒
+ Firebase 雲訊息傳遞綁定了 Google Analytics。使用 Firebase 雲端訊息傳遞將會不可避免地上傳您在本軟體中的活躍資訊。
+ 繼續
+ Firebase 服務已初始化,無法撤銷
+ 接收版本列表更新通知提醒必須打開系統通知權限,否則無法接收版本列表更新提醒。
+ 版本列表更新時推送系統通知(通過 Firebase 雲訊息傳遞)
+ 取消訂閱超時
+ 取消訂閱成功
+ 取消訂閱失敗
+ 訂閱超時
+ 訂閱成功
+ 訂閱失敗
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c317034..ee9bb38 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -158,4 +158,22 @@
TIM 猜版
TIM 猜版功能为 QQ 版本列表实用工具附带的实验性功能,可能存在不可预知的稳定性问题。请明确并确保自身具备足够的风险识别和承受能力。
猜版类型添加 QQ 9.0.8.14600 空格直链格式
+ 初始化 Firebase 服务
+ 初始化 Firebase 服务后,将立即在本地由 Firebase SDK 生成注册令牌,并将将标识符和配置数据上传到 Firebase 服务器。此操作一经启用即无法撤销,是否继续?
+ rainbow_notification_channel_id
+ 未在当前设备检测到 Google Play 服务,因此无法在当前设备中使用由 Firebase 提供的服务。
+ 版本列表更新
+ 通过 Firebase 云消息传递
+ 启用 Firebase 服务可使用以下功能:\n- 通过 Firebase 云消息传递的版本列表更新提醒
+ Firebase 云消息传递绑定了 Google Analytics 分析服务,使用 Firebase 云消息传递将不可避免地上传您在此软件的活跃信息。
+ 继续
+ Firebase 服务已初始化,无法撤销
+ 接收版本列表更新通知提醒必须打开系统通知权限,否则无法接收版本列表更新提醒。
+ 版本列表更新时推送系统通知(通过 Firebase 云消息传递)
+ 取消订阅超时
+ 取消订阅成功
+ 取消订阅失败
+ 订阅超时
+ 订阅成功
+ 订阅失败
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index 00ee66a..98d0c03 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,11 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
- id("com.android.application") version "8.7.0" apply false
- id("org.jetbrains.kotlin.android") version "2.0.20" apply false
+ id("com.android.application") version "8.7.1" apply false
+ id("org.jetbrains.kotlin.android") version "2.0.21" apply false
}
buildscript {
+ repositories{
+ google()
+ mavenCentral()
+ }
dependencies {
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
+ classpath("com.google.gms:google-services:4.4.2")
}
}
\ No newline at end of file
From fd7497d30f09c99465e5d50bc3c172700b14ce27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Wed, 16 Oct 2024 16:54:44 +0800
Subject: [PATCH 09/40] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=20@SuppressLint=20=E6=B3=A8=E8=A7=A3=E4=BB=A5?=
=?UTF-8?q?=E5=BF=BD=E7=95=A5=20I18n=20=E8=AD=A6=E5=91=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在 showGuessVersionDialog函数中添加了 @SuppressLint("SetTextI18n") 注解,以忽略关于国际化(I18n)的警告。这是因为在该函数中使用了 setText 方法直接设置含有中文字符的字符串,可能会引发 Android 的 I18n检查机制的警告。添加此注解可以抑制这类警告,但需要注意的是,这并不意味着完全符合国际化标准,可能需要后续进行更全面的国际化处理。
---
app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index 1ffbd70..1a8adb0 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -1140,6 +1140,7 @@ class MainActivity : AppCompatActivity() {
}
}
+ @SuppressLint("SetTextI18n")
private fun showGuessVersionDialog() {
val dialogGuessBinding = DialogGuessBinding.inflate(layoutInflater)
val verBig = if (DataStoreUtil.getStringKV(
From 34e1fb372f3869e2f4a196798b6e3f483ad984f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Thu, 17 Oct 2024 16:34:40 +0800
Subject: [PATCH 10/40] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=89=8D=E5=BE=80?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE=E9=80=89=E9=A1=B9=E5=92=8C?=
=?UTF-8?q?Firebase=E6=9C=8D=E5=8A=A1=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8F=90?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 dialogError函数中添加前往系统设置的选项,用于处理通知权限问题
- 在 MainActivity 中增加 Firebase 服务初始化的提示文本
- 向资源文件中添加新的字符串资源,支持多语言
- 在 GitHub Actions 中添加插入 google-services.json 的步骤,支持 Firebase 功能
---
.github/workflows/codeql.yml | 6 +++++
.github/workflows/push_ci.yml | 6 +++++
.../xiaoniu/qqversionlist/ui/MainActivity.kt | 18 ++++++++------
.../xiaoniu/qqversionlist/util/InfoUtil.kt | 24 ++++++++++++++++---
app/src/main/res/values-ar-rSA/strings.xml | 2 ++
app/src/main/res/values-en-rUS/strings.xml | 2 ++
app/src/main/res/values-es-rES/strings.xml | 2 ++
app/src/main/res/values-fr-rFR/strings.xml | 2 ++
app/src/main/res/values-ja-rJP/strings.xml | 2 ++
app/src/main/res/values-ko-rKR/strings.xml | 2 ++
app/src/main/res/values-ru-rRU/strings.xml | 2 ++
app/src/main/res/values-zh-rCN/strings.xml | 2 ++
app/src/main/res/values-zh-rHK/strings.xml | 2 ++
app/src/main/res/values/strings.xml | 2 ++
14 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 390e7b0..fe6fcde 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -51,6 +51,12 @@ jobs:
- name: Setup local.properties
run: echo "" > local.properties
+ # 向 app 目录插入 google-services.json,文件内容来自 Secret
+ - name: Insert google-services.json
+ run: |
+ echo "google-services.json" >> app/google-services.json
+ echo "${{ secrets.GOOGLE_SERVICES }}" >> app/google-services.json
+
- name: Set up JDK
uses: actions/setup-java@v4
with:
diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml
index db24a27..51db821 100644
--- a/.github/workflows/push_ci.yml
+++ b/.github/workflows/push_ci.yml
@@ -25,6 +25,12 @@ jobs:
- name: Setup local.properties
run: echo "" > local.properties
+ # 向 app 目录插入 google-services.json,文件内容来自 Secret
+ - name: Insert google-services.json
+ run: |
+ echo "google-services.json" >> app/google-services.json
+ echo "${{ secrets.GOOGLE_SERVICES }}" >> app/google-services.json
+
- name: set up JDK 21
uses: actions/setup-java@v4
with:
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index 1a8adb0..1e15673 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -797,6 +797,7 @@ class MainActivity : AppCompatActivity() {
switchPushNotifViaFcm.isChecked = false
dialogError(
Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
+ true,
true
)
} else {
@@ -819,6 +820,12 @@ class MainActivity : AppCompatActivity() {
val dialogExperimentalFeaturesBinding =
DialogExperimentalFeaturesBinding.inflate(layoutInflater)
+ dialogExperimentalFeaturesBinding.dialogFirebase.setText(
+ if (GoogleApiAvailability.getInstance()
+ .isGooglePlayServicesAvailable(this@MainActivity) == ConnectionResult.SUCCESS && Firebase.messaging.isAutoInitEnabled
+ ) R.string.initializedFirebaseServiceItem else R.string.initFirebaseService
+ )
+
val dialogExperimentalFeatures = MaterialAlertDialogBuilder(this)
.setTitle(R.string.experimentalFeatures)
.setIcon(R.drawable.flask_line)
@@ -1015,7 +1022,7 @@ class MainActivity : AppCompatActivity() {
if (GoogleApiAvailability.getInstance()
.isGooglePlayServicesAvailable(this@MainActivity) == ConnectionResult.SUCCESS
) {
- if (Firebase.messaging.isAutoInitEnabled != true) {
+ if (!Firebase.messaging.isAutoInitEnabled) {
if (SDK_INT >= Build.VERSION_CODES.O) {
val channelTitle =
getString(R.string.rainbow_notification_channel_title)
@@ -2290,8 +2297,7 @@ class MainActivity : AppCompatActivity() {
// FCM SDK (and your app) can post notifications.
} else {
dialogError(
- Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
- true
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)), true, true
)
}
}
@@ -2306,8 +2312,7 @@ class MainActivity : AppCompatActivity() {
// FCM SDK (and your app) can post notifications.
} else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) {
dialogError(
- Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
- true
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)), true, true
)
} else {
// Directly ask for the permission
@@ -2318,8 +2323,7 @@ class MainActivity : AppCompatActivity() {
// FCM SDK (and your app) can post notifications.
} else {
dialogError(
- Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)),
- true
+ Exception(getString(R.string.cannotEnableFirebaseCloudMessaging)), true, true
)
}
}
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/util/InfoUtil.kt b/app/src/main/java/com/xiaoniu/qqversionlist/util/InfoUtil.kt
index 81167e0..bcc1dc6 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/util/InfoUtil.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/util/InfoUtil.kt
@@ -20,6 +20,9 @@ package com.xiaoniu.qqversionlist.util
import android.app.Activity
import android.app.AlertDialog
+import android.content.Intent
+import android.os.Build
+import android.provider.Settings
import android.widget.Toast
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.xiaoniu.qqversionlist.R
@@ -45,9 +48,14 @@ object InfoUtil {
* 3. 可选地,设置 `isCustomMessage` 为 `true` 以将其作为自定义错误消息而不显示跟踪堆栈。
*
* @param e 异常对象,包含了错误的信息和堆栈跟踪
- * @param isCustomMessage 布尔值,表示是否使用自定义的错误消息,默认为false
+ * @param isCustomMessage 布尔值,表示是否使用自定义的错误消息(不在前台显示跟踪堆栈),默认为 false
+ * @param isShowSystemNotifSetting 布尔值,表示是否显示前往系统通知设置按钮,默认为 false
*/
- fun Activity.dialogError(e: Exception, isCustomMessage: Boolean = false) {
+ fun Activity.dialogError(
+ e: Exception,
+ isCustomMessage: Boolean = false,
+ isShowSystemNotifSetting: Boolean = false
+ ) {
runOnUiThread {
val message = if (isCustomMessage) e.message else buildString {
appendLine("如需反馈,请前往 GitHub 仓库报告 Issue(s) 并随附以下信息:\n")
@@ -57,10 +65,20 @@ object InfoUtil {
MaterialAlertDialogBuilder(this)
.setTitle(R.string.applicationError)
.setIcon(R.drawable.alert_line)
- .setPositiveButton(R.string.done, null)
.setCancelable(false)
.setNeutralButton(R.string.copy, null)
.setMessage(message)
+ .apply {
+ if (isShowSystemNotifSetting && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ setNegativeButton(R.string.done, null)
+ setPositiveButton(R.string.toSystemSetting) { _, _ ->
+ val intent = Intent()
+ intent.action = Settings.ACTION_APP_NOTIFICATION_SETTINGS
+ intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
+ startActivity(intent)
+ }
+ } else setPositiveButton(R.string.done, null)
+ }
.create()
.apply {
setOnShowListener {
diff --git a/app/src/main/res/values-ar-rSA/strings.xml b/app/src/main/res/values-ar-rSA/strings.xml
index ab88be8..f06719d 100644
--- a/app/src/main/res/values-ar-rSA/strings.xml
+++ b/app/src/main/res/values-ar-rSA/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml
index d91bebb..358eb29 100644
--- a/app/src/main/res/values-en-rUS/strings.xml
+++ b/app/src/main/res/values-en-rUS/strings.xml
@@ -177,4 +177,6 @@
Subscribing Timeout
Subscribing Success
Subscribing Failed
+ Firebase services has been initialized
+ Go to System Settings
diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml
index d9b12e9..51aadd4 100644
--- a/app/src/main/res/values-es-rES/strings.xml
+++ b/app/src/main/res/values-es-rES/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml
index 3eecb6e..b66abe7 100644
--- a/app/src/main/res/values-fr-rFR/strings.xml
+++ b/app/src/main/res/values-fr-rFR/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml
index d9b12e9..51aadd4 100644
--- a/app/src/main/res/values-ja-rJP/strings.xml
+++ b/app/src/main/res/values-ja-rJP/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml
index d9b12e9..51aadd4 100644
--- a/app/src/main/res/values-ko-rKR/strings.xml
+++ b/app/src/main/res/values-ko-rKR/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml
index d9b12e9..51aadd4 100644
--- a/app/src/main/res/values-ru-rRU/strings.xml
+++ b/app/src/main/res/values-ru-rRU/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index ab88be8..f06719d 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -177,4 +177,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index f4bf9b1..e41809c 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -177,4 +177,6 @@
訂閱超時
訂閱成功
訂閱失敗
+ Firebase 服務已初始化
+ 前往系統設定
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ee9bb38..457a662 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -176,4 +176,6 @@
订阅超时
订阅成功
订阅失败
+ Firebase 服务已初始化
+ 前往系统设置
\ No newline at end of file
From 53db61e091c25ff550e26ae775410e5aab003770 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Thu, 17 Oct 2024 16:39:58 +0800
Subject: [PATCH 11/40] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8F=92=E5=85=A5googl?=
=?UTF-8?q?e-services.json=E7=9A=84=E6=AD=A5=E9=AA=A4=E5=9C=A8CodeQL?=
=?UTF-8?q?=E5=92=8CPush=20CI=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=B8=AD=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8F=92=E5=85=A5google-services.json?=
=?UTF-8?q?=E7=9A=84=E6=AD=A5=E9=AA=A4=E3=80=82=E7=A7=BB=E9=99=A4=E5=A4=9A?=
=?UTF-8?q?=E4=BD=99=E7=9A=84=E5=A4=B4=E9=83=A8=E4=BF=A1=E6=81=AF=EF=BC=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/codeql.yml | 3 +--
.github/workflows/push_ci.yml | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index fe6fcde..1b337db 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -54,8 +54,7 @@ jobs:
# 向 app 目录插入 google-services.json,文件内容来自 Secret
- name: Insert google-services.json
run: |
- echo "google-services.json" >> app/google-services.json
- echo "${{ secrets.GOOGLE_SERVICES }}" >> app/google-services.json
+ echo "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
- name: Set up JDK
uses: actions/setup-java@v4
diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml
index 51db821..2dd81c4 100644
--- a/.github/workflows/push_ci.yml
+++ b/.github/workflows/push_ci.yml
@@ -28,8 +28,7 @@ jobs:
# 向 app 目录插入 google-services.json,文件内容来自 Secret
- name: Insert google-services.json
run: |
- echo "google-services.json" >> app/google-services.json
- echo "${{ secrets.GOOGLE_SERVICES }}" >> app/google-services.json
+ echo "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
- name: set up JDK 21
uses: actions/setup-java@v4
From 3ef029d2130023d48601fb00a42b958a46d84952 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Thu, 17 Oct 2024 16:52:50 +0800
Subject: [PATCH 12/40] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCI=E6=B5=81=E7=A8=8B?=
=?UTF-8?q?=E4=B8=ADGoogleServices=E6=96=87=E4=BB=B6=E6=8F=92=E5=85=A5?=
=?UTF-8?q?=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在CodeQL和PushCI工作流中,修改插入google-services.json文件的内容时增加-n选项,确保文件内容正确写入,避免额外的空行或空格导致的错误。
---
.github/workflows/codeql.yml | 3 +--
.github/workflows/push_ci.yml | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 1b337db..e9f7839 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -53,8 +53,7 @@ jobs:
# 向 app 目录插入 google-services.json,文件内容来自 Secret
- name: Insert google-services.json
- run: |
- echo "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
+ run: echo -n "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
- name: Set up JDK
uses: actions/setup-java@v4
diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml
index 2dd81c4..319463f 100644
--- a/.github/workflows/push_ci.yml
+++ b/.github/workflows/push_ci.yml
@@ -27,8 +27,7 @@ jobs:
# 向 app 目录插入 google-services.json,文件内容来自 Secret
- name: Insert google-services.json
- run: |
- echo "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
+ run: echo -n "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
- name: set up JDK 21
uses: actions/setup-java@v4
From ee9390cfa760d3d33ce6e89db217d45efe7419ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Thu, 17 Oct 2024 17:03:29 +0800
Subject: [PATCH 13/40] =?UTF-8?q?=E6=94=B9=E8=BF=9B`google-services.json`?=
=?UTF-8?q?=E7=9A=84=E6=8F=92=E5=85=A5=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
使用`cat< app/google-services.json
+ run: |
+ cat < app/google-services.json
+ ${{ secrets.GOOGLE_SERVICES }}
+ EOF
+ shell: bash
- name: Set up JDK
uses: actions/setup-java@v4
diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml
index 319463f..1b4407f 100644
--- a/.github/workflows/push_ci.yml
+++ b/.github/workflows/push_ci.yml
@@ -27,7 +27,11 @@ jobs:
# 向 app 目录插入 google-services.json,文件内容来自 Secret
- name: Insert google-services.json
- run: echo -n "${{ secrets.GOOGLE_SERVICES }}" > app/google-services.json
+ run: |
+ cat < app/google-services.json
+ ${{ secrets.GOOGLE_SERVICES }}
+ EOF
+ shell: bash
- name: set up JDK 21
uses: actions/setup-java@v4
From d80398ef0700cb97ef39bc9dfebac5901327efc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Fri, 18 Oct 2024 14:04:41 +0800
Subject: [PATCH 14/40] =?UTF-8?q?ci:=20=E6=9B=B4=E6=96=B0=20.gitignore=20?=
=?UTF-8?q?=E5=92=8C=20GitHub=20Actions=20=E5=B7=A5=E4=BD=9C=E6=B5=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 .gitignore 中添加 app/google-services.json,防止敏感信息泄露
- 更新 GitHub Actions CodeQL 分析工作流,仅在特定仓库中运行
---
.github/workflows/codeql.yml | 1 +
.gitignore | 1 +
2 files changed, 2 insertions(+)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 60b9307..b226e12 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -44,6 +44,7 @@ jobs:
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+ if: ${{ github.repository == 'klxiaoniu/QQVersionList' !! github.repository == 'ArcticFoxPro/QQVersionList' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.gitignore b/.gitignore
index c25677c..be2ed17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ local.properties
/app/release
/.idea
/app/debug
+app/google-services.json
From ded3ff48a97ffe3ab89d8c54b638f6aeb61f34d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Fri, 18 Oct 2024 14:04:41 +0800
Subject: [PATCH 15/40] =?UTF-8?q?ci:=20=E6=9B=B4=E6=96=B0=20.gitignore=20?=
=?UTF-8?q?=E5=92=8C=20GitHub=20Actions=20=E5=B7=A5=E4=BD=9C=E6=B5=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 .gitignore 中添加 app/google-services.json,防止敏感信息泄露
- 更新 GitHub Actions CodeQL 分析工作流,仅在特定仓库中运行
---
.github/workflows/codeql.yml | 1 +
.gitignore | 1 +
2 files changed, 2 insertions(+)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 60b9307..067cfa2 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -44,6 +44,7 @@ jobs:
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+ if: ${{ github.repository == 'klxiaoniu/QQVersionList' || github.repository == 'ArcticFoxPro/QQVersionList' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.gitignore b/.gitignore
index c25677c..be2ed17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ local.properties
/app/release
/.idea
/app/debug
+app/google-services.json
From 24570818a230cf08c6d4dfbba507d2137e68d3e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Fri, 18 Oct 2024 14:17:01 +0800
Subject: [PATCH 16/40] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E4=B9=9D?=
=?UTF-8?q?=E4=B8=83=E5=85=AC=E5=8F=B8=E3=80=8C=E9=80=9A=E7=9F=A5=E4=B8=AD?=
=?UTF-8?q?=E5=BF=83=E3=80=8D=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?=
=?UTF-8?q?=E6=83=85=E5=86=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-2024 年 10 月 17 日,「通知中心」微信小程序改名为「通知侠」重新上线
- 因内容安全问题,去掉了 GitHub Releases 更新订阅
- 更新了相关文档页面,说明当前情况
---
README.md | 4 ++--
ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 6d9872d..2627455 100644
--- a/README.md
+++ b/README.md
@@ -185,8 +185,8 @@ QQ、TIM、微信、企业微信、微信输入法使用腾讯应用宝([腾
-> [!important]
-> 2024 年 8 月 2 日,[九七公司「通知中心」微信小程序被微信公众平台以“无实质服务内容引导跳转”暂停服务](https://mp.weixin.qq.com/s/ITU6H_UjA804srGeE2-FOA)。下方“九七公司「通知中心」微信小程序”方案可能在一段时间内不可用。
+> [!warning]
+> 2024 年 10 月 17 日,九七公司「通知中心」微信小程序改名为「通知侠」重新上线,但因内容安全为由去掉了 GitHub Releases 更新订阅。故下方内容不再可用。
>
>
diff --git a/ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md b/ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md
index 794794b..aaad447 100644
--- a/ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md
+++ b/ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md
@@ -1,3 +1,6 @@
+> [!warning]
+> 2024 年 10 月 17 日,九七公司「通知中心」微信小程序改名为「通知侠」重新上线,但因内容安全为由去掉了 GitHub Releases 更新订阅。故此页面内容不再可用。
+
> [!important]
> 2024 年 8 月 2 日,[九七公司「通知中心」微信小程序被微信公众平台以“无实质服务内容引导跳转”暂停服务](https://mp.weixin.qq.com/s/ITU6H_UjA804srGeE2-FOA)。此页面内容可能在一段时间内不可用。
From 56cce4ac2c5306fa4b7f9de6ebf7295c3dfd5019 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Fri, 18 Oct 2024 14:34:43 +0800
Subject: [PATCH 17/40] =?UTF-8?q?refactor(app):=20=E6=9B=B4=E6=96=B0?=
=?UTF-8?q?=E5=85=B3=E4=BA=8E=E9=A1=B5=E9=9D=A2=E6=96=87=E6=9C=AC=E5=86=85?=
=?UTF-8?q?=E5=AE=B9=E5=B9=B6=E6=B3=A8=E9=87=8A=E9=83=A8=E5=88=86=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除了关于页面中对九七通知中心的提及,因内容安全问题已停止使用
- 注释了与九七通知中心相关的代码部分
- 添加了对 Firebase 云消息传递订阅和退订 API 问题的注释
---
.../java/com/xiaoniu/qqversionlist/ui/MainActivity.kt | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index 1e15673..bcef945 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -292,6 +292,7 @@ class MainActivity : AppCompatActivity() {
aboutText.movementMethod =
LinkMovementMethodCompat.getInstance()
+ // 九七通知中心因为内容安全原因去掉了 GitHub Releases 更新订阅
aboutText.text = SpannableString(
"${getString(R.string.aboutAppName)}\n\n" +
"${getString(R.string.version)}${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})\n" +
@@ -299,7 +300,7 @@ class MainActivity : AppCompatActivity() {
"${getString(R.string.aboutContributor)}Col_or、bggRGjQaUbCoE、GMerge、zwJimRaynor\n" +
"${getString(R.string.aboutSpecialThanksTo)}owo233\n" +
"${getString(R.string.aboutOpenSourceRepo)}GitHub\n" +
- "${getString(R.string.aboutGetUpdate)}GitHub Releases、Obtainium、九七通知中心\n" +
+ "${getString(R.string.aboutGetUpdate)}GitHub Releases、Obtainium\n" +
"${getString(R.string.facilitateI18n)}Crowdin\n\n" +
"Since 2023.8.9"
).apply {
@@ -363,12 +364,12 @@ class MainActivity : AppCompatActivity() {
indexOf("Obtainium") + "Obtainium".length,
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE
)
- setSpan(
+ /*setSpan(
URLSpan("https://github.com/klxiaoniu/QQVersionList/blob/master/ReadmeAssets/Get-it-on-JiuQi-NotifCenter-WeChatMiniProgram.md"),
indexOf("九七通知中心"),
indexOf("九七通知中心") + "九七通知中心".length,
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE
- )
+ )*/
setSpan(
URLSpan("https://crowdin.com/project/qqversionstool"),
indexOf("Crowdin"),
@@ -2329,6 +2330,8 @@ class MainActivity : AppCompatActivity() {
}
}
+ // Firebase 云消息传递订阅和退订 API 有问题,会在无法连接 Google 服务器时无限重试,还无法通过生命周期等线程进行管理和关闭甚至杀死相关进程
+ // 下面两个方法实现不对,给 Firebase 提了 Issue,接下来等 Firebase 更改相关 API 或者进一步回复再改
private fun subscribeWithTimeout(
timeoutMillis: Long, switchPushNotifViaFcm: MaterialSwitch
) {
From d1f667a36a4e8bf22abc84646cfaad3bb2e4afd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 13:44:48 +0800
Subject: [PATCH 18/40] =?UTF-8?q?build(deps):=20=E6=9B=B4=E6=96=B0=20mater?=
=?UTF-8?q?ial-components=E4=BE=9D=E8=B5=96=E5=88=B0=201.13.0-alpha07=20?=
=?UTF-8?q?=E7=89=88=E6=9C=AC-=20=E5=B0=86=20com.google.android.material:m?=
=?UTF-8?q?aterial=20=E4=BE=9D=E8=B5=96=E4=BB=8E=201.13.0-alpha06=20?=
=?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B0=201.13.0-alpha07=20-=20=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=20Dependabot=20=E6=9B=B4=E6=96=B0=E9=A2=91=E7=8E=87?=
=?UTF-8?q?=E4=BB=8E=E6=AF=8F=E6=9C=88=E4=B8=80=E6=AC=A1=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E6=AF=8F=E5=A4=A9=E4=B8=80=E6=AC=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/dependabot.yml | 4 ++--
app/build.gradle.kts | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 71272e1..1a3c7ad 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -8,7 +8,7 @@ updates:
- package-ecosystem: gradle
directory: /
schedule:
- interval: monthly
+ interval: daily
groups:
maven-dependencies:
patterns:
@@ -17,7 +17,7 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
- interval: monthly
+ interval: daily
groups:
action-dependencies:
patterns:
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 77ec9e2..9aa1ada 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -97,7 +97,7 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.core:core-splashscreen:1.1.0-rc01")
- implementation("com.google.android.material:material:1.13.0-alpha06")
+ implementation("com.google.android.material:material:1.13.0-alpha07")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
From 99c1678d4428b8342b651ebef4e100e2297fe5ba Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 19 Oct 2024 13:48:33 +0800
Subject: [PATCH 19/40] Bump actions/upload-artifact in the action-dependencies
group (#10)
Bumps the action-dependencies group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact).
Updates `actions/upload-artifact` from 4.4.0 to 4.4.3
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.4.0...v4.4.3)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: action-dependencies
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/push_ci.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml
index 1b4407f..dcf2343 100644
--- a/.github/workflows/push_ci.yml
+++ b/.github/workflows/push_ci.yml
@@ -53,14 +53,14 @@ jobs:
KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
- name: Upload release
- uses: actions/upload-artifact@v4.4.0
+ uses: actions/upload-artifact@v4.4.3
with:
path: ${{github.workspace}}/app/build/outputs/apk/release/*.apk
name: QQVersionList-release-${{ github.event.head_commit.id }}
retention-days: 90
- name: Upload mappings
- uses: actions/upload-artifact@v4.4.0
+ uses: actions/upload-artifact@v4.4.3
with:
path: ${{github.workspace}}/app/build/outputs/mapping/release/mapping.txt
name: QQVersionList-release-${{ github.event.head_commit.id }}-mapping
From 2367646aa44062c1c49a3d7b5278e4bea93fdf9c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 19 Oct 2024 13:50:01 +0800
Subject: [PATCH 20/40] Bump the maven-dependencies group with 3 updates (#11)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Bump the maven-dependencies group with 3 updates
Bumps the maven-dependencies group with 3 updates: androidx.core:core-splashscreen, [org.jetbrains.kotlinx:kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) and [plugin.serialization](https://github.com/JetBrains/kotlin).
Updates `androidx.core:core-splashscreen` from 1.1.0-rc01 to 1.2.0-alpha02
Updates `org.jetbrains.kotlinx:kotlinx-coroutines-android` from 1.8.1 to 1.9.0
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.8.1...1.9.0)
Updates `plugin.serialization` from 2.0.20 to 2.0.21
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.20...v2.0.21)
---
updated-dependencies:
- dependency-name: androidx.core:core-splashscreen
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: maven-dependencies
- dependency-name: plugin.serialization
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: maven-dependencies
...
Signed-off-by: dependabot[bot]
* Update build.gradle.kts
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 有鲫雪狐 <139336664+ArcticFoxPro@users.noreply.github.com>
---
app/build.gradle.kts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 9aa1ada..fc3df80 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -23,7 +23,7 @@ plugins {
id("org.jetbrains.kotlin.android")
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
id("com.google.gms.google-services")
- kotlin("plugin.serialization") version "2.0.20"
+ kotlin("plugin.serialization") version "2.0.21"
}
fun String.execute(currentWorkingDir: File = file("./")): String {
@@ -116,5 +116,5 @@ dependencies {
implementation(platform("com.google.firebase:firebase-bom:33.4.0"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging")
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
}
From 7c4f9ab33a4a73fee3998fb3f0bbca4ea5cfb86e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 13:52:58 +0800
Subject: [PATCH 21/40] =?UTF-8?q?ci(dependabot):=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E4=BE=9D=E8=B5=96=E6=9B=B4=E6=96=B0=E9=A2=91=E7=8E=87=E5=B9=B6?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 Gradle 和 GitHub Actions 的依赖更新频率从每日改为每月
- 完善 FirebaseMessagingService 中的通知功能:
-指定通知点击后跳转到 MainActivity
- 优化代码格式
---
.github/dependabot.yml | 4 ++--
.../qqversionlist/service/FirebaseMessagingService.kt | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 1a3c7ad..71272e1 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -8,7 +8,7 @@ updates:
- package-ecosystem: gradle
directory: /
schedule:
- interval: daily
+ interval: monthly
groups:
maven-dependencies:
patterns:
@@ -17,7 +17,7 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
- interval: daily
+ interval: monthly
groups:
action-dependencies:
patterns:
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
index 138bcb5..2116970 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
@@ -7,6 +7,7 @@ import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.xiaoniu.qqversionlist.R
+import com.xiaoniu.qqversionlist.ui.MainActivity
class FirebaseMessagingService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
@@ -15,8 +16,8 @@ class FirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (!remoteMessage.data.isNotEmpty()) {
- // 创建一个 Intent,用于点击通知后跳转到某个 Activity
- val intent = Intent().apply {}
+ // 创建一个 Intent,用于点击通知后跳转到 MainActivity
+ val intent = Intent(this, MainActivity::class.java)
val pendingIntent = PendingIntent.getActivity(
this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
@@ -27,7 +28,8 @@ class FirebaseMessagingService : FirebaseMessagingService() {
).setSmallIcon(R.drawable.qv_logo_notification)
.setContentTitle(remoteMessage.notification!!.title)
.setContentText(remoteMessage.notification!!.body)
- .setPriority(NotificationCompat.PRIORITY_DEFAULT).setContentIntent(pendingIntent)
+ .setPriority(NotificationCompat.PRIORITY_DEFAULT)
+ .setContentIntent(pendingIntent)
.setAutoCancel(true)
// 获取 NotificationManager 并发送通知
From 390267b0752bcc41af84fa425c23871ddd2cce9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 14:04:42 +0800
Subject: [PATCH 22/40] =?UTF-8?q?refactor(service):=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=20FirebaseMessagingService=20=E4=B8=AD=E7=9A=84=E9=80=9A?=
=?UTF-8?q?=E7=9F=A5=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除了未使用的导入
-简化了 PendingIntent 的创建方式- 更新了通知跳转的 Intent 实现
---
.../qqversionlist/service/FirebaseMessagingService.kt | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
index 2116970..516fb8a 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
@@ -7,7 +7,6 @@ import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.xiaoniu.qqversionlist.R
-import com.xiaoniu.qqversionlist.ui.MainActivity
class FirebaseMessagingService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
@@ -17,10 +16,9 @@ class FirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (!remoteMessage.data.isNotEmpty()) {
// 创建一个 Intent,用于点击通知后跳转到 MainActivity
- val intent = Intent(this, MainActivity::class.java)
- val pendingIntent = PendingIntent.getActivity(
- this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
+ val intent = Intent().setClassName(this, "com.xiaoniu.qqversionlist.ui.MainActivity")
+ val pendingIntent =
+ PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)
// 创建 Notification
val notificationBuilder = NotificationCompat.Builder(
From 135404eca553dc8d905b5520877f06ad0ac01dbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 14:31:14 +0800
Subject: [PATCH 23/40] =?UTF-8?q?refactor(service):=20=E7=A7=BB=E9=99=A4?=
=?UTF-8?q?=20FirebaseMessagingService=20=E4=B8=AD=E7=9A=84=E5=86=97?=
=?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81-=20=E5=88=A0=E9=99=A4=E4=BA=86?=
=?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=20PendingIntent=20?=
=?UTF-8?q?=E5=92=8C=20Intent=20=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=20-?=
=?UTF-8?q?=20=E5=B0=86=20setContentIntent=20=E8=AE=BE=E7=BD=AE=E4=B8=BA?=
=?UTF-8?q?=20null=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=BA=86=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=90=8E=E7=9A=84=E8=B7=B3=E8=BD=AC=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../qqversionlist/service/FirebaseMessagingService.kt | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
index 516fb8a..8778ff0 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/service/FirebaseMessagingService.kt
@@ -15,11 +15,6 @@ class FirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (!remoteMessage.data.isNotEmpty()) {
- // 创建一个 Intent,用于点击通知后跳转到 MainActivity
- val intent = Intent().setClassName(this, "com.xiaoniu.qqversionlist.ui.MainActivity")
- val pendingIntent =
- PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)
-
// 创建 Notification
val notificationBuilder = NotificationCompat.Builder(
this, getString(R.string.rainbow_notification_channel_id)
@@ -27,7 +22,7 @@ class FirebaseMessagingService : FirebaseMessagingService() {
.setContentTitle(remoteMessage.notification!!.title)
.setContentText(remoteMessage.notification!!.body)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
- .setContentIntent(pendingIntent)
+ .setContentIntent(null)
.setAutoCancel(true)
// 获取 NotificationManager 并发送通知
From 7d37e0e101a719b04e86d7462b8d634394be9010 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 19:55:56 +0800
Subject: [PATCH 24/40] =?UTF-8?q?build(app):=20=E9=9B=86=E6=88=90=20Compos?=
=?UTF-8?q?e=20=E5=B9=B6=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 build.gradle.kts 中启用 Compose
- 添加 Compose 相关的依赖库
- 更新 firebase 和 coroutines 依赖
- 修改 dependabot.yml,将更新频率改为每日
---
.github/dependabot.yml | 2 +-
app/build.gradle.kts | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 71272e1..da9441e 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -8,7 +8,7 @@ updates:
- package-ecosystem: gradle
directory: /
schedule:
- interval: monthly
+ interval: daily
groups:
maven-dependencies:
patterns:
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index fc3df80..c651f57 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -89,6 +89,7 @@ android {
buildFeatures {
viewBinding = true
buildConfig = true
+ compose = true
}
}
@@ -117,4 +118,19 @@ dependencies {
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
+
+ val composeBom = platform("androidx.compose:compose-bom:2024.09.00")
+ implementation(composeBom)
+ androidTestImplementation(composeBom)
+ implementation("androidx.compose.material3:material3:1.3.0")
+ implementation("androidx.compose.ui:ui-tooling-preview:1.7.4")
+ debugImplementation("androidx.compose.ui:ui-tooling:1.7.4")
+ androidTestImplementation("androidx.compose.ui:ui-test-junit4-android:1.7.4")
+ debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.4")
+ implementation("androidx.compose.material:material-icons-core:1.7.4")
+ implementation("androidx.compose.material:material-icons-extended:1.7.4")
+ implementation("androidx.compose.material3.adaptive:adaptive:1.0.0")
+ implementation("androidx.activity:activity-compose:1.9.3")
+ implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6")
+ implementation("androidx.compose.runtime:runtime-livedata:1.7.4")
}
From 752e2acd45314a1627335816d9df149fd6f3b7f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 19:58:26 +0800
Subject: [PATCH 25/40] =?UTF-8?q?build(app):=20=E5=8D=87=E7=BA=A7=20Compos?=
=?UTF-8?q?e=20=E7=89=88=E6=9C=AC=E5=B9=B6=E8=B0=83=E6=95=B4=20Dependabot?=
=?UTF-8?q?=20=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 Compose 版本从 2024.09.00 升级到 2024.10.00- 修改 Dependabot 配置,将检查频率从每日改为每月
---
.github/dependabot.yml | 2 +-
app/build.gradle.kts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index da9441e..71272e1 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -8,7 +8,7 @@ updates:
- package-ecosystem: gradle
directory: /
schedule:
- interval: daily
+ interval: monthly
groups:
maven-dependencies:
patterns:
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index c651f57..54d38ee 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -119,7 +119,7 @@ dependencies {
implementation("com.google.firebase:firebase-messaging")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
- val composeBom = platform("androidx.compose:compose-bom:2024.09.00")
+ val composeBom = platform("androidx.compose:compose-bom:2024.10.00")
implementation(composeBom)
androidTestImplementation(composeBom)
implementation("androidx.compose.material3:material3:1.3.0")
From e6655c318340ae50f2266c318c93e4a01bb27c4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 20:00:17 +0800
Subject: [PATCH 26/40] =?UTF-8?q?ci:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E5=88=86=E6=9E=90=E8=A7=A6=E5=8F=91=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 codeql.yml 文件中添加了对 commit 消息的判断
- 只有当 commit 消息不以 '[skip ci]' 开头时才执行代码分析
- 这样可以避免不必要的 CI 流程运行,提高工作效率
---
.github/workflows/codeql.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 067cfa2..91d2668 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -44,7 +44,7 @@ jobs:
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
- if: ${{ github.repository == 'klxiaoniu/QQVersionList' || github.repository == 'ArcticFoxPro/QQVersionList' }}
+ if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') && (github.repository == 'klxiaoniu/QQVersionList' || github.repository == 'ArcticFoxPro/QQVersionList') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
From d3999a031c5a5c4ceb34f5fcac66998e8e8db7ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 20:06:31 +0800
Subject: [PATCH 27/40] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9=20CodeQL=20?=
=?UTF-8?q?=E5=88=86=E6=9E=90=E8=A7=A6=E5=8F=91=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将触发条件从提交消息检查改为检查事件类型- 只在非 pull request事件时触发分析
- 适用于 'klxiaoniu/QQVersionList' 和 'ArcticFoxPro/QQVersionList' 仓库
---
.github/workflows/codeql.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 91d2668..0f43058 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -44,7 +44,7 @@ jobs:
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
- if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') && (github.repository == 'klxiaoniu/QQVersionList' || github.repository == 'ArcticFoxPro/QQVersionList') }}
+ if: ${{ github.event_name != 'pull_request' && (github.repository == 'klxiaoniu/QQVersionList' || github.repository == 'ArcticFoxPro/QQVersionList') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
From 4a6be79fa5dfbeb85ab6a7f56c2e2a76b2d124ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 20:15:25 +0800
Subject: [PATCH 28/40] =?UTF-8?q?build(app):=20=E6=9B=B4=E6=96=B0=20Compos?=
=?UTF-8?q?e=20=E7=9B=B8=E5=85=B3=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除 Compose 相关依赖的具体版本号,使用 BOM 管理版本
- 添加 Kotlin Compose 插件
---
app/build.gradle.kts | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 54d38ee..72aced6 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -24,6 +24,7 @@ plugins {
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
id("com.google.gms.google-services")
kotlin("plugin.serialization") version "2.0.21"
+ id("org.jetbrains.kotlin.plugin.compose") version "2.0.21"
}
fun String.execute(currentWorkingDir: File = file("./")): String {
@@ -122,15 +123,15 @@ dependencies {
val composeBom = platform("androidx.compose:compose-bom:2024.10.00")
implementation(composeBom)
androidTestImplementation(composeBom)
- implementation("androidx.compose.material3:material3:1.3.0")
- implementation("androidx.compose.ui:ui-tooling-preview:1.7.4")
- debugImplementation("androidx.compose.ui:ui-tooling:1.7.4")
- androidTestImplementation("androidx.compose.ui:ui-test-junit4-android:1.7.4")
- debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.4")
- implementation("androidx.compose.material:material-icons-core:1.7.4")
- implementation("androidx.compose.material:material-icons-extended:1.7.4")
- implementation("androidx.compose.material3.adaptive:adaptive:1.0.0")
+ implementation("androidx.compose.material3:material3")
+ implementation("androidx.compose.ui:ui-tooling-preview")
+ debugImplementation("androidx.compose.ui:ui-tooling")
+ androidTestImplementation("androidx.compose.ui:ui-test-junit4-android")
+ debugImplementation("androidx.compose.ui:ui-test-manifest")
+ implementation("androidx.compose.material:material-icons-core")
+ implementation("androidx.compose.material:material-icons-extended")
+ implementation("androidx.compose.material3.adaptive:adaptive")
implementation("androidx.activity:activity-compose:1.9.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6")
- implementation("androidx.compose.runtime:runtime-livedata:1.7.4")
+ implementation("androidx.compose.runtime:runtime-livedata")
}
From f8c8dac0855c510d8225e2d3701f5f2adbbe03eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sat, 19 Oct 2024 21:11:11 +0800
Subject: [PATCH 29/40] =?UTF-8?q?refactor(app):=20=E7=A7=BB=E9=99=A4=20Com?=
=?UTF-8?q?pose=20=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 删除了 build.gradle.kts 中的 Compose 插件和相关依赖- 移除了 buildFeatures 中的 compose 配置项
- 删除了与 Compose 相关的所有实现和测试依赖
---
app/build.gradle.kts | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 72aced6..fc3df80 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -24,7 +24,6 @@ plugins {
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
id("com.google.gms.google-services")
kotlin("plugin.serialization") version "2.0.21"
- id("org.jetbrains.kotlin.plugin.compose") version "2.0.21"
}
fun String.execute(currentWorkingDir: File = file("./")): String {
@@ -90,7 +89,6 @@ android {
buildFeatures {
viewBinding = true
buildConfig = true
- compose = true
}
}
@@ -119,19 +117,4 @@ dependencies {
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
-
- val composeBom = platform("androidx.compose:compose-bom:2024.10.00")
- implementation(composeBom)
- androidTestImplementation(composeBom)
- implementation("androidx.compose.material3:material3")
- implementation("androidx.compose.ui:ui-tooling-preview")
- debugImplementation("androidx.compose.ui:ui-tooling")
- androidTestImplementation("androidx.compose.ui:ui-test-junit4-android")
- debugImplementation("androidx.compose.ui:ui-test-manifest")
- implementation("androidx.compose.material:material-icons-core")
- implementation("androidx.compose.material:material-icons-extended")
- implementation("androidx.compose.material3.adaptive:adaptive")
- implementation("androidx.activity:activity-compose:1.9.3")
- implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6")
- implementation("androidx.compose.runtime:runtime-livedata")
}
From ba05e7c03e16c4f5a8f68d1a94825e1c8a0d001d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sun, 20 Oct 2024 15:42:51 +0800
Subject: [PATCH 30/40] =?UTF-8?q?feat(ui):=20=E4=B8=BA=20QQ=20=E5=92=8C=20?=
=?UTF-8?q?TIM=20=E7=89=88=E6=9C=AC=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=BF=AB=E9=80=9F=E6=BB=9A=E5=8A=A8=E6=9D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 QQVersionListFragment 和 TIMVersionListFragment 中集成 FastScroller
- 添加 AndroidFastScroll依赖并更新 README.md
-优化版本列表的布局和适配
---
README.md | 1 +
app/build.gradle.kts | 1 +
.../qqversionlist/ui/QQVersionListFragment.kt | 9 ++++++---
.../qqversionlist/ui/TIMVersionListFragment.kt | 12 ++++++++----
4 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 2627455..f2e7a9f 100644
--- a/README.md
+++ b/README.md
@@ -269,6 +269,7 @@ QQ 版本列表实用工具的诞生离不开以下开源项目,感谢以下
- [Obtainium(Imran)](https://github.com/ImranR98/Obtainium),Licensed under [GNU General Public License Version 3](https://github.com/ImranR98/Obtainium/blob/main/LICENSE.md)
- [Secrets Gradle Plugin for Android(Google)](https://github.com/google/secrets-gradle-plugin),Licensed under [Apache License Version 2.0](https://github.com/google/secrets-gradle-plugin/blob/main/LICENSE)
- [Firebase Android Open Source Development(Google)](https://firebase.google.com/),Licensed under [Apache License Version 2.0](https://github.com/firebase/firebase-android-sdk/blob/main/LICENSE)
+- [AndroidFastScroll(张海)](https://github.com/zhanghai/AndroidFastScroll),Licensed under [Apache License Version 2.0](https://github.com/zhanghai/AndroidFastScroll/blob/master/LICENSE)
## 商业服务鸣谢
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index fc3df80..e2ffe82 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -117,4 +117,5 @@ dependencies {
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
+ implementation("me.zhanghai.android.fastscroll:library:1.3.0")
}
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
index 6e6860a..79781de 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
@@ -30,7 +30,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.xiaoniu.qqversionlist.databinding.RecycleQqVersionBinding
+import com.xiaoniu.qqversionlist.util.Extensions.dp
import com.xiaoniu.qqversionlist.util.Extensions.pxToDp
+import me.zhanghai.android.fastscroll.FastScrollerBuilder
class QQVersionListFragment : Fragment() {
private var _fragmentBinding: RecycleQqVersionBinding? = null
@@ -69,11 +71,12 @@ class QQVersionListFragment : Fragment() {
val concatenated = ConcatAdapter(thisActivity.localQQAdapter, thisActivity.qqVersionAdapter)
val screenWidthDp = (Resources.getSystem().displayMetrics.widthPixels).pxToDp
val screenHeightDp = (Resources.getSystem().displayMetrics.heightPixels).pxToDp
- fragmentBinding.rvContent.apply {
- adapter = concatenated
+ fragmentBinding.apply {
+ rvContent.adapter = concatenated
+ FastScrollerBuilder(rvContent).useMd2Style().setPadding(0, 8.dp, 0, 200.dp).build()
// 当横纵逻辑像素都大于 600 时,根据横向逻辑像素的不同区间显示不同的瀑布流布局
// 小于 600 时显示线性布局
- layoutManager = if (screenHeightDp >= 600) {
+ rvContent.layoutManager = if (screenHeightDp >= 600) {
when {
screenWidthDp in 600..840 -> StaggeredGridLayoutManager(
2, StaggeredGridLayoutManager.VERTICAL
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
index 089bc86..022eec6 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
@@ -30,7 +30,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.xiaoniu.qqversionlist.databinding.RecycleTimVersionBinding
+import com.xiaoniu.qqversionlist.util.Extensions.dp
import com.xiaoniu.qqversionlist.util.Extensions.pxToDp
+import me.zhanghai.android.fastscroll.FastScrollerBuilder
class TIMVersionListFragment : Fragment() {
private var _fragmentBinding: RecycleTimVersionBinding? = null
@@ -66,14 +68,16 @@ class TIMVersionListFragment : Fragment() {
}
private fun versionListStaggeredGridLayout(thisActivity: MainActivity) {
- val concatenated = ConcatAdapter(thisActivity.localTIMAdapter, thisActivity.timVersionAdapter)
+ val concatenated =
+ ConcatAdapter(thisActivity.localTIMAdapter, thisActivity.timVersionAdapter)
val screenWidthDp = (Resources.getSystem().displayMetrics.widthPixels).pxToDp
val screenHeightDp = (Resources.getSystem().displayMetrics.heightPixels).pxToDp
- fragmentBinding.rvTimContent.apply {
- adapter = concatenated
+ fragmentBinding.apply {
+ rvTimContent.adapter = concatenated
+ FastScrollerBuilder(rvTimContent).useMd2Style().setPadding(0, 8.dp, 0, 200.dp).build()
// 当横纵逻辑像素都大于 600 时,根据横向逻辑像素的不同区间显示不同的瀑布流布局
// 小于 600 时显示线性布局
- layoutManager = if (screenHeightDp >= 600) {
+ rvTimContent.layoutManager = if (screenHeightDp >= 600) {
when {
screenWidthDp in 600..840 -> StaggeredGridLayoutManager(
2, StaggeredGridLayoutManager.VERTICAL
From 2a5716fe91d9c7f98082fd88e251cfab12bdebd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?=
<139336664+ArcticFoxPro@users.noreply.github.com>
Date: Sun, 20 Oct 2024 16:18:41 +0800
Subject: [PATCH 31/40] =?UTF-8?q?refactor(scroll):=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=B8=83?=
=?UTF-8?q?=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修改了多个布局文件中的滚动条类型和样式
- 调整了部分布局文件的内边距
- 移除了 QQVersionListFragment 和 TIMVersionListFragment 中的 FastScrollerBuilder 设置
- 在 MainActivity 中为 UserAgreement 和 ExpBackDialog 添加了 FastScrollerBuilder 设置
---
.../xiaoniu/qqversionlist/ui/MainActivity.kt | 17 ++++++++++++-----
.../qqversionlist/ui/QQVersionListFragment.kt | 1 -
.../qqversionlist/ui/TIMVersionListFragment.kt | 1 -
app/src/main/res/layout/dialog_exp_back.xml | 10 ++++++----
app/src/main/res/layout/user_agreement.xml | 7 ++++---
5 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index bcef945..61c111c 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -100,6 +100,7 @@ import com.xiaoniu.qqversionlist.databinding.UpdateQvtButtonBinding
import com.xiaoniu.qqversionlist.databinding.UserAgreementBinding
import com.xiaoniu.qqversionlist.util.ClipboardUtil.copyText
import com.xiaoniu.qqversionlist.util.DataStoreUtil
+import com.xiaoniu.qqversionlist.util.Extensions.dp
import com.xiaoniu.qqversionlist.util.InfoUtil.dialogError
import com.xiaoniu.qqversionlist.util.InfoUtil.showToast
import com.xiaoniu.qqversionlist.util.ShiplyUtil
@@ -113,6 +114,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
+import me.zhanghai.android.fastscroll.FastScrollerBuilder
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
@@ -230,6 +232,9 @@ class MainActivity : AppCompatActivity() {
}
if (agreed) userAgreementBinding.uaButtonDisagree.setText(R.string.withdrawConsentAndExit)
+ FastScrollerBuilder(userAgreementBinding.UAScroll).useMd2Style()
+ .setPadding(0, 0, 0, 0).build()
+
dialogUA.show()
}
@@ -1966,20 +1971,20 @@ class MainActivity : AppCompatActivity() {
}
private fun showExpBackDialog(sourceDataJson: String, dialogTitle: String) {
- val dialogShiplyBackBinding =
+ val dialogExpBackBinding =
DialogExpBackBinding.inflate(layoutInflater)
- dialogShiplyBackBinding.root.parent?.let { parent ->
- if (parent is ViewGroup) parent.removeView(dialogShiplyBackBinding.root)
+ dialogExpBackBinding.root.parent?.let { parent ->
+ if (parent is ViewGroup) parent.removeView(dialogExpBackBinding.root)
}
val shiplyApkUrl =
sourceDataJson.toPrettyFormat().getAllAPKUrl()
- dialogShiplyBackBinding.apply {
+ dialogExpBackBinding.apply {
MaterialAlertDialogBuilder(this@MainActivity)
.setView(
- dialogShiplyBackBinding.root
+ dialogExpBackBinding.root
).setTitle(dialogTitle)
.setIcon(R.drawable.flask_line)
.show().apply {
@@ -2000,6 +2005,8 @@ class MainActivity : AppCompatActivity() {
}
expBackText.text =
sourceDataJson.toPrettyFormat()
+ FastScrollerBuilder(dialogExpBackBinding.expBackTextScroll).useMd2Style()
+ .setPadding(0, 0, 0, 32.dp).build()
}
}
}
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
index 79781de..b103334 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/QQVersionListFragment.kt
@@ -73,7 +73,6 @@ class QQVersionListFragment : Fragment() {
val screenHeightDp = (Resources.getSystem().displayMetrics.heightPixels).pxToDp
fragmentBinding.apply {
rvContent.adapter = concatenated
- FastScrollerBuilder(rvContent).useMd2Style().setPadding(0, 8.dp, 0, 200.dp).build()
// 当横纵逻辑像素都大于 600 时,根据横向逻辑像素的不同区间显示不同的瀑布流布局
// 小于 600 时显示线性布局
rvContent.layoutManager = if (screenHeightDp >= 600) {
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
index 022eec6..42bbbfc 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/TIMVersionListFragment.kt
@@ -74,7 +74,6 @@ class TIMVersionListFragment : Fragment() {
val screenHeightDp = (Resources.getSystem().displayMetrics.heightPixels).pxToDp
fragmentBinding.apply {
rvTimContent.adapter = concatenated
- FastScrollerBuilder(rvTimContent).useMd2Style().setPadding(0, 8.dp, 0, 200.dp).build()
// 当横纵逻辑像素都大于 600 时,根据横向逻辑像素的不同区间显示不同的瀑布流布局
// 小于 600 时显示线性布局
rvTimContent.layoutManager = if (screenHeightDp >= 600) {
diff --git a/app/src/main/res/layout/dialog_exp_back.xml b/app/src/main/res/layout/dialog_exp_back.xml
index 6097821..bbd33e9 100644
--- a/app/src/main/res/layout/dialog_exp_back.xml
+++ b/app/src/main/res/layout/dialog_exp_back.xml
@@ -19,14 +19,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingStart="16dp"
+ android:paddingStart="4dp"
android:paddingTop="8dp"
- android:paddingEnd="16dp">
+ android:paddingEnd="4dp">
-
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/user_agreement.xml b/app/src/main/res/layout/user_agreement.xml
index b347371..622bcbc 100644
--- a/app/src/main/res/layout/user_agreement.xml
+++ b/app/src/main/res/layout/user_agreement.xml
@@ -33,10 +33,11 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
-
+ android:scrollbars="none">
-
+
Date: Thu, 24 Oct 2024 20:37:02 +0800
Subject: [PATCH 32/40] =?UTF-8?q?perf(layout):=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E5=BA=95=E9=83=A8=E5=BA=94=E7=94=A8=E6=A0=8F=E5=92=8C=E7=B3=BB?=
=?UTF-8?q?=E7=BB=9F=E6=A0=8F=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 调整 BottomAppBar 的布局和锚点
- 优化系统栏颜色设置
- 移除冗余的 SDK 版本判断
- 更新依赖版本:
- material: 1.13.0-alpha07
- firebase-bom: 33.5.1
- okhttp:4.12.0 - gson: 2.11.0
- paris:2.0.2
- maven-artifact: 3.9.9
- secrets-gradle-plugin: 2.0.1
- google-services: 4.4.2
---
app/build.gradle.kts | 51 +++++++++--------
.../xiaoniu/qqversionlist/ui/MainActivity.kt | 57 +++++++++----------
app/src/main/res/layout/activity_main.xml | 5 +-
app/src/main/res/values-night-v27/themes.xml | 2 +
app/src/main/res/values-night-v31/themes.xml | 2 +
app/src/main/res/values-night/themes.xml | 2 +
app/src/main/res/values-v27/themes.xml | 2 +
app/src/main/res/values-v31/themes.xml | 2 +
app/src/main/res/values/themes.xml | 2 +
build.gradle.kts | 4 +-
gradle/libs.versions.toml | 56 ++++++++++++++++++
11 files changed, 126 insertions(+), 59 deletions(-)
create mode 100644 gradle/libs.versions.toml
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index e2ffe82..3933bb2 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -93,29 +93,30 @@ android {
}
dependencies {
- implementation("androidx.core:core-ktx:1.13.1")
- implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
- implementation("androidx.appcompat:appcompat:1.7.0")
- implementation("androidx.core:core-splashscreen:1.1.0-rc01")
- implementation("com.google.android.material:material:1.13.0-alpha07")
- implementation("androidx.constraintlayout:constraintlayout:2.1.4")
- testImplementation("junit:junit:4.13.2")
- androidTestImplementation("androidx.test.ext:junit:1.2.1")
- androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
- implementation("com.squareup.okhttp3:okhttp:4.12.0")
- implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
- implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
- implementation("io.coil-kt:coil:2.7.0")
- implementation("androidx.datastore:datastore-preferences:1.1.1")
- implementation("com.google.code.gson:gson:2.11.0")
- implementation("com.airbnb.android:paris:2.0.2")
- implementation("org.apache.maven:maven-artifact:3.9.9")
- implementation("androidx.recyclerview:recyclerview:1.3.2")
- implementation("androidx.viewpager2:viewpager2:1.1.0")
- implementation("androidx.fragment:fragment-ktx:1.8.4")
- implementation(platform("com.google.firebase:firebase-bom:33.4.0"))
- implementation("com.google.firebase:firebase-analytics")
- implementation("com.google.firebase:firebase-messaging")
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
- implementation("me.zhanghai.android.fastscroll:library:1.3.0")
+ implementation(libs.androidx.core.ktx)
+ implementation(libs.androidx.lifecycle.runtime.ktx)
+ implementation(libs.androidx.appcompat)
+ implementation(libs.androidx.core.splashscreen)
+ implementation(libs.material)
+ implementation(libs.androidx.constraintlayout)
+ implementation(libs.activity.ktx)
+ testImplementation(libs.junit)
+ androidTestImplementation(libs.androidx.junit)
+ androidTestImplementation(libs.androidx.espresso.core)
+ implementation(libs.okhttp)
+ implementation(libs.logging.interceptor)
+ implementation(libs.kotlinx.serialization.json)
+ implementation(libs.coil)
+ implementation(libs.androidx.datastore.preferences)
+ implementation(libs.gson)
+ implementation(libs.paris)
+ implementation(libs.maven.artifact)
+ implementation(libs.androidx.recyclerview)
+ implementation(libs.androidx.viewpager2)
+ implementation(libs.androidx.fragment.ktx)
+ implementation(platform(libs.firebase.bom))
+ implementation(libs.firebase.analytics)
+ implementation(libs.firebase.messaging)
+ implementation(libs.kotlinx.coroutines.android)
+ implementation(libs.library)
}
diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
index 61c111c..10eb0da 100644
--- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
+++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
@@ -31,7 +31,6 @@ import android.content.res.Configuration
import android.content.res.Resources
import android.net.Uri
import android.os.Build
-import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import android.os.Environment
import android.text.Editable
@@ -39,6 +38,7 @@ import android.text.SpannableString
import android.text.TextWatcher
import android.text.style.URLSpan
import android.util.Base64
+import android.util.Log
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
@@ -51,7 +51,6 @@ import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import androidx.core.text.method.LinkMovementMethodCompat
import androidx.core.view.ViewCompat
-import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
@@ -151,26 +150,25 @@ class MainActivity : AppCompatActivity() {
setContext(this)
- if (SDK_INT <= Build.VERSION_CODES.Q) {
- ViewCompat.setOnApplyWindowInsetsListener(viewRoot) { view, windowInsets ->
- val insets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
- view.setPadding(insets.left, 0, insets.right, 0)
- binding.apply {
- bottomAppBar.updatePadding(0, 0, 0, insets.bottom)
- btnGuess.updateLayoutParams {
- bottomMargin = insets.bottom / 2
- }
- }
- windowInsets
+ // 不加这段代码的话 Google 可能会在系统栏加遮罩
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) window.isNavigationBarContrastEnforced =
+ false
+
+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q) ViewCompat.setOnApplyWindowInsetsListener(
+ viewRoot
+ ) { _, windowInsets ->
+ val insets =
+ windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
+ binding.bottomAppBar.post {
+ binding.bottomAppBar.updatePadding(0, 0, 0, insets.bottom)
}
+ binding.btnGuess.updateLayoutParams {
+ bottomMargin = insets.bottom / 2
+ }
+ windowInsets
}
- // 不加这段代码的话 Google 可能会在系统栏加遮罩
- if (SDK_INT >= Build.VERSION_CODES.Q) window.apply {
- isNavigationBarContrastEnforced = false
- }
- WindowCompat.setDecorFitsSystemWindows(window, false)
qqVersionAdapter = QQVersionAdapter()
timVersionAdapter = TIMVersionAdapter()
@@ -1002,7 +1000,7 @@ class MainActivity : AppCompatActivity() {
).ifEmpty { SHIPLY_DEFAULT_APPID },
getStringKV(
"shiplyOsVersion", ""
- ).ifEmpty { SDK_INT.toString() },
+ ).ifEmpty { Build.VERSION.SDK_INT.toString() },
getStringKV(
"shiplyModel", ""
).ifEmpty { Build.MODEL.toString() },
@@ -1029,7 +1027,7 @@ class MainActivity : AppCompatActivity() {
.isGooglePlayServicesAvailable(this@MainActivity) == ConnectionResult.SUCCESS
) {
if (!Firebase.messaging.isAutoInitEnabled) {
- if (SDK_INT >= Build.VERSION_CODES.O) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channelTitle =
getString(R.string.rainbow_notification_channel_title)
val channelDescription =
@@ -1341,7 +1339,7 @@ class MainActivity : AppCompatActivity() {
val QQVersionInstall =
packageManager.getPackageInfo("com.tencent.mobileqq", 0).versionName.toString()
val QQVersionCodeInstall =
- if (SDK_INT >= Build.VERSION_CODES.P) packageManager.getPackageInfo(
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) packageManager.getPackageInfo(
"com.tencent.mobileqq", 0
).longVersionCode.toString() else ""
val QQMetaDataInstall = packageManager.getPackageInfo(
@@ -1355,7 +1353,7 @@ class MainActivity : AppCompatActivity() {
QQMetaDataInstall.applicationInfo?.metaData?.getString("com.tencent.rdm.uuid")
val QQTargetInstall = QQMetaDataInstall.applicationInfo?.targetSdkVersion.toString()
val QQMinInstall = QQMetaDataInstall.applicationInfo?.minSdkVersion.toString()
- val QQCompileInstall = (if (SDK_INT >= Build.VERSION_CODES.S)
+ val QQCompileInstall = (if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
QQMetaDataInstall.applicationInfo?.compileSdkVersion.toString() else "")
if (QQVersionInstall != DataStoreUtil.getStringKV(
"QQVersionInstall", ""
@@ -1412,7 +1410,7 @@ class MainActivity : AppCompatActivity() {
val TIMVersionInstall =
packageManager.getPackageInfo("com.tencent.tim", 0).versionName.toString()
val TIMVersionCodeInstall =
- if (SDK_INT >= Build.VERSION_CODES.P) packageManager.getPackageInfo(
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) packageManager.getPackageInfo(
"com.tencent.tim", 0
).longVersionCode.toString() else ""
val TIMMetaData = packageManager.getPackageInfo(
@@ -1425,7 +1423,7 @@ class MainActivity : AppCompatActivity() {
val TIMTargetInstall = TIMMetaData.applicationInfo?.targetSdkVersion.toString()
val TIMMinInstall = TIMMetaData.applicationInfo?.minSdkVersion.toString()
val TIMCompileInstall =
- (if (SDK_INT >= Build.VERSION_CODES.S) TIMMetaData.applicationInfo?.compileSdkVersion.toString() else "")
+ (if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) TIMMetaData.applicationInfo?.compileSdkVersion.toString() else "")
if (TIMTargetInstall.isNotEmpty() && TIMTargetInstall != DataStoreUtil.getStringKV(
"TIMTargetInstall",
""
@@ -1534,8 +1532,9 @@ class MainActivity : AppCompatActivity() {
).setAction(R.string.ok, TipTIMSnackbarActionListener())
.setAnchorView(binding.btnGuess)
.apply {
- if (isDarkTheme) setBackgroundTint(getColor(com.google.android.material.R.color.m3_sys_color_dynamic_dark_secondary))
- else setBackgroundTint(getColor(com.google.android.material.R.color.m3_sys_color_dynamic_light_secondary))
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) if (isDarkTheme) setBackgroundTint(
+ getColor(com.google.android.material.R.color.m3_sys_color_dynamic_dark_secondary)
+ ) else setBackgroundTint(getColor(com.google.android.material.R.color.m3_sys_color_dynamic_light_secondary))
}.show()
}
}
@@ -2026,7 +2025,7 @@ class MainActivity : AppCompatActivity() {
shiplyVersion: String,
shiplyUin: String,
shiplyAppid: String = SHIPLY_DEFAULT_APPID,
- shiplyOsVersion: String = SDK_INT.toString(),
+ shiplyOsVersion: String = Build.VERSION.SDK_INT.toString(),
shiplyModel: String = Build.MODEL.toString(),
shiplySdkVersion: String = SHIPLY_DEFAULT_SDK_VERSION,
shiplyLanguage: String = Locale.getDefault().language.toString()
@@ -2287,7 +2286,7 @@ class MainActivity : AppCompatActivity() {
// 检查特定通知渠道是否被用户关闭
private fun checkNotificationChannelEnabled(channelId: String): Boolean {
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
- if (SDK_INT >= Build.VERSION_CODES.O) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = notificationManager.getNotificationChannel(channelId)
return channel?.importance != NotificationManager.IMPORTANCE_NONE
} else {
@@ -2312,7 +2311,7 @@ class MainActivity : AppCompatActivity() {
private fun askNotificationPermission() {
// This is only necessary for API level >= 33 (TIRAMISU)
- if (SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (ContextCompat.checkSelfPermission(
this, Manifest.permission.POST_NOTIFICATIONS
) == PackageManager.PERMISSION_GRANTED
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index c101e1a..8803721 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -59,14 +59,13 @@
true
- shortEdges
- @style/ThemeOverlay.App.BottomSheetDialog
+ - @android:color/transparent
+ - @android:color/transparent