use of com.mxt.anitrend.adapter.recycler.group.GroupActorAdapter in project anitrend-app by AniTrend.
the class CharacterActorsFragment method updateUI.
@Override
protected void updateUI() {
if (mAdapter == null) {
mAdapter = new GroupActorAdapter(model, getContext());
((GroupActorAdapter) mAdapter).setMediaClickListener(new ItemClickListener<EntityGroup>() {
/**
* When the target view from {@link View.OnClickListener}
* is clicked from a view holder this method will be called
*
* @param target view that has been clicked
* @param data the model that at the click index
*/
@Override
public void onItemClick(View target, EntityGroup data) {
switch(target.getId()) {
case R.id.container:
Intent intent = new Intent(getActivity(), MediaActivity.class);
intent.putExtra(KeyUtil.arg_id, ((MediaBase) data).getId());
intent.putExtra(KeyUtil.arg_mediaType, ((MediaBase) data).getType());
CompatUtil.startRevealAnim(getActivity(), target, intent);
break;
}
}
/**
* When the target view from {@link View.OnLongClickListener}
* is clicked from a view holder this method will be called
*
* @param target view that has been long clicked
* @param data the model that at the long click index
*/
@Override
public void onItemLongClick(View target, EntityGroup data) {
switch(target.getId()) {
case R.id.container:
if (getPresenter().getApplicationPref().isAuthenticated()) {
mediaActionUtil = new MediaActionUtil.Builder().setModel((MediaBase) data).build(getActivity());
mediaActionUtil.startSeriesAction();
} else
NotifyUtil.makeText(getContext(), R.string.info_login_req, R.drawable.ic_group_add_grey_600_18dp, Toast.LENGTH_SHORT).show();
break;
}
}
});
}
setSwipeRefreshLayoutEnabled(false);
injectAdapter();
}
Aggregations