Open gemini link from external application

This commit is contained in:
Balazs Toldi 2021-02-17 15:51:24 +01:00
parent 18e4250a66
commit 582b36bc80
No known key found for this signature in database
GPG Key ID: 933820884952BE27
2 changed files with 3 additions and 8 deletions

View File

@ -665,9 +665,7 @@ public class Status implements Parcelable {
intent.putExtras(b);
context.startActivity(intent);
} else {
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://"))
finalUrl = "http://" + url;
Helper.openBrowser(context, finalUrl);
Helper.openBrowser(context, url);
}
}
@ -891,10 +889,7 @@ public class Status implements Parcelable {
contentSpanTranslated.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View textView) {
String finalUrl = url;
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://"))
finalUrl = "http://" + url;
Helper.openBrowser(context, finalUrl);
Helper.openBrowser(context, url);
}
@Override

View File

@ -3166,7 +3166,7 @@ public class BaseHelper {
public static void openBrowser(Context context, String url) {
SharedPreferences sharedpreferences = context.getSharedPreferences(APP_PREFS, android.content.Context.MODE_PRIVATE);
boolean embedded_browser = sharedpreferences.getBoolean(SET_EMBEDDED_BROWSER, true);
if (embedded_browser) {
if (embedded_browser && !url.toLowerCase().startsWith("gemini://")) {
Intent intent = new Intent(context, WebviewActivity.class);
Bundle b = new Bundle();
String finalUrl = url;