use of me.ccrama.redditslide.Adapters.SettingsSubAdapter in project Slide by ccrama.
the class SettingsSubreddit method reloadSubList.
public void reloadSubList() {
changedSubs.clear();
List<String> allSubs = UserSubscriptions.sort(UserSubscriptions.getAllUserSubreddits(this));
// Check which subreddits are different
ColorPreferences colorPrefs = new ColorPreferences(SettingsSubreddit.this);
int defaultFont = colorPrefs.getFontStyle().getColor();
for (String s : allSubs) {
if (Palette.getColor(s) != Palette.getDefaultColor() || SettingValues.prefs.contains(Reddit.PREF_LAYOUT + s) || colorPrefs.getFontStyleSubreddit(s).getColor() != defaultFont || SettingValues.prefs.contains("picsenabled" + s.toLowerCase(Locale.ENGLISH))) {
changedSubs.add(s);
}
}
mSettingsSubAdapter = new SettingsSubAdapter(this, changedSubs);
recycler.setAdapter(mSettingsSubAdapter);
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.post_floating_action_button);
recycler.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (dy <= 0 && fab.getId() != 0) {
fab.show();
} else {
fab.hide();
}
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
});
fab.show();
}
Aggregations