use of com.mxt.anitrend.presenter.base.BasePresenter in project anitrend-app by AniTrend.
the class StudioFavouriteFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null)
userId = getArguments().getLong(KeyUtil.arg_id);
setPresenter(new BasePresenter(getContext()));
mColumnSize = R.integer.grid_list_x2;
isPager = true;
setViewModel(true);
}
use of com.mxt.anitrend.presenter.base.BasePresenter in project anitrend-app by AniTrend.
the class AiringListFragment method onCreate.
/**
* Override and set presenter, mColumnSize, and fetch argument/s
*
* @param savedInstanceState
*/
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setPresenter(new BasePresenter(getContext()));
isPager = true;
mColumnSize = R.integer.grid_list_x2;
setViewModel(true);
}
use of com.mxt.anitrend.presenter.base.BasePresenter in project anitrend-app by AniTrend.
the class SharedContentActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_share_content);
bottomSheetBehavior = BottomSheetBehavior.from(binding.designBottomSheet);
setPresenter(new BasePresenter(getApplicationContext()));
ButterKnife.bind(this);
setViewModel(true);
}
use of com.mxt.anitrend.presenter.base.BasePresenter in project anitrend-app by AniTrend.
the class TagGenreService method onHandleIntent.
@Override
protected void onHandleIntent(@Nullable Intent intent) {
try {
initAnalytics();
BasePresenter basePresenter = new BasePresenter(getApplicationContext());
BaseModel baseModel = WebFactory.createService(BaseModel.class, getApplicationContext());
if (basePresenter.getDatabase().getBoxStore(MediaTag.class).count() < 1) {
Response<List<MediaTag>> tagsResponse = baseModel.getTags(GraphUtil.getDefaultQuery(false)).execute();
if (tagsResponse.isSuccessful() && tagsResponse.body() != null)
basePresenter.getDatabase().saveMediaTags(tagsResponse.body());
else
Log.e(ServiceName, ErrorUtil.getError(tagsResponse));
}
if (basePresenter.getDatabase().getBoxStore(Genre.class).count() < 1) {
Response<List<String>> genreResponse = baseModel.getGenres(GraphUtil.getDefaultQuery(false)).execute();
List<String> genres;
if (genreResponse.isSuccessful() && (genres = genreResponse.body()) != null) {
List<Genre> genreList = Stream.of(genres).map(Genre::new).toList();
basePresenter.getDatabase().saveGenreCollection(genreList);
} else
Log.e(ServiceName, ErrorUtil.getError(genreResponse));
}
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations