use of butter.droid.base.providers.media.model.MediaWrapper in project butter-android by butterproject.
the class StreamPlayerPresenterImpl method loadSubtitle.
private void loadSubtitle() {
SubtitleWrapper subtitle = streamInfo.getSubtitle();
MediaWrapper media = streamInfo.getMedia();
SubsProvider provider = providerManager.getSubsProvider(media.getProviderId());
subtitleManager.downloadSubtitle(provider, media.getMedia(), subtitle).observeOn(AndroidSchedulers.mainThread()).subscribe(new MaybeObserver<SubtitleWrapper>() {
@Override
public void onSubscribe(final Disposable d) {
disposeSubs();
subsDisposable = d;
}
@Override
public void onSuccess(final SubtitleWrapper subs) {
loadSubs(subs.getFileUri());
}
@Override
public void onError(final Throwable e) {
// TODO show error loading subs
Timber.d("Error loading subs");
}
@Override
public void onComplete() {
Timber.d("Maybe empty");
}
});
}
use of butter.droid.base.providers.media.model.MediaWrapper in project butter-android by butterproject.
the class TVMediaGridFragment method onMediaItemClicked.
private void onMediaItemClicked(ImageCardView view, MediaCardPresenter.MediaCardItem item) {
Bundle options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(), view.getMainImageView(), TVMediaDetailActivity.SHARED_ELEMENT_NAME).toBundle();
MediaWrapper media = item.getMediaWrapper();
startActivity(TVMediaDetailActivity.getIntent(getActivity(), media), options);
}
use of butter.droid.base.providers.media.model.MediaWrapper in project butter-android by butterproject.
the class TVOverviewFragment method onItemSelected.
@Override
public void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
int index = rowsAdapter.indexOf(row);
MediaWrapper mediaItem = null;
if (item instanceof MediaCardPresenter.MediaCardItem) {
mediaItem = ((MediaCardItem) item).getMediaWrapper();
}
presenter.rowSelected(index, mediaItem);
}
use of butter.droid.base.providers.media.model.MediaWrapper in project butter-android by butterproject.
the class TVOverviewFragment method onMediaItemClicked.
private void onMediaItemClicked(MediaCardPresenter.CustomImageCardView view, MediaCardPresenter.MediaCardItem media) {
Bundle options = ActivityOptionsCompat.makeSceneTransitionAnimation(requireActivity(), view.getMainImageView(), TVMediaDetailActivity.SHARED_ELEMENT_NAME).toBundle();
MediaWrapper mediaItem = media.getMediaWrapper();
if (view.getCustomSelectedSwatch() != null) {
mediaItem.setColor(view.getCustomSelectedSwatch().getRgb());
}
startActivity(TVMediaDetailActivity.getIntent(getActivity(), mediaItem), options);
}
use of butter.droid.base.providers.media.model.MediaWrapper in project butter-android by butterproject.
the class TVMediaDetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState, R.layout.activity_media_details);
backgroundUpdater.initialise(this, R.color.black);
Bundle extras = getIntent().getExtras();
final MediaWrapper media = extras.getParcelable(EXTRA_ITEM);
if (VersionUtils.isLollipop()) {
postponeEnterTransition();
}
presenter.onCreate(media);
}
Aggregations