11
11
import android .view .MenuItem ;
12
12
import android .view .View ;
13
13
import android .view .ViewGroup ;
14
- import android .widget .ImageView ;
15
14
import android .widget .TextView ;
16
15
17
16
import androidx .annotation .NonNull ;
26
25
import org .schabi .newpipe .extractor .InfoItem ;
27
26
import org .schabi .newpipe .extractor .ListExtractor ;
28
27
import org .schabi .newpipe .extractor .NewPipe ;
28
+ import org .schabi .newpipe .extractor .ServiceList ;
29
29
import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
30
30
import org .schabi .newpipe .extractor .playlist .PlaylistInfo ;
31
+ import org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper ;
31
32
import org .schabi .newpipe .extractor .stream .StreamInfoItem ;
32
33
import org .schabi .newpipe .extractor .stream .StreamType ;
33
34
import org .schabi .newpipe .fragments .list .BaseListInfoFragment ;
49
50
import java .util .List ;
50
51
import java .util .concurrent .atomic .AtomicBoolean ;
51
52
53
+ import de .hdodenhof .circleimageview .CircleImageView ;
52
54
import io .reactivex .Flowable ;
53
55
import io .reactivex .Single ;
54
56
import io .reactivex .android .schedulers .AndroidSchedulers ;
@@ -73,7 +75,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
73
75
private TextView headerTitleView ;
74
76
private View headerUploaderLayout ;
75
77
private TextView headerUploaderName ;
76
- private ImageView headerUploaderAvatar ;
78
+ private CircleImageView headerUploaderAvatar ;
77
79
private TextView headerStreamCount ;
78
80
private View playlistCtrl ;
79
81
@@ -301,8 +303,21 @@ public void handleResult(@NonNull final PlaylistInfo result) {
301
303
302
304
playlistCtrl .setVisibility (View .VISIBLE );
303
305
304
- IMAGE_LOADER .displayImage (result .getUploaderAvatarUrl (), headerUploaderAvatar ,
305
- ImageDisplayConstants .DISPLAY_AVATAR_OPTIONS );
306
+ String avatarUrl = result .getUploaderAvatarUrl ();
307
+ if (result .getServiceId () == ServiceList .YouTube .getServiceId ()
308
+ && (YoutubeParsingHelper .isYoutubeMixId (result .getId ())
309
+ || YoutubeParsingHelper .isYoutubeMusicMixId (result .getId ()))) {
310
+ // this is an auto-generated playlist (e.g. Youtube mix), so a radio is shown
311
+ headerUploaderAvatar .setImageResource (
312
+ ThemeHelper .resolveResourceIdFromAttr (requireContext (), R .attr .ic_radio ));
313
+ headerUploaderAvatar .setBorderColor (
314
+ getResources ().getColor (R .color .transparent_background_color ));
315
+
316
+ } else {
317
+ IMAGE_LOADER .displayImage (avatarUrl , headerUploaderAvatar ,
318
+ ImageDisplayConstants .DISPLAY_AVATAR_OPTIONS );
319
+ }
320
+
306
321
headerStreamCount .setText (Localization
307
322
.localizeStreamCount (getContext (), result .getStreamCount ()));
308
323
0 commit comments