Search in sources :

Example 1 with MediaListAdapter

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;
    }
}
Also used : MediaListAdapter(com.mxt.anitrend.adapter.recycler.index.MediaListAdapter) MediaPresenter(com.mxt.anitrend.presenter.fragment.MediaPresenter)

Example 2 with MediaListAdapter

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();
}
Also used : MediaListAdapter(com.mxt.anitrend.adapter.recycler.index.MediaListAdapter)

Example 3 with MediaListAdapter

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);
}
Also used : UserBase(com.mxt.anitrend.model.entity.base.UserBase) MediaListAdapter(com.mxt.anitrend.adapter.recycler.index.MediaListAdapter)

Aggregations

MediaListAdapter (com.mxt.anitrend.adapter.recycler.index.MediaListAdapter)3 UserBase (com.mxt.anitrend.model.entity.base.UserBase)1 MediaPresenter (com.mxt.anitrend.presenter.fragment.MediaPresenter)1