use of com.mxt.anitrend.adapter.recycler.index.MediaListAdapter in project anitrend-app by AniTrend.
the class MediaListFragment method onCreate.
/**
* Override and set presenter, mColumnSize, and fetch argument/s
*
* @param savedInstanceState
*/
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
userId = getArguments().getLong(KeyUtil.arg_id);
userName = getArguments().getString(KeyUtil.arg_userName);
queryContainer = getArguments().getParcelable(KeyUtil.arg_graph_params);
mediaType = getArguments().getString(KeyUtil.arg_mediaType);
}
isFilterable = true;
isPager = false;
hasSubscriber = true;
mAdapter = new MediaListAdapter(getContext());
((MediaListAdapter) mAdapter).setCurrentUser(userName);
setPresenter(new MediaPresenter(getContext()));
setViewModel(true);
if (getPresenter().getSettings().getMediaListStyle() == KeyUtil.LIST_VIEW_STYLE_COMPACT_X1) {
mColumnSize = R.integer.single_list_x1;
} else {
mColumnSize = R.integer.grid_list_x2;
}
}
use of com.mxt.anitrend.adapter.recycler.index.MediaListAdapter in project anitrend-app by AniTrend.
the class MediaListFragment method updateUI.
/**
* Is automatically called in the @onStart Method if overridden in list implementation
*/
@Override
protected void updateUI() {
if (mAdapter == null) {
mAdapter = new MediaListAdapter(model, getContext());
((MediaListAdapter) mAdapter).setCurrentUser(userName);
}
if (model != null && model.size() > 0)
injectAdapter();
}
use of com.mxt.anitrend.adapter.recycler.index.MediaListAdapter in project anitrend-app by AniTrend.
the class AiringListFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UserBase userBase = getPresenter().getDatabase().getCurrentUser();
userId = userBase.getId();
userName = userBase.getName();
mediaType = KeyUtil.ANIME;
((MediaListAdapter) mAdapter).setCurrentUser(userName);
queryContainer = GraphUtil.INSTANCE.getDefaultQuery(false).putVariable(KeyUtil.arg_statusIn, KeyUtil.CURRENT);
}
Aggregations