use of com.simplecity.amp_library.ui.adapters.DetailAdapter in project Shuttle by timusus.
the class DetailFragment method onCreate.
@Override
public void onCreate(final Bundle icicle) {
super.onCreate(icicle);
setHasOptionsMenu(true);
setEnterSharedElementCallback(enterSharedElementCallback);
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
Serializable object = getArguments().getSerializable(ARG_MODEL);
if (object instanceof AlbumArtist) {
albumArtist = (AlbumArtist) object;
} else if (object instanceof Album) {
album = (Album) object;
} else if (object instanceof Genre) {
genre = (Genre) object;
} else if (object instanceof Playlist) {
playlist = (Playlist) object;
}
if (adapter == null) {
adapter = new DetailAdapter();
adapter.setListener(this);
}
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("songWhitelist")) {
refreshAdapterItems();
}
};
prefs.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
if (requestManager == null) {
requestManager = Glide.with(this);
}
if (headerItem == null) {
headerItem = new HeaderView();
}
if (horizontalRecyclerView == null) {
horizontalRecyclerView = new HorizontalRecyclerView();
horizontalRecyclerView.setListener(this);
}
}
Aggregations