mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-01-03 14:40:07 +02:00
Fix some issues
This commit is contained in:
parent
fa989a4084
commit
86e371b4f5
2 changed files with 7 additions and 2 deletions
|
@ -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));
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue