Loading app/src/main/java/app/fedilab/android/helper/TimelineHelper.java +26 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package app.fedilab.android.helper; import static app.fedilab.android.BaseMainActivity.filteredAccounts; import android.content.Context; import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; Loading @@ -25,6 +26,7 @@ import android.text.Html; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.preference.PreferenceManager; import java.io.IOException; import java.util.ArrayList; Loading @@ -35,6 +37,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; import app.fedilab.android.activities.MainActivity; import app.fedilab.android.client.endpoints.MastodonFiltersService; import app.fedilab.android.client.entities.api.Account; Loading Loading @@ -153,21 +156,40 @@ public class TimelineHelper { } } } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); boolean groupReblogs = sharedpreferences.getBoolean(context.getString(R.string.SET_GROUP_REBLOGS), true); if (filterTimeLineType == Timeline.TimeLineEnum.HOME) { for (int i = 0; i < statuses.size(); i++) { if (filteredAccounts != null && filteredAccounts.size() > 0) { for (Status status : statuses) { for (Account account : filteredAccounts) { if (account.acct.equals(status.account.acct) || (status.reblog != null && account.acct.equals(status.reblog.account.acct))) { if (account.acct.equals(statuses.get(i).account.acct) || (statuses.get(i).reblog != null && account.acct.equals(statuses.get(i).reblog.account.acct))) { Filter filterCustom = new Filter(); filterCustom.filter_action = "hide"; ArrayList<String> contextCustom = new ArrayList<>(); contextCustom.add("home"); filterCustom.title = "Fedilab"; filterCustom.context = contextCustom; status.filteredByApp = filterCustom; statuses.get(i).filteredByApp = filterCustom; } } } //Group boosts if (groupReblogs && statuses.get(i).filteredByApp == null && statuses.get(i).reblog != null) { for (int j = 0; j < i; j++) { if (statuses.get(j).reblog != null && statuses.get(j).reblog.id.equals(statuses.get(i).reblog.id)) { Filter filterCustom = new Filter(); filterCustom.filter_action = "hide"; ArrayList<String> contextCustom = new ArrayList<>(); contextCustom.add("home"); filterCustom.title = "Fedilab reblog"; filterCustom.context = contextCustom; statuses.get(i).filteredByApp = filterCustom; } } } } } } Loading app/src/main/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1409,6 +1409,8 @@ <string name="SET_DISPLAY_ALL_NOTIFICATIONS_TYPE" translatable="false">SET_DISPLAY_ALL_NOTIFICATIONS_TYPE</string> <string name="SET_EXCLUDED_NOTIFICATIONS_TYPE" translatable="false">SET_EXCLUDED_NOTIFICATIONS_TYPE</string> <string name="SET_EXPAND_MEDIA" translatable="false">SET_EXPAND_MEDIA</string> <string name="SET_GROUP_REBLOGS" translatable="false">SET_GROUP_REBLOGS</string> <string name="SET_LIVE_TRANSLATE" translatable="false">SET_LIVE_TRANSLATE</string> <string name="SET_TRUNCATE_TOOTS_SIZE" translatable="false">SET_TRUNCATE_TOOTS_SIZE</string> <string name="SET_ART_WITH_NSFW" translatable="false">SET_ART_WITH_NSFW</string> Loading Loading @@ -2108,4 +2110,5 @@ <string name="put_all_accounts_in_home_muted">All accounts will be muted for the Home timeline.</string> <string name="mute_them_all">Mute them all</string> <string name="import_data">Import data</string> <string name="group_reblogs">Group reblogs in home timeline</string> </resources> No newline at end of file app/src/main/res/xml/pref_timelines.xml +6 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,12 @@ app:key="@string/SET_EXPAND_MEDIA" app:singleLineTitle="false" app:title="@string/expand_image" /> <SwitchPreferenceCompat android:defaultValue="true" app:iconSpaceReserved="false" app:key="@string/SET_GROUP_REBLOGS" app:singleLineTitle="false" app:title="@string/group_reblogs" /> <ListPreference android:defaultValue="default" app:entries="@array/SET_LIVE_TRANSLATE_VALUES" Loading src/fdroid/fastlane/metadata/android/en/changelogs/451.txt +1 −0 Original line number Diff line number Diff line Added: - Post random quotes - Group reblogs in home timeline Changed: - Display translate button only when language is different Loading Loading
app/src/main/java/app/fedilab/android/helper/TimelineHelper.java +26 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package app.fedilab.android.helper; import static app.fedilab.android.BaseMainActivity.filteredAccounts; import android.content.Context; import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; Loading @@ -25,6 +26,7 @@ import android.text.Html; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.preference.PreferenceManager; import java.io.IOException; import java.util.ArrayList; Loading @@ -35,6 +37,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; import app.fedilab.android.activities.MainActivity; import app.fedilab.android.client.endpoints.MastodonFiltersService; import app.fedilab.android.client.entities.api.Account; Loading Loading @@ -153,21 +156,40 @@ public class TimelineHelper { } } } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); boolean groupReblogs = sharedpreferences.getBoolean(context.getString(R.string.SET_GROUP_REBLOGS), true); if (filterTimeLineType == Timeline.TimeLineEnum.HOME) { for (int i = 0; i < statuses.size(); i++) { if (filteredAccounts != null && filteredAccounts.size() > 0) { for (Status status : statuses) { for (Account account : filteredAccounts) { if (account.acct.equals(status.account.acct) || (status.reblog != null && account.acct.equals(status.reblog.account.acct))) { if (account.acct.equals(statuses.get(i).account.acct) || (statuses.get(i).reblog != null && account.acct.equals(statuses.get(i).reblog.account.acct))) { Filter filterCustom = new Filter(); filterCustom.filter_action = "hide"; ArrayList<String> contextCustom = new ArrayList<>(); contextCustom.add("home"); filterCustom.title = "Fedilab"; filterCustom.context = contextCustom; status.filteredByApp = filterCustom; statuses.get(i).filteredByApp = filterCustom; } } } //Group boosts if (groupReblogs && statuses.get(i).filteredByApp == null && statuses.get(i).reblog != null) { for (int j = 0; j < i; j++) { if (statuses.get(j).reblog != null && statuses.get(j).reblog.id.equals(statuses.get(i).reblog.id)) { Filter filterCustom = new Filter(); filterCustom.filter_action = "hide"; ArrayList<String> contextCustom = new ArrayList<>(); contextCustom.add("home"); filterCustom.title = "Fedilab reblog"; filterCustom.context = contextCustom; statuses.get(i).filteredByApp = filterCustom; } } } } } } Loading
app/src/main/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1409,6 +1409,8 @@ <string name="SET_DISPLAY_ALL_NOTIFICATIONS_TYPE" translatable="false">SET_DISPLAY_ALL_NOTIFICATIONS_TYPE</string> <string name="SET_EXCLUDED_NOTIFICATIONS_TYPE" translatable="false">SET_EXCLUDED_NOTIFICATIONS_TYPE</string> <string name="SET_EXPAND_MEDIA" translatable="false">SET_EXPAND_MEDIA</string> <string name="SET_GROUP_REBLOGS" translatable="false">SET_GROUP_REBLOGS</string> <string name="SET_LIVE_TRANSLATE" translatable="false">SET_LIVE_TRANSLATE</string> <string name="SET_TRUNCATE_TOOTS_SIZE" translatable="false">SET_TRUNCATE_TOOTS_SIZE</string> <string name="SET_ART_WITH_NSFW" translatable="false">SET_ART_WITH_NSFW</string> Loading Loading @@ -2108,4 +2110,5 @@ <string name="put_all_accounts_in_home_muted">All accounts will be muted for the Home timeline.</string> <string name="mute_them_all">Mute them all</string> <string name="import_data">Import data</string> <string name="group_reblogs">Group reblogs in home timeline</string> </resources> No newline at end of file
app/src/main/res/xml/pref_timelines.xml +6 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,12 @@ app:key="@string/SET_EXPAND_MEDIA" app:singleLineTitle="false" app:title="@string/expand_image" /> <SwitchPreferenceCompat android:defaultValue="true" app:iconSpaceReserved="false" app:key="@string/SET_GROUP_REBLOGS" app:singleLineTitle="false" app:title="@string/group_reblogs" /> <ListPreference android:defaultValue="default" app:entries="@array/SET_LIVE_TRANSLATE_VALUES" Loading
src/fdroid/fastlane/metadata/android/en/changelogs/451.txt +1 −0 Original line number Diff line number Diff line Added: - Post random quotes - Group reblogs in home timeline Changed: - Display translate button only when language is different Loading