Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit e98c1ca

Browse files
committed
UI: Fix link bug
Signed-off-by: Fung Gwo <fython@163.com>
1 parent 0bf8482 commit e98c1ca

5 files changed

Lines changed: 28 additions & 17 deletions

File tree

mobile/src/main/kotlin/info/papdt/express/helper/ui/fragment/settings/SettingsPush.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import android.content.ComponentName
55
import android.content.pm.PackageManager
66
import android.os.Build
77
import android.os.Bundle
8+
import android.text.method.LinkMovementMethod
89
import com.google.android.material.snackbar.Snackbar
910
import android.widget.TextView
11+
import androidx.core.text.HtmlCompat
1012
import com.google.firebase.iid.FirebaseInstanceId
1113
import info.papdt.express.helper.BuildConfig
1214
import info.papdt.express.helper.R
@@ -184,7 +186,7 @@ class SettingsPush : AbsPrefFragment(), Preference.OnPreferenceChangeListener, P
184186
mPrefWhatsThis -> {
185187
activity?.buildAlertDialog {
186188
titleRes = R.string.fcm_push_intro_title
187-
messageRes = R.string.fcm_push_intro_msg
189+
setMessage(HtmlCompat.fromHtml(getString(R.string.fcm_push_intro_msg), 0))
188190
okButton()
189191
/*neutralButton(R.string.fcm_push_no_server_button) { _, _ ->
190192
if (SettingsInstance.clickedDonate) {
@@ -197,6 +199,11 @@ class SettingsPush : AbsPrefFragment(), Preference.OnPreferenceChangeListener, P
197199
}.show()
198200
}
199201
}*/
202+
}?.apply{
203+
setOnShowListener {
204+
(it as AlertDialog).findViewById<TextView>(android.R.id.message)
205+
.movementMethod = LinkMovementMethod.getInstance()
206+
}
200207
}?.show()
201208
true
202209
}

mobile/src/main/res/values-yue/strings.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@
137137
<string name="pref_request_push">即刻請求推送</string>
138138
<string name="pref_whats_this">呢個係乜嘢?</string>
139139
<string name="fcm_push_intro_title">基於 FCM 推送服務</string>
140-
<string name="fcm_push_intro_msg">我們通過 Firebase 雲通知提供了一個更高效嘅途徑來獲取包裹資料。
140+
<string name="fcm_push_intro_msg"><![CDATA[我們通過 Firebase 雲通知提供了一個更高效嘅途徑來獲取包裹資料。
141141
你可以喺自己嘅伺服器上運行水錶助手推送服務,然後設定到客戶端中。
142-
\n\n客戶端將會同伺服器同步清單。有新訊息來嘅時候,伺服器會通過 FCM 推送通知(客戶端需要 Google 服務框架)。
143-
\n\n推送服務程式源代碼 (Node.js) 已經發佈喺 GitHub。你可以將它下載落來運行喺你嘅伺服器入面。
144-
\nGitHub: https://github.com/fython/PackageTracker-NodeServer
142+
<br><br>客戶端將會同伺服器同步清單。有新訊息來嘅時候,伺服器會通過 FCM 推送通知(客戶端需要 Google 服務框架)。
143+
<br><br>推送服務程式源代碼 (Node.js) 已經發佈喺 GitHub。你可以將它下載落來運行喺你嘅伺服器入面。
144+
<br>GitHub: <a href="https://github.com/fython/PackageTracker-NodeServer">https://github.com/fython/PackageTracker-NodeServer</a>
145+
]]>
145146
</string>
146147
<string name="fcm_push_no_server_button">冇伺服器?</string>
147148
<string name="no_server_message">撳 \"通過支付寶捐贈\" 設定後,你可以用我嘅自建伺服器。</string>

