use of com.simplecity.amp_library.ui.adapters.AlbumAdapter in project Shuttle by timusus.
the class AlbumFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
albumAdapter = new AlbumAdapter();
albumAdapter.setListener(this);
prefs = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() != null && intent.getAction().equals("restartLoader")) {
refreshAdapterItems();
}
}
};
sharedPreferenceChangeListener = (sharedPreferences, key) -> {
if (key.equals("pref_theme_highlight_color") || key.equals("pref_theme_accent_color") || key.equals("pref_theme_white_accent")) {
themeUIComponents();
} else if (key.equals("albumWhitelist")) {
refreshAdapterItems();
}
};
prefs.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
if (requestManager == null) {
requestManager = Glide.with(this);
}
}
Aggregations