Skip to content

Commit d0f6575

Browse files
committed
Fix Transifex issue by using CDATA for html in string
1 parent fec8c68 commit d0f6575

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

app/src/main/java/com/amaze/filemanager/ui/dialogs/GeneralDialogCreation.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package com.amaze.filemanager.ui.dialogs;
2222

2323
import static android.os.Build.VERSION.SDK_INT;
24+
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_COMPACT;
2425
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_SORTBY_ONLY_THIS;
2526

2627
import java.io.File;
@@ -92,6 +93,7 @@
9293
import android.os.Build;
9394
import android.text.InputType;
9495
import android.text.SpannableString;
96+
import android.text.Spanned;
9597
import android.text.TextUtils;
9698
import android.text.format.Formatter;
9799
import android.view.LayoutInflater;
@@ -107,6 +109,7 @@
107109
import androidx.appcompat.widget.AppCompatCheckBox;
108110
import androidx.appcompat.widget.AppCompatEditText;
109111
import androidx.appcompat.widget.AppCompatTextView;
112+
import androidx.core.text.HtmlCompat;
110113
import androidx.core.text.TextUtilsCompat;
111114
import androidx.core.view.ViewCompat;
112115
import androidx.preference.PreferenceManager;
@@ -1030,8 +1033,11 @@ public static void showPasswordDialog(
10301033
}
10311034

10321035
public static void showSMBHelpDialog(Context m, int accentColor) {
1036+
final @NonNull Spanned text =
1037+
HtmlCompat.fromHtml(m.getString(R.string.smb_instructions), FROM_HTML_MODE_COMPACT);
1038+
10331039
MaterialDialog.Builder b = new MaterialDialog.Builder(m);
1034-
b.content(m.getText(R.string.smb_instructions));
1040+
b.content(text);
10351041
b.positiveText(R.string.doit);
10361042
b.positiveColor(accentColor);
10371043
b.build().show();

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,15 @@
330330
<string name="use_custom_ip">Use custom IP</string>
331331
<string name="bookmark_lost">Bookmark not found, recreating&#8230;</string>
332332

333-
<string name="smb_instructions">
333+
<string name="smb_instructions"><![CDATA[
334334
<html>
335335
<body>
336336
<h1>How to access shared Windows folder on Android (SMB)</h1>\n\n
337337
<ul>
338338
<li>
339339
<b>Enable File Sharing on Windows</b>\n
340340
</li>
341-
<p style='margin-left: 40px'>
341+
<p style="margin-left: 40px">
342342
Open the Control Panel, click Choose HomeGroup and Sharing options under Network
343343
and Internet, and click "Change Advanced Sharing Settings," enable the "File and
344344
Printer Sharing" feature.\n\n
@@ -347,7 +347,7 @@
347347
<li>
348348
<b>Additional File Sharing settings</b>\n
349349
</li>
350-
<p style='margin-left: 40px'>
350+
<p style="margin-left: 40px">
351351
You may also want to configure the other advanced sharing settings here. \n
352352
For example, you could enable access to your files without a password if you trust all
353353
the devices on your local network. Once file and printer sharing is enabled, you can
@@ -359,7 +359,7 @@
359359
<li>
360360
<b>Make sure both devices are on same Wifi</b>\n
361361
</li>
362-
<p style='margin-left: 40px'>
362+
<p style="margin-left: 40px">
363363
This feature makes files available on the local network, so your PC and mobile devices
364364
have to be on the same local network. You can\’t access a shared Windows folder
365365
over the Internet or when your smartphone is connected to its mobile data — it
@@ -369,7 +369,7 @@
369369
<li>
370370
<b>Find IP Address</b>\n
371371
</li>
372-
<p style='margin-left: 40px'>
372+
<p style="margin-left: 40px">
373373
Open Command Prompt. Type \'ipconfig\' and press Enter. Look for Default Gateway
374374
under your network adapter for your router\'s IP address. Look for
375375
\\\"IPv4 Address\\\" under the same adapter section to find your computer\'s IP
@@ -380,7 +380,7 @@
380380
</ul>
381381
</body>
382382
</html>
383-
</string>
383+
]]></string>
384384
<string name="share_limit">Can\'t share more than 100 files</string>
385385
<string name="otg_access">Select the root of OTG device</string>
386386
<string name="information">Information</string>

0 commit comments

Comments
 (0)