Some fixes
This commit is contained in:
parent
f4f865a149
commit
507a58b024
|
@ -57,6 +57,8 @@ import app.fedilab.android.sqlite.Sqlite;
|
|||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static android.content.Context.MODE_PRIVATE;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas on 14/01/2019.
|
||||
|
@ -112,16 +114,19 @@ public class ArtListAdapter extends RecyclerView.Adapter implements OnPostAction
|
|||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean show_account_boosts = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_BOOSTS, true);
|
||||
boolean show_account_replies = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_REPLIES, true);
|
||||
boolean isDisplayed = Helper.filterToots(statuses.get(position), RetrieveFeedsAsyncTask.Type.ART, context instanceof ShowAccountActivity, show_account_boosts, show_account_replies);
|
||||
|
||||
if (!isDisplayed)
|
||||
boolean show_account_boosts = false;
|
||||
boolean show_account_replies = false;
|
||||
if (context instanceof ShowAccountActivity) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
show_account_boosts = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_BOOSTS, true);
|
||||
show_account_replies = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_REPLIES, true);
|
||||
}
|
||||
if (!Helper.filterToots(statuses.get(position), RetrieveFeedsAsyncTask.Type.ART, context instanceof ShowAccountActivity, show_account_boosts, show_account_replies)) {
|
||||
return HIDDEN_STATUS;
|
||||
else
|
||||
} else {
|
||||
return DISPLAYED_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
|
|
|
@ -351,15 +351,19 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean show_account_boosts = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_BOOSTS, true);
|
||||
boolean show_account_replies = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_REPLIES, true);
|
||||
boolean isDisplayed = Helper.filterToots(statuses.get(position), type, context instanceof ShowAccountActivity, show_account_boosts, show_account_replies);
|
||||
if (!isDisplayed)
|
||||
boolean show_account_boosts = false;
|
||||
boolean show_account_replies = false;
|
||||
if (context instanceof ShowAccountActivity) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
show_account_boosts = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_BOOSTS, true);
|
||||
show_account_replies = sharedpreferences.getBoolean(Helper.SHOW_ACCOUNT_REPLIES, true);
|
||||
}
|
||||
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && type != RetrieveFeedsAsyncTask.Type.NEWS && !Helper.filterToots(statuses.get(position), type, context instanceof ShowAccountActivity, show_account_boosts, show_account_replies)) {
|
||||
return HIDDEN_STATUS;
|
||||
else
|
||||
} else {
|
||||
return DISPLAYED_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue