-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move security error to domain settings
- Loading branch information
Showing
25 changed files
with
249 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/main/java/acr/browser/lightning/extensions/ContextUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package acr.browser.lightning.extensions; | ||
|
||
|
||
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_COMPACT; | ||
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; | ||
import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_INDIVIDUAL; | ||
|
||
import android.content.Context; | ||
import android.text.SpannedString; | ||
import android.text.TextUtils; | ||
|
||
import androidx.annotation.StringRes; | ||
import androidx.core.text.HtmlCompat; | ||
|
||
public class ContextUtils { | ||
|
||
|
||
/** | ||
* Allows us to have rich text and variable interpolation. | ||
* New line and white space handling is a mess though. | ||
* Kept it in Java cause we could not get varargs to work as we wanted in Kotlin. | ||
* Modded from: https://stackoverflow.com/a/23562910/3969362 | ||
* | ||
* @param context | ||
* @param id | ||
* @param args | ||
* @return | ||
*/ | ||
public static CharSequence getText(Context context, @StringRes int id, Object... args) { | ||
for (int i = 0; i < args.length; ++i) | ||
args[i] = args[i] instanceof String ? HtmlCompat.toHtml(new SpannedString((String)args[i]),TO_HTML_PARAGRAPH_LINES_INDIVIDUAL) : args[i]; | ||
return HtmlCompat.fromHtml(String.format(HtmlCompat.toHtml(new SpannedString(context.getText(id)),TO_HTML_PARAGRAPH_LINES_INDIVIDUAL), args),FROM_HTML_MODE_COMPACT); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
app/src/main/java/acr/browser/lightning/ssl/SessionSslWarningPreferences.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
app/src/main/java/acr/browser/lightning/ssl/SslWarningPreferences.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.