Implement better image selection strategy
This commit is contained in:
parent
a6a7c2271a
commit
4164bf36f6
19 changed files with 161 additions and 89 deletions
|
|
@ -61,7 +61,7 @@ import org.schabi.newpipe.util.OnClickGesture
|
|||
import org.schabi.newpipe.util.ServiceHelper
|
||||
import org.schabi.newpipe.util.ThemeHelper.getGridSpanCountChannels
|
||||
import org.schabi.newpipe.util.external_communication.ShareUtils
|
||||
import org.schabi.newpipe.util.image.PicassoHelper
|
||||
import org.schabi.newpipe.util.image.ImageStrategy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
|
@ -343,7 +343,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||
when (i) {
|
||||
0 -> ShareUtils.shareText(
|
||||
requireContext(), selectedItem.name, selectedItem.url,
|
||||
PicassoHelper.choosePreferredImage(selectedItem.thumbnails)
|
||||
ImageStrategy.choosePreferredImage(selectedItem.thumbnails)
|
||||
)
|
||||
1 -> ShareUtils.openUrlInBrowser(requireContext(), selectedItem.url)
|
||||
2 -> deleteChannel(selectedItem)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import org.schabi.newpipe.extractor.feed.FeedInfo
|
|||
import org.schabi.newpipe.extractor.stream.StreamInfoItem
|
||||
import org.schabi.newpipe.local.feed.FeedDatabaseManager
|
||||
import org.schabi.newpipe.util.ExtractorHelper
|
||||
import org.schabi.newpipe.util.image.PicassoHelper
|
||||
import org.schabi.newpipe.util.image.ImageStrategy
|
||||
|
||||
class SubscriptionManager(context: Context) {
|
||||
private val database = NewPipeDatabase.getInstance(context)
|
||||
|
|
@ -74,7 +74,7 @@ class SubscriptionManager(context: Context) {
|
|||
Completable.fromRunnable {
|
||||
it.setData(
|
||||
info.name,
|
||||
PicassoHelper.choosePreferredImage(info.avatars),
|
||||
ImageStrategy.choosePreferredImage(info.avatars),
|
||||
info.description,
|
||||
info.subscriberCount
|
||||
)
|
||||
|
|
@ -105,7 +105,7 @@ class SubscriptionManager(context: Context) {
|
|||
} else if (info is ChannelInfo) {
|
||||
subscriptionEntity.setData(
|
||||
info.name,
|
||||
PicassoHelper.choosePreferredImage(info.avatars),
|
||||
ImageStrategy.choosePreferredImage(info.avatars),
|
||||
info.description,
|
||||
info.subscriberCount
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue