Open gemini link from external application
This commit is contained in:
parent
18e4250a66
commit
582b36bc80
|
@ -665,9 +665,7 @@ public class Status implements Parcelable {
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://"))
|
Helper.openBrowser(context, url);
|
||||||
finalUrl = "http://" + url;
|
|
||||||
Helper.openBrowser(context, finalUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -891,10 +889,7 @@ public class Status implements Parcelable {
|
||||||
contentSpanTranslated.setSpan(new ClickableSpan() {
|
contentSpanTranslated.setSpan(new ClickableSpan() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(@NonNull View textView) {
|
public void onClick(@NonNull View textView) {
|
||||||
String finalUrl = url;
|
Helper.openBrowser(context, url);
|
||||||
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://"))
|
|
||||||
finalUrl = "http://" + url;
|
|
||||||
Helper.openBrowser(context, finalUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3166,7 +3166,7 @@ public class BaseHelper {
|
||||||
public static void openBrowser(Context context, String url) {
|
public static void openBrowser(Context context, String url) {
|
||||||
SharedPreferences sharedpreferences = context.getSharedPreferences(APP_PREFS, android.content.Context.MODE_PRIVATE);
|
SharedPreferences sharedpreferences = context.getSharedPreferences(APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||||
boolean embedded_browser = sharedpreferences.getBoolean(SET_EMBEDDED_BROWSER, true);
|
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);
|
Intent intent = new Intent(context, WebviewActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
String finalUrl = url;
|
String finalUrl = url;
|
||||||
|
|
Loading…
Reference in New Issue