2020
2121import java .util .Collections ;
2222import java .util .List ;
23+ import java .util .function .Consumer ;
2324
2425import io .reactivex .rxjava3 .android .schedulers .AndroidSchedulers ;
2526import io .reactivex .rxjava3 .schedulers .Schedulers ;
@@ -214,13 +215,9 @@ private static void openChannelFragment(final Fragment fragment,
214215 // helper functions //
215216 /////////////////////////////////////////////
216217
217- private interface InfoCallback {
218- void onInfo (SinglePlayQueue item );
219- }
220-
221218 private static void fetchItemInfoIfSparse (final Fragment fragment ,
222219 final StreamInfoItem item ,
223- final InfoCallback callback ) {
220+ final Consumer < SinglePlayQueue > callback ) {
224221 if (!(item .getStreamType () == StreamType .LIVE_STREAM
225222 || item .getStreamType () == StreamType .AUDIO_LIVE_STREAM )
226223 && item .getDuration () < 0 ) {
@@ -242,10 +239,10 @@ private static void fetchItemInfoIfSparse(final Fragment fragment,
242239 throwable .toString ()))
243240 .subscribe ();
244241
245- callback .onInfo (new SinglePlayQueue (result ));
242+ callback .accept (new SinglePlayQueue (result ));
246243 }, throwable -> Log .e ("StreamDialogEntry" , throwable .toString ()));
247244 } else {
248- callback .onInfo (new SinglePlayQueue (item ));
245+ callback .accept (new SinglePlayQueue (item ));
249246 }
250247 }
251248}
0 commit comments