From 939023b71ee58477f9db2e096199465be9890a92 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 17 Jan 2023 14:19:46 +0100 Subject: [PATCH] Some fixes --- .../java/app/fedilab/android/BaseMainActivity.java | 12 +++++++++++- .../fedilab/android/helper/CrossActionHelper.java | 1 + .../fedilab/android/helper/PinnedTimelineHelper.java | 10 ++++++++++ .../app/fedilab/android/ui/drawer/StatusAdapter.java | 4 ++++ app/src/main/res/menu/option_filter_toots.xml | 6 ++++++ app/src/main/res/values/strings.xml | 3 ++- .../fastlane/metadata/android/en/changelogs/469.txt | 9 +++++++++ 7 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/fdroid/fastlane/metadata/android/en/changelogs/469.txt diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index 693e72e4..86202893 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -187,7 +187,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt public static List mainFilters; public static List filteredAccounts; public static boolean filterFetched; - public static boolean show_boosts, show_replies, show_art_nsfw; + public static boolean show_boosts, show_replies, show_dms, show_art_nsfw; public static String regex_home, regex_local, regex_public; public static BaseAccount currentAccount; public static iconLauncher mLauncher = iconLauncher.BUBBLES; @@ -694,6 +694,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt show_boosts = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_BOOSTS) + currentUserID + currentInstance, true); show_replies = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_REPLIES) + currentUserID + currentInstance, true); + show_dms = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_DMS) + currentUserID + currentInstance, true); regex_home = sharedpreferences.getString(getString(R.string.SET_FILTER_REGEX_HOME) + currentUserID + currentInstance, null); regex_local = sharedpreferences.getString(getString(R.string.SET_FILTER_REGEX_LOCAL) + currentUserID + currentInstance, null); regex_public = sharedpreferences.getString(getString(R.string.SET_FILTER_REGEX_PUBLIC) + currentUserID + currentInstance, null); @@ -1334,14 +1335,17 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt .inflate(R.menu.option_filter_toots, popup.getMenu()); Menu menu = popup.getMenu(); final MenuItem itemShowBoosts = menu.findItem(R.id.action_show_boosts); + final MenuItem itemShowDMs = menu.findItem(R.id.action_show_dms); final MenuItem itemShowReplies = menu.findItem(R.id.action_show_replies); final MenuItem itemFilter = menu.findItem(R.id.action_filter); if (!showExtendedFilter) { itemShowBoosts.setVisible(false); itemShowReplies.setVisible(false); + itemShowDMs.setVisible(false); } else { itemShowBoosts.setVisible(true); itemShowReplies.setVisible(true); + itemShowDMs.setVisible(true); } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this); @@ -1356,6 +1360,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt itemShowBoosts.setChecked(show_boosts); itemShowReplies.setChecked(show_replies); + itemShowDMs.setChecked(show_dms); if (show_filtered != null && show_filtered.length() > 0) { itemFilter.setTitle(show_filtered); } @@ -1395,6 +1400,11 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt editor.putBoolean(getString(R.string.SET_SHOW_REPLIES) + currentUserID + currentInstance, show_replies); itemShowReplies.setChecked(show_replies); editor.apply(); + } else if (itemId == R.id.action_show_dms) { + show_dms = !show_dms; + editor.putBoolean(getString(R.string.SET_SHOW_DMS) + currentUserID + currentInstance, show_dms); + itemShowDMs.setChecked(show_dms); + editor.apply(); } else if (itemId == R.id.action_filter) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); LayoutInflater inflater = getLayoutInflater(); diff --git a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java index c9c85dbd..08639bc8 100644 --- a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java @@ -77,6 +77,7 @@ public class CrossActionHelper { } else { List accountList = new ArrayList<>(); for (BaseAccount account : accounts) { + account.mastodon_account.acct += "@" + account.instance; accountList.add(account.mastodon_account); } Handler mainHandler = new Handler(Looper.getMainLooper()); diff --git a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java index 4f92c1e8..8725fc0d 100644 --- a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java @@ -19,6 +19,7 @@ import static app.fedilab.android.BaseMainActivity.currentAccount; import static app.fedilab.android.BaseMainActivity.currentInstance; import static app.fedilab.android.BaseMainActivity.currentUserID; import static app.fedilab.android.BaseMainActivity.show_boosts; +import static app.fedilab.android.BaseMainActivity.show_dms; import static app.fedilab.android.BaseMainActivity.show_replies; import static app.fedilab.android.ui.pageadapter.FedilabPageAdapter.BOTTOM_TIMELINE_COUNT; @@ -627,13 +628,16 @@ public class PinnedTimelineHelper { Menu menu = popup.getMenu(); final MenuItem itemShowBoosts = menu.findItem(R.id.action_show_boosts); final MenuItem itemShowReplies = menu.findItem(R.id.action_show_replies); + final MenuItem itemShowDMs = menu.findItem(R.id.action_show_dms); final MenuItem itemFilter = menu.findItem(R.id.action_filter); if (!showExtendedFilter) { itemShowBoosts.setVisible(false); itemShowReplies.setVisible(false); + itemShowDMs.setVisible(false); } else { itemShowBoosts.setVisible(true); itemShowReplies.setVisible(true); + itemShowDMs.setVisible(true); } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); String show_filtered = null; @@ -647,6 +651,7 @@ public class PinnedTimelineHelper { itemShowBoosts.setChecked(show_boosts); itemShowReplies.setChecked(show_replies); + itemShowDMs.setChecked(show_dms); if (show_filtered != null && show_filtered.length() > 0) { itemFilter.setTitle(show_filtered); } @@ -686,6 +691,11 @@ public class PinnedTimelineHelper { editor.putBoolean(activity.getString(R.string.SET_SHOW_REPLIES) + currentUserID + currentInstance, show_replies); itemShowReplies.setChecked(show_replies); editor.apply(); + } else if (itemId == R.id.action_show_dms) { + show_dms = !show_dms; + editor.putBoolean(activity.getString(R.string.SET_SHOW_DMS) + currentUserID + currentInstance, show_dms); + itemShowDMs.setChecked(show_dms); + editor.apply(); } else if (itemId == R.id.action_filter) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); LayoutInflater inflater = activity.getLayoutInflater(); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index a1e5aca6..f58f90de 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -22,6 +22,7 @@ import static app.fedilab.android.BaseMainActivity.regex_home; import static app.fedilab.android.BaseMainActivity.regex_local; import static app.fedilab.android.BaseMainActivity.regex_public; import static app.fedilab.android.BaseMainActivity.show_boosts; +import static app.fedilab.android.BaseMainActivity.show_dms; import static app.fedilab.android.BaseMainActivity.show_replies; import static app.fedilab.android.activities.ContextActivity.expand; import static app.fedilab.android.helper.Helper.ARG_TIMELINE_REFRESH_ALL; @@ -198,6 +199,9 @@ public class StatusAdapter extends RecyclerView.Adapter if (timelineType == Timeline.TimeLineEnum.HOME && !show_boosts && status.reblog != null) { return false; } + if (timelineType == Timeline.TimeLineEnum.HOME && !show_dms && status.visibility.equalsIgnoreCase("direct")) { + return false; + } if (timelineType == Timeline.TimeLineEnum.HOME && !show_replies && status.in_reply_to_id != null) { return false; } diff --git a/app/src/main/res/menu/option_filter_toots.xml b/app/src/main/res/menu/option_filter_toots.xml index c5be1351..3b96947f 100644 --- a/app/src/main/res/menu/option_filter_toots.xml +++ b/app/src/main/res/menu/option_filter_toots.xml @@ -15,6 +15,12 @@ android:title="@string/show_replies" app:actionViewClass="android.widget.CheckBox" app:showAsAction="always" /> + Boosts Show boosts Show replies + Show direct messages Open in browser Translate @@ -1385,7 +1386,7 @@ SET_LED_COLOUR_VAL_N SET_SHOW_BOOSTS SET_SHOW_REPLIES - + SET_SHOW_DMS SET_DISABLE_ANIMATED_EMOJI SET_CAPITALIZE diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/469.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/469.txt new file mode 100644 index 00000000..19199c89 --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/469.txt @@ -0,0 +1,9 @@ +Added: +- Maths support (view and compose) +- Filter DMs in HOME (long press on the tab) + +Changed: +- Hide single media with preview is now a setting (default: disabled) + +Fixed: +- Cross-actions didn't display account instances \ No newline at end of file