Search in sources :

Example 1 with MediaAdapter

use of com.mxt.anitrend.adapter.recycler.index.MediaAdapter in project anitrend-app by AniTrend.

the class MediaSearchFragment 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) {
        searchQuery = getArguments().getString(KeyUtil.arg_search);
        mediaType = getArguments().getString(KeyUtil.arg_mediaType);
    }
    mColumnSize = R.integer.grid_giphy_x3;
    isPager = true;
    mAdapter = new MediaAdapter(getContext(), true);
    setPresenter(new BasePresenter(getContext()));
    setViewModel(true);
}
Also used : MediaAdapter(com.mxt.anitrend.adapter.recycler.index.MediaAdapter) BasePresenter(com.mxt.anitrend.presenter.base.BasePresenter)

Example 2 with MediaAdapter

use of com.mxt.anitrend.adapter.recycler.index.MediaAdapter in project anitrend-app by AniTrend.

the class MediaBrowseFragment 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) {
        queryContainer = getArguments().getParcelable(KeyUtil.arg_graph_params);
        mediaBrowseUtil = getArguments().getParcelable(KeyUtil.arg_media_util);
    }
    if (mediaBrowseUtil == null)
        mediaBrowseUtil = new MediaBrowseUtil(true);
    isPager = true;
    isFilterable = mediaBrowseUtil.isFilterEnabled();
    mAdapter = new MediaAdapter(getContext(), mediaBrowseUtil.isCompactType());
    setPresenter(new MediaPresenter(getContext()));
    setViewModel(true);
    if (mediaBrowseUtil.isCompactType()) {
        mColumnSize = R.integer.grid_giphy_x3;
    } else {
        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 : MediaBrowseUtil(com.mxt.anitrend.util.media.MediaBrowseUtil) MediaAdapter(com.mxt.anitrend.adapter.recycler.index.MediaAdapter) MediaPresenter(com.mxt.anitrend.presenter.fragment.MediaPresenter)

Example 3 with MediaAdapter

use of com.mxt.anitrend.adapter.recycler.index.MediaAdapter in project anitrend-app by AniTrend.

the class StudioMediaFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null)
        id = getArguments().getLong(KeyUtil.arg_id);
    mColumnSize = R.integer.grid_giphy_x3;
    isPager = true;
    isFilterable = true;
    mAdapter = new MediaAdapter(getContext(), true);
    setPresenter(new MediaPresenter(getContext()));
    setViewModel(true);
}
Also used : MediaAdapter(com.mxt.anitrend.adapter.recycler.index.MediaAdapter) MediaPresenter(com.mxt.anitrend.presenter.fragment.MediaPresenter)

Example 4 with MediaAdapter

use of com.mxt.anitrend.adapter.recycler.index.MediaAdapter in project anitrend-app by AniTrend.

the class MediaFavouriteFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        userId = getArguments().getLong(KeyUtil.arg_id);
        mediaType = getArguments().getString(KeyUtil.arg_mediaType);
    }
    mAdapter = new MediaAdapter(getContext(), true);
    setPresenter(new BasePresenter(getContext()));
    mColumnSize = R.integer.grid_giphy_x3;
    isPager = true;
    setViewModel(true);
}
Also used : MediaAdapter(com.mxt.anitrend.adapter.recycler.index.MediaAdapter) BasePresenter(com.mxt.anitrend.presenter.base.BasePresenter)

Aggregations

MediaAdapter (com.mxt.anitrend.adapter.recycler.index.MediaAdapter)4 BasePresenter (com.mxt.anitrend.presenter.base.BasePresenter)2 MediaPresenter (com.mxt.anitrend.presenter.fragment.MediaPresenter)2 MediaBrowseUtil (com.mxt.anitrend.util.media.MediaBrowseUtil)1