Fix some issues

This commit is contained in:
Thomas 2022-11-08 14:33:15 +01:00
parent fa989a4084
commit 86e371b4f5
2 changed files with 7 additions and 2 deletions

View file

@ -693,6 +693,9 @@ public class Helper {
* @param url String url to open
*/
public static void openBrowser(Context context, String url) {
if (url == null) {
return;
}
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
boolean embedded_browser = sharedpreferences.getBoolean(context.getString(R.string.SET_EMBEDDED_BROWSER), true);
if (embedded_browser && !url.toLowerCase().startsWith("gemini://")) {
@ -708,7 +711,7 @@ public class Helper {
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (url != null && !url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://") && !url.toLowerCase().startsWith("gemini://")) {
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://") && !url.toLowerCase().startsWith("gemini://")) {
url = "http://" + url;
}
intent.setData(Uri.parse(url));

View file

@ -1198,6 +1198,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
if (visibility != null && statusDraft.visibility == null) {
statusDraft.visibility = visibility;
}
boolean unlistedReplies = sharedpreferences.getBoolean(context.getString(R.string.SET_UNLISTED_REPLIES), true);
if (statusDraft.visibility == null) {
if (position > 0) {
statusDraft.visibility = statusList.get(position - 1).visibility;
@ -1206,10 +1207,11 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} else {
statusDraft.visibility = "public";
}
boolean unlistedReplies = sharedpreferences.getBoolean(context.getString(R.string.SET_UNLISTED_REPLIES), true);
if (position == 0 && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
statusDraft.visibility = "unlisted";
}
} else if (position == statusCount && unlistedReplies && statusDraft.visibility.equalsIgnoreCase("public") && statusList.size() > 1) {
statusDraft.visibility = "unlisted";
}
switch (statusDraft.visibility.toLowerCase()) {