Search in sources :

Example 1 with Settings

use of com.mxt.anitrend.util.Settings in project anitrend-app by AniTrend.

the class MediaBrowseFragment method makeRequest.

@Override
public void makeRequest() {
    Bundle bundle = getViewModel().getParams();
    Settings pref = getPresenter().getSettings();
    queryContainer.putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage());
    if (isFilterable) {
        if (!mediaBrowseUtil.isBasicFilter()) {
            if (CompatUtil.INSTANCE.equals(queryContainer.getVariable(KeyUtil.arg_mediaType), KeyUtil.MANGA)) {
                queryContainer.putVariable(KeyUtil.arg_startDateLike, String.format(Locale.getDefault(), "%d%%", getPresenter().getSettings().getSeasonYear())).putVariable(KeyUtil.arg_format, pref.getMangaFormat());
            } else {
                queryContainer.putVariable(KeyUtil.arg_seasonYear, getPresenter().getSettings().getSeasonYear()).putVariable(KeyUtil.arg_format, pref.getAnimeFormat());
            }
            queryContainer.putVariable(KeyUtil.arg_status, pref.getMediaStatus()).putVariable(KeyUtil.arg_genres, GenreTagUtil.getMappedValues(pref.getSelectedGenres())).putVariable(KeyUtil.arg_tags, GenreTagUtil.getMappedValues(pref.getSelectedTags()));
        }
        queryContainer.putVariable(KeyUtil.arg_sort, pref.getMediaSort() + pref.getSortOrder());
    }
    bundle.putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_BROWSE_REQ, getContext());
}
Also used : Bundle(android.os.Bundle) Settings(com.mxt.anitrend.util.Settings)

Example 2 with Settings

use of com.mxt.anitrend.util.Settings in project anitrend-app by AniTrend.

the class SuggestionListFragment method makeRequest.

@Override
public void makeRequest() {
    Settings pref = getPresenter().getSettings();
    Bundle bundle = getViewModel().getParams();
    queryContainer.putVariable(KeyUtil.arg_tagsInclude, getPresenter().getTopFavouriteTags(6)).putVariable(KeyUtil.arg_genresInclude, getPresenter().getTopFavouriteGenres(4)).putVariable(KeyUtil.arg_sort, pref.getMediaSort() + pref.getSortOrder()).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage());
    bundle.putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_BROWSE_REQ, getContext());
}
Also used : Bundle(android.os.Bundle) Settings(com.mxt.anitrend.util.Settings)

Example 3 with Settings

use of com.mxt.anitrend.util.Settings in project anitrend-app by AniTrend.

the class SharedContentActivity method configureActivity.

/**
 * Some activities may have custom themes and if that's the case
 * override this method and set your own theme style, also if you wish
 * to apply the default navigation bar style for light themes
 * @see ActivityBase#setNavigationStyle() if running android Oreo +
 */
@Override
protected void configureActivity() {
    Settings settings = KoinExt.get(Settings.class);
    setTheme(CompatUtil.INSTANCE.isLightTheme(settings) ? R.style.AppThemeLight_Translucent : R.style.AppThemeDark_Translucent);
}
Also used : Settings(com.mxt.anitrend.util.Settings)

Example 4 with Settings

use of com.mxt.anitrend.util.Settings in project anitrend-app by AniTrend.

the class StudioMediaFragment method makeRequest.

@Override
public void makeRequest() {
    Settings pref = getPresenter().getSettings();
    QueryContainerBuilder queryContainer = GraphUtil.INSTANCE.getDefaultQuery(isPager).putVariable(KeyUtil.arg_id, id).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage()).putVariable(KeyUtil.arg_sort, pref.getMediaSort() + pref.getSortOrder());
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.STUDIO_MEDIA_REQ, getContext());
}
Also used : QueryContainerBuilder(io.github.wax911.library.model.request.QueryContainerBuilder) Settings(com.mxt.anitrend.util.Settings)

Example 5 with Settings

use of com.mxt.anitrend.util.Settings in project anitrend-app by AniTrend.

the class BrowseReviewFragment method makeRequest.

/**
 * All new or updated network requests should be handled in this method
 */
@Override
public void makeRequest() {
    Settings pref = getPresenter().getSettings();
    QueryContainerBuilder queryContainer = GraphUtil.INSTANCE.getDefaultQuery(true).putVariable(KeyUtil.arg_mediaType, mediaType).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage()).putVariable(KeyUtil.arg_sort, pref.getReviewSort() + pref.getSortOrder());
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_REVIEWS_REQ, getContext());
}
Also used : QueryContainerBuilder(io.github.wax911.library.model.request.QueryContainerBuilder) Settings(com.mxt.anitrend.util.Settings)

Aggregations

Settings (com.mxt.anitrend.util.Settings)5 Bundle (android.os.Bundle)2 QueryContainerBuilder (io.github.wax911.library.model.request.QueryContainerBuilder)2