Search in sources :

Example 1 with StudioBase

use of com.mxt.anitrend.model.entity.base.StudioBase in project anitrend-app by AniTrend.

the class MediaOverviewFragment method onClick.

/**
 * Called when a view has been clicked.
 *
 * @param v The view that was clicked.
 */
@Override
@OnClick({ R.id.series_image, R.id.anime_main_studio_container })
public void onClick(View v) {
    Intent intent;
    switch(v.getId()) {
        case R.id.series_image:
            intent = new Intent(getActivity(), ImagePreviewActivity.class);
            intent.putExtra(KeyUtil.arg_model, model.getCoverImage().getLarge());
            CompatUtil.startSharedImageTransition(getActivity(), v, intent, R.string.transition_image_preview);
            break;
        case R.id.anime_main_studio_container:
            ConnectionContainer<StudioBase> connectionContainer;
            if ((connectionContainer = model.getStudios()) != null && !connectionContainer.isEmpty()) {
                intent = new Intent(getActivity(), StudioActivity.class);
                intent.putExtra(KeyUtil.arg_id, connectionContainer.getConnection().getId());
                startActivity(intent);
            }
            break;
        default:
            super.onClick(v);
            break;
    }
}
Also used : StudioBase(com.mxt.anitrend.model.entity.base.StudioBase) Intent(android.content.Intent) StudioActivity(com.mxt.anitrend.view.activity.detail.StudioActivity) ImagePreviewActivity(com.mxt.anitrend.view.activity.base.ImagePreviewActivity) OnClick(butterknife.OnClick)

Aggregations

Intent (android.content.Intent)1 OnClick (butterknife.OnClick)1 StudioBase (com.mxt.anitrend.model.entity.base.StudioBase)1 ImagePreviewActivity (com.mxt.anitrend.view.activity.base.ImagePreviewActivity)1 StudioActivity (com.mxt.anitrend.view.activity.detail.StudioActivity)1