Some fixes

This commit is contained in:
Thomas 2023-01-17 14:19:46 +01:00
parent f8641a953a
commit 939023b71e
7 changed files with 43 additions and 2 deletions

View File

@ -187,7 +187,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
public static List<Filter> mainFilters;
public static List<app.fedilab.android.client.entities.api.Account> 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();

View File

@ -77,6 +77,7 @@ public class CrossActionHelper {
} else {
List<app.fedilab.android.client.entities.api.Account> accountList = new ArrayList<>();
for (BaseAccount account : accounts) {
account.mastodon_account.acct += "@" + account.instance;
accountList.add(account.mastodon_account);
}
Handler mainHandler = new Handler(Looper.getMainLooper());

View File

@ -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();

View File

@ -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<RecyclerView.ViewHolder>
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;
}

View File

@ -15,6 +15,12 @@
android:title="@string/show_replies"
app:actionViewClass="android.widget.CheckBox"
app:showAsAction="always" />
<item
android:id="@+id/action_show_dms"
android:checkable="true"
android:title="@string/show_privates"
app:actionViewClass="android.widget.CheckBox"
app:showAsAction="always" />
<item
android:id="@+id/action_filter"
android:title="@string/filter_regex"

View File

@ -48,6 +48,7 @@
<string name="reblog">Boosts</string>
<string name="show_boosts">Show boosts</string>
<string name="show_replies">Show replies</string>
<string name="show_privates">Show direct messages</string>
<string name="action_open_in_web">Open in browser</string>
<string name="translate">Translate</string>
<!--- Menu -->
@ -1385,7 +1386,7 @@
<string name="SET_LED_COLOUR_VAL_N" translatable="false">SET_LED_COLOUR_VAL_N</string>
<string name="SET_SHOW_BOOSTS" translatable="false">SET_SHOW_BOOSTS</string>
<string name="SET_SHOW_REPLIES" translatable="false">SET_SHOW_REPLIES</string>
<string name="SET_SHOW_DMS" translatable="false">SET_SHOW_DMS</string>
<string name="SET_DISABLE_ANIMATED_EMOJI" translatable="false">SET_DISABLE_ANIMATED_EMOJI</string>
<string name="SET_CAPITALIZE" translatable="false">SET_CAPITALIZE</string>

View File

@ -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