use of com.frostwire.search.youtube.YouTubePackageSearchResult in project frostwire by frostwire.
the class PreviewPlayerActivity method onDownloadButtonClick.
private void onDownloadButtonClick() {
if (Ref.alive(srRef)) {
Engine.instance().getVibrator().hapticFeedback();
final FileSearchResult fileSearchResult = srRef.get();
if (fileSearchResult instanceof YouTubePackageSearchResult) {
releaseMediaPlayer();
YouTubeDownloadDialog ytDownloadDlg = YouTubeDownloadDialog.newInstance(this, (YouTubePackageSearchResult) fileSearchResult);
ytDownloadDlg.show(getFragmentManager());
} else {
NewTransferDialog dlg = NewTransferDialog.newInstance(fileSearchResult, false);
dlg.show(getFragmentManager());
}
} else {
finish();
}
}
use of com.frostwire.search.youtube.YouTubePackageSearchResult in project frostwire by frostwire.
the class SearchResultListAdapter method populateThumbnail.
private void populateThumbnail(View view, SearchResult sr) {
ImageView fileTypeIcon = findView(view, R.id.view_bittorrent_search_result_list_item_filetype_icon);
if (sr.getThumbnailUrl() != null) {
thumbLoader.load(Uri.parse(sr.getThumbnailUrl()), fileTypeIcon, 96, 96, getFileTypeIconId());
}
MediaPlaybackStatusOverlayView overlayView = findView(view, R.id.view_bittorrent_search_result_list_item_filetype_icon_media_playback_overlay_view);
fileTypeIcon.setOnClickListener(previewClickListener);
if (isAudio(sr) || sr instanceof YouTubePackageSearchResult) {
fileTypeIcon.setTag(sr);
overlayView.setTag(sr);
overlayView.setVisibility(View.VISIBLE);
overlayView.setPlaybackState(MediaPlaybackOverlayPainter.MediaPlaybackState.PREVIEW);
overlayView.setOnClickListener(previewClickListener);
} else {
fileTypeIcon.setTag(null);
overlayView.setTag(null);
overlayView.setVisibility(View.GONE);
overlayView.setPlaybackState(MediaPlaybackOverlayPainter.MediaPlaybackState.NONE);
}
}
Aggregations