|
116 | 116 | import org.schabi.newpipe.util.ThemeHelper;
|
117 | 117 | import org.schabi.newpipe.util.external_communication.KoreUtils;
|
118 | 118 | import org.schabi.newpipe.util.external_communication.ShareUtils;
|
119 |
| -import org.schabi.newpipe.util.image.PicassoHelper; |
| 119 | +import org.schabi.newpipe.util.image.CoilHelper; |
120 | 120 |
|
121 | 121 | import java.util.ArrayList;
|
122 | 122 | import java.util.Iterator;
|
|
127 | 127 | import java.util.concurrent.TimeUnit;
|
128 | 128 | import java.util.function.Consumer;
|
129 | 129 |
|
| 130 | +import coil.util.CoilUtils; |
130 | 131 | import icepick.State;
|
131 | 132 | import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
132 | 133 | import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
@@ -159,8 +160,6 @@ public final class VideoDetailFragment
|
159 | 160 | private static final String DESCRIPTION_TAB_TAG = "DESCRIPTION TAB";
|
160 | 161 | private static final String EMPTY_TAB_TAG = "EMPTY TAB";
|
161 | 162 |
|
162 |
| - private static final String PICASSO_VIDEO_DETAILS_TAG = "PICASSO_VIDEO_DETAILS_TAG"; |
163 |
| - |
164 | 163 | // tabs
|
165 | 164 | private boolean showComments;
|
166 | 165 | private boolean showRelatedItems;
|
@@ -1471,7 +1470,11 @@ public void showLoading() {
|
1471 | 1470 | }
|
1472 | 1471 | }
|
1473 | 1472 |
|
1474 |
| - PicassoHelper.cancelTag(PICASSO_VIDEO_DETAILS_TAG); |
| 1473 | + CoilUtils.dispose(binding.detailThumbnailImageView); |
| 1474 | + CoilUtils.dispose(binding.detailSubChannelThumbnailView); |
| 1475 | + CoilUtils.dispose(binding.overlayThumbnail); |
| 1476 | + CoilUtils.dispose(binding.detailUploaderThumbnailView); |
| 1477 | + |
1475 | 1478 | binding.detailThumbnailImageView.setImageBitmap(null);
|
1476 | 1479 | binding.detailSubChannelThumbnailView.setImageBitmap(null);
|
1477 | 1480 | }
|
@@ -1562,8 +1565,8 @@ public void handleResult(@NonNull final StreamInfo info) {
|
1562 | 1565 | binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
1563 | 1566 |
|
1564 | 1567 | checkUpdateProgressInfo(info);
|
1565 |
| - PicassoHelper.loadDetailsThumbnail(info.getThumbnails()).tag(PICASSO_VIDEO_DETAILS_TAG) |
1566 |
| - .into(binding.detailThumbnailImageView); |
| 1568 | + CoilHelper.INSTANCE.loadDetailsThumbnail(binding.detailThumbnailImageView, |
| 1569 | + info.getThumbnails()); |
1567 | 1570 | showMetaInfoInTextView(info.getMetaInfo(), binding.detailMetaInfoTextView,
|
1568 | 1571 | binding.detailMetaInfoSeparator, disposables);
|
1569 | 1572 |
|
@@ -1613,8 +1616,8 @@ private void displayUploaderAsSubChannel(final StreamInfo info) {
|
1613 | 1616 | binding.detailUploaderTextView.setVisibility(View.GONE);
|
1614 | 1617 | }
|
1615 | 1618 |
|
1616 |
| - PicassoHelper.loadAvatar(info.getUploaderAvatars()).tag(PICASSO_VIDEO_DETAILS_TAG) |
1617 |
| - .into(binding.detailSubChannelThumbnailView); |
| 1619 | + CoilHelper.INSTANCE.loadAvatar(binding.detailSubChannelThumbnailView, |
| 1620 | + info.getUploaderAvatars()); |
1618 | 1621 | binding.detailSubChannelThumbnailView.setVisibility(View.VISIBLE);
|
1619 | 1622 | binding.detailUploaderThumbnailView.setVisibility(View.GONE);
|
1620 | 1623 | }
|
@@ -1645,11 +1648,11 @@ private void displayBothUploaderAndSubChannel(final StreamInfo info) {
|
1645 | 1648 | binding.detailUploaderTextView.setVisibility(View.GONE);
|
1646 | 1649 | }
|
1647 | 1650 |
|
1648 |
| - PicassoHelper.loadAvatar(info.getSubChannelAvatars()).tag(PICASSO_VIDEO_DETAILS_TAG) |
1649 |
| - .into(binding.detailSubChannelThumbnailView); |
| 1651 | + CoilHelper.INSTANCE.loadAvatar(binding.detailSubChannelThumbnailView, |
| 1652 | + info.getSubChannelAvatars()); |
1650 | 1653 | binding.detailSubChannelThumbnailView.setVisibility(View.VISIBLE);
|
1651 |
| - PicassoHelper.loadAvatar(info.getUploaderAvatars()).tag(PICASSO_VIDEO_DETAILS_TAG) |
1652 |
| - .into(binding.detailUploaderThumbnailView); |
| 1654 | + CoilHelper.INSTANCE.loadAvatar(binding.detailUploaderThumbnailView, |
| 1655 | + info.getUploaderAvatars()); |
1653 | 1656 | binding.detailUploaderThumbnailView.setVisibility(View.VISIBLE);
|
1654 | 1657 | }
|
1655 | 1658 |
|
@@ -2403,8 +2406,7 @@ private void updateOverlayData(@Nullable final String overlayTitle,
|
2403 | 2406 | binding.overlayTitleTextView.setText(isEmpty(overlayTitle) ? "" : overlayTitle);
|
2404 | 2407 | binding.overlayChannelTextView.setText(isEmpty(uploader) ? "" : uploader);
|
2405 | 2408 | binding.overlayThumbnail.setImageDrawable(null);
|
2406 |
| - PicassoHelper.loadDetailsThumbnail(thumbnails).tag(PICASSO_VIDEO_DETAILS_TAG) |
2407 |
| - .into(binding.overlayThumbnail); |
| 2409 | + CoilHelper.INSTANCE.loadDetailsThumbnail(binding.overlayThumbnail, thumbnails); |
2408 | 2410 | }
|
2409 | 2411 |
|
2410 | 2412 | private void setOverlayPlayPauseImage(final boolean playerIsPlaying) {
|
|
0 commit comments