Search in sources :

Example 1 with YouTubePackageSearchResult

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();
    }
}
Also used : FileSearchResult(com.frostwire.search.FileSearchResult) YouTubePackageSearchResult(com.frostwire.search.youtube.YouTubePackageSearchResult) YouTubeDownloadDialog(com.frostwire.android.gui.dialogs.YouTubeDownloadDialog) NewTransferDialog(com.frostwire.android.gui.dialogs.NewTransferDialog)

Example 2 with YouTubePackageSearchResult

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);
    }
}
Also used : YouTubePackageSearchResult(com.frostwire.search.youtube.YouTubePackageSearchResult) ImageView(android.widget.ImageView) MediaPlaybackStatusOverlayView(com.frostwire.android.gui.views.MediaPlaybackStatusOverlayView)

Aggregations

YouTubePackageSearchResult (com.frostwire.search.youtube.YouTubePackageSearchResult)2 ImageView (android.widget.ImageView)1 NewTransferDialog (com.frostwire.android.gui.dialogs.NewTransferDialog)1 YouTubeDownloadDialog (com.frostwire.android.gui.dialogs.YouTubeDownloadDialog)1 MediaPlaybackStatusOverlayView (com.frostwire.android.gui.views.MediaPlaybackStatusOverlayView)1 FileSearchResult (com.frostwire.search.FileSearchResult)1