Skip to content

Commit f9e59ee

Browse files
committed
Try to fix link issues
1 parent 2f3669e commit f9e59ee

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import android.annotation.SuppressLint
2424
import android.content.Context
2525
import android.content.Intent
2626
import android.content.SharedPreferences
27+
import android.text.method.LinkMovementMethod
28+
import android.text.util.Linkify
2729
import android.view.LayoutInflater
2830
import android.view.View
2931
import android.view.View.INVISIBLE
@@ -34,6 +36,7 @@ import androidx.appcompat.widget.AppCompatCheckBox
3436
import androidx.appcompat.widget.AppCompatTextView
3537
import androidx.core.text.HtmlCompat
3638
import androidx.core.text.HtmlCompat.FROM_HTML_MODE_COMPACT
39+
import androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY
3740
import androidx.preference.PreferenceManager
3841
import com.afollestad.materialdialogs.DialogAction
3942
import com.afollestad.materialdialogs.MaterialDialog
@@ -95,10 +98,13 @@ object EncryptAuthenticateDialog {
9598
val useAzeEncrypt: AppCompatCheckBox = vb.checkboxUseAze
9699
val usageTextInfo: AppCompatTextView =
97100
vb.textViewCryptInfo.apply {
101+
movementMethod = LinkMovementMethod.getInstance()
102+
autoLinkMask = Linkify.WEB_URLS
103+
linksClickable = true
98104
text =
99105
HtmlCompat.fromHtml(
100106
main.getString(R.string.encrypt_option_use_aescrypt_desc),
101-
FROM_HTML_MODE_COMPACT,
107+
HtmlCompat.FROM_HTML_MODE_LEGACY,
102108
)
103109
}
104110
useAzeEncrypt.setOnCheckedChangeListener(
@@ -242,6 +248,9 @@ object EncryptAuthenticateDialog {
242248
AESCRYPT_EXTENSION
243249
}}",
244250
)
251+
usageTextInfo.movementMethod = LinkMovementMethod.getInstance()
252+
usageTextInfo.autoLinkMask = Linkify.WEB_URLS
253+
usageTextInfo.linksClickable = true
245254
usageTextInfo.text =
246255
HtmlCompat.fromHtml(
247256
main.getString(
@@ -251,7 +260,7 @@ object EncryptAuthenticateDialog {
251260
R.string.encrypt_option_use_aescrypt_desc
252261
},
253262
),
254-
FROM_HTML_MODE_COMPACT,
263+
FROM_HTML_MODE_LEGACY,
255264
)
256265
}
257266

app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptWithPresetPasswordSaveAsDialog.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ package com.amaze.filemanager.ui.dialogs
2323
import android.annotation.SuppressLint
2424
import android.content.Context
2525
import android.content.Intent
26+
import android.text.method.LinkMovementMethod
27+
import android.text.util.Linkify
2628
import android.view.LayoutInflater
2729
import android.view.View
2830
import android.widget.Toast
@@ -88,6 +90,9 @@ object EncryptWithPresetPasswordSaveAsDialog {
8890
val useAzeEncrypt = vb.checkboxUseAze
8991
val usageTextInfo =
9092
vb.textViewCryptInfo.apply {
93+
movementMethod = LinkMovementMethod.getInstance()
94+
autoLinkMask = Linkify.WEB_URLS
95+
linksClickable = true
9196
text =
9297
HtmlCompat.fromHtml(
9398
main.getString(R.string.encrypt_option_use_aescrypt_desc),

app/src/main/res/layout/dialog_encrypt_authenticate.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<androidx.appcompat.widget.AppCompatTextView
7070
android:layout_width="wrap_content"
7171
android:layout_height="match_parent"
72-
android:text="@string/encrypt_option_use_aescrypt_desc"
72+
android:text=""
7373
android:id="@+id/text_view_crypt_info"
7474
android:layout_gravity="center_vertical"
7575
app:layout_constraintTop_toBottomOf="@id/checkbox_use_aze"

app/src/main/res/layout/dialog_encrypt_with_master_password.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
android:layout_width="wrap_content"
3737
android:layout_height="match_parent"
3838
android:padding="5sp"
39-
android:text="@string/encrypt_option_use_aescrypt_desc"
39+
android:text=""
4040
android:id="@+id/text_view_crypt_info"
4141
android:layout_gravity="center_vertical"
4242
android:textSize="22sp"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@
659659
<string name="encrypt_option_use_aze">Use Amaze Encryption Format</string>
660660
<string name="encrypt_option_use_aescrypt_desc"><![CDATA[
661661
<p>AESCrypt is an open source file encryption format based on AES encryption. It is also portable, can be decrypted with AESCrypt programs on other platforms.</p>
662-
<p><a href=&quot;https://www.aescrypt.com&quot; target=_blank>AESCrypt website</a></p>]]>
663-
</string>
662+
<p>AESCrypt website: https://www.aescrypt.com</p>
663+
]]></string>
664664
<string name="encrypt_option_use_azecrypt_desc"><![CDATA[
665665
<p>Amaze&apos;s Encryption Format is also based on AES encryption; but different from AESCrypt format, it can only be decrypted by this device; also you must not uninstall Amaze File Manager from this device nor change the way you lock screen, otherwise you will have no way to recover the encrypted file.</p>
666666
]]></string>

0 commit comments

Comments
 (0)