mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
parent
effb276aa8
commit
dd6574fbf4
@ -29,6 +29,7 @@ import awais.instagrabber.adapters.SavedCollectionsAdapter;
|
|||||||
import awais.instagrabber.databinding.ItemDiscoverTopicBinding;
|
import awais.instagrabber.databinding.ItemDiscoverTopicBinding;
|
||||||
import awais.instagrabber.repositories.responses.discover.TopicCluster;
|
import awais.instagrabber.repositories.responses.discover.TopicCluster;
|
||||||
import awais.instagrabber.repositories.responses.saved.SavedCollection;
|
import awais.instagrabber.repositories.responses.saved.SavedCollection;
|
||||||
|
import awais.instagrabber.repositories.responses.Media;
|
||||||
import awais.instagrabber.utils.ResponseBodyUtils;
|
import awais.instagrabber.utils.ResponseBodyUtils;
|
||||||
|
|
||||||
public class TopicClusterViewHolder extends RecyclerView.ViewHolder {
|
public class TopicClusterViewHolder extends RecyclerView.ViewHolder {
|
||||||
@ -130,7 +131,10 @@ public class TopicClusterViewHolder extends RecyclerView.ViewHolder {
|
|||||||
}
|
}
|
||||||
// binding.title.setTransitionName("title-" + topicCluster.getCollectionId());
|
// binding.title.setTransitionName("title-" + topicCluster.getCollectionId());
|
||||||
binding.cover.setTransitionName("cover-" + topicCluster.getCollectionId());
|
binding.cover.setTransitionName("cover-" + topicCluster.getCollectionId());
|
||||||
final String thumbUrl = ResponseBodyUtils.getThumbUrl(topicCluster.getCoverMediaList().get(0));
|
final Media coverMedia = topicCluster.getCoverMediaList() == null
|
||||||
|
? topicCluster.getCoverMedia()
|
||||||
|
: topicCluster.getCoverMediaList().get(0);
|
||||||
|
final String thumbUrl = ResponseBodyUtils.getThumbUrl(coverMedia);
|
||||||
if (thumbUrl == null) {
|
if (thumbUrl == null) {
|
||||||
binding.cover.setImageURI((String) null);
|
binding.cover.setImageURI((String) null);
|
||||||
} else {
|
} else {
|
||||||
|
@ -415,7 +415,10 @@ public class CollectionPostsFragment extends Fragment implements SwipeRefreshLay
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupCover() {
|
private void setupCover() {
|
||||||
final String coverUrl = ResponseBodyUtils.getImageUrl(savedCollection.getCoverMediaList().get(0));
|
final Media coverMedia = savedCollection.getCoverMediaList() == null
|
||||||
|
? savedCollection.getCoverMedia()
|
||||||
|
: savedCollection.getCoverMediaList().get(0);
|
||||||
|
final String coverUrl = ResponseBodyUtils.getImageUrl(coverMedia);
|
||||||
final DraweeController controller = Fresco
|
final DraweeController controller = Fresco
|
||||||
.newDraweeControllerBuilder()
|
.newDraweeControllerBuilder()
|
||||||
.setOldController(binding.cover.getController())
|
.setOldController(binding.cover.getController())
|
||||||
|
@ -8,5 +8,5 @@ class SavedCollection(val collectionId: String,
|
|||||||
val collectionType: String,
|
val collectionType: String,
|
||||||
val collectionMediaCount: Int,
|
val collectionMediaCount: Int,
|
||||||
// coverMedia or coverMediaList: only one is defined
|
// coverMedia or coverMediaList: only one is defined
|
||||||
val coverMedia: Media,
|
val coverMedia: Media?,
|
||||||
val coverMediaList: List<Media>) : Serializable
|
val coverMediaList: List<Media>?) : Serializable
|
Loading…
Reference in New Issue
Block a user