use of com.mxt.anitrend.model.entity.base.UserBase in project anitrend-app by AniTrend.
the class CommentFragment method onItemClick.
/**
* 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, FeedReply data) {
Intent intent;
switch(target.getId()) {
case R.id.series_image:
MediaBase mediaBase = feedList.getMedia();
intent = new Intent(getActivity(), MediaActivity.class);
intent.putExtra(KeyUtil.arg_id, mediaBase.getId());
intent.putExtra(KeyUtil.arg_mediaType, mediaBase.getType());
CompatUtil.startRevealAnim(getActivity(), target, intent);
break;
case R.id.widget_mention:
composerWidget.mentionUserFrom(data);
break;
case R.id.widget_edit:
composerWidget.setModel(data, KeyUtil.MUT_SAVE_FEED_REPLY);
composerWidget.setText(data.getReply());
break;
case R.id.widget_users:
List<UserBase> likes = data.getLikes();
if (likes.size() > 0) {
mBottomSheet = new BottomSheetUsers.Builder().setModel(likes).setTitle(R.string.title_bottom_sheet_likes).build();
showBottomSheet();
} else
NotifyUtil.makeText(getActivity(), R.string.text_no_likes, Toast.LENGTH_SHORT).show();
break;
case R.id.user_avatar:
intent = new Intent(getActivity(), ProfileActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(KeyUtil.arg_id, data.getUser().getId());
CompatUtil.startRevealAnim(getActivity(), target, intent);
break;
}
}
use of com.mxt.anitrend.model.entity.base.UserBase in project anitrend-app by AniTrend.
the class FeedListFragment method onItemClick.
/**
* 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, FeedList data) {
Intent intent;
switch(target.getId()) {
case R.id.series_image:
MediaBase series = data.getMedia();
intent = new Intent(getActivity(), MediaActivity.class);
intent.putExtra(KeyUtil.arg_id, series.getId());
intent.putExtra(KeyUtil.arg_mediaType, series.getType());
CompatUtil.startRevealAnim(getActivity(), target, intent);
break;
case R.id.widget_comment:
intent = new Intent(getActivity(), CommentActivity.class);
intent.putExtra(KeyUtil.arg_model, data);
CompatUtil.startRevealAnim(getActivity(), target, intent);
break;
case R.id.widget_edit:
mBottomSheet = new BottomSheetComposer.Builder().setUserActivity(data).setRequestMode(KeyUtil.MUT_SAVE_TEXT_FEED).setTitle(R.string.edit_status_title).build();
showBottomSheet();
break;
case R.id.widget_users:
List<UserBase> likes = data.getLikes();
if (likes.size() > 0) {
mBottomSheet = new BottomSheetUsers.Builder().setModel(likes).setTitle(R.string.title_bottom_sheet_likes).build();
showBottomSheet();
} else
NotifyUtil.makeText(getActivity(), R.string.text_no_likes, Toast.LENGTH_SHORT).show();
break;
case R.id.user_avatar:
if (data.getUser() != null) {
intent = new Intent(getActivity(), ProfileActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(KeyUtil.arg_id, data.getUser().getId());
CompatUtil.startRevealAnim(getActivity(), target, intent);
}
break;
}
}
Aggregations