mobile/src/main/res/values-zh-rCN/strings.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@
137137
<string name="pref_request_push">立即请求推送</string>
138138
<string name="pref_whats_this">这是什么?</string>
139139
<string name="fcm_push_intro_title">基于 FCM 推送服务</string>
140-
<string name="fcm_push_intro_msg">我们通过 Firebase 云通知提供了一个更高效的途径来拉取包裹信息。
140+
<string name="fcm_push_intro_msg"><![CDATA[我们通过 Firebase 云通知提供了一个更高效的途径来拉取包裹信息。
141141
你可以在自己的服务器上运行水表助手推送服务,然后设置到客户端中。
142-
\n\n客户端将会和服务器同步列表。当新的信息来临时,服务器会通过 FCM 推送通知(客户端需要 Google 服务框架)。
143-
\n\n推送服务源代码 (Node.js) 已经发布在 GitHub。你可以将它下载下来并运行在你的服务器中。
144-
\nGitHub: https://github.com/fython/PackageTracker-NodeServer
142+
<br><br>客户端将会和服务器同步列表。当新的信息来临时,服务器会通过 FCM 推送通知(客户端需要 Google 服务框架)。
143+
<br><br>推送服务源代码 (Node.js) 已经发布在 GitHub。你可以将它下载下来并运行在你的服务器中。
144+
<br>GitHub: <a href="https://github.com/fython/PackageTracker-NodeServer">https://github.com/fython/PackageTracker-NodeServer</a>
145+
]]>
145146
</string>
146147
<string name="fcm_push_no_server_button">没有服务器?</string>
147148
<string name="no_server_message">点击 \"通过支付宝捐赠\" 设置后,你可以使用我的自建服务器。</string>

mobile/src/main/res/values-zh-rTW/strings.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@
137137
<string name="pref_request_push">立即請求推送</string>
138138
<string name="pref_whats_this">這是什麼?</string>
139139
<string name="fcm_push_intro_title">基於 FCM 推送服務</string>
140-
<string name="fcm_push_intro_msg">我們通過 Firebase 雲通知提供了一個更高效的途徑來獲取包裹資料。
140+
<string name="fcm_push_intro_msg"><![CDATA[我們通過 Firebase 雲通知提供了一個更高效的途徑來獲取包裹資料。
141141
你可以在自己的伺服器上運行水錶助手推送服務,然後設定到客戶端中。
142-
\n\n客戶端將會與伺服器同步清單。當新的訊息來臨時,伺服器会通過 FCM 推送通知(客戶端需要 Google 服務框架)。
143-
\n\n推送服務程式源代碼 (Node.js) 已經發佈在 GitHub。你可以將它下載下來並運行在你的伺服器中。
144-
\nGitHub: https://github.com/fython/PackageTracker-NodeServer
142+
<br><br>客戶端將會與伺服器同步清單。當新的訊息來臨時,伺服器会通過 FCM 推送通知(客戶端需要 Google 服務框架)。
143+
<br><br>推送服務程式源代碼 (Node.js) 已經發佈在 GitHub。你可以將它下載下來並運行在你的伺服器中。
144+
<br>GitHub: <a href="https://github.com/fython/PackageTracker-NodeServer">https://github.com/fython/PackageTracker-NodeServer</a>
145+
]]>
145146
</string>
146147
<string name="fcm_push_no_server_button">沒有伺服器?</string>
147148
<string name="no_server_message">點擊 \"通過支付寶捐贈\" 設定後,你可以使用我的自建伺服器。</string>

mobile/src/main/res/values/strings.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,12 @@
174174
<string name="pref_request_push">Request push now</string>
175175
<string name="pref_whats_this">What\'s this?</string>
176176
<string name="fcm_push_intro_title">FCM-Based Push Service</string>
177-
<string name="fcm_push_intro_msg">We provide a more effective way to pull the latest status of packages with Firebase Cloud Messaging.
177+
<string name="fcm_push_intro_msg"><![CDATA[We provide a more effective way to pull the latest status of packages with Firebase Cloud Messaging.
178178
You can run Package Tracker Push Server in your own server and set up in client.
179-
\n\nClient will synchronize list to the server. When new status come up, server will push notification through FCM, which is more power-saving push service built in Google Service.
180-
\n\nPush Server source code (Node.js) has been published to GitHub. You can download it and run in your own server.
181-
\nGitHub: https://github.com/fython/PackageTracker-NodeServer
179+
<br><br>Client will synchronize list to the server. When new status come up, server will push notification through FCM, which is more power-saving push service built in Google Service.
180+
<br><br>Push Server source code (Node.js) has been published to GitHub. You can download it and run in your own server.
181+
<br>GitHub: <a href="https://github.com/fython/PackageTracker-NodeServer">https://github.com/fython/PackageTracker-NodeServer</a>
182+
]]>
182183
</string>
183184
<string name="fcm_push_no_server_button">I don\'t have a server</string>
184185
<string name="no_server_message">After clicking \"Donate via Alipay\" in settings, you can use my server.</string>

0 commit comments

Comments
 (0)