Merge branch 'devel' into next
This commit is contained in:
@@ -121,13 +121,14 @@ class ScrobblingInfoSheet :
|
||||
dismissAllowingStateLoss()
|
||||
return
|
||||
}
|
||||
requireViewBinding().textViewTitle.text = scrobbling.title
|
||||
requireViewBinding().ratingBar.rating = scrobbling.rating * requireViewBinding().ratingBar.numStars
|
||||
requireViewBinding().textViewDescription.text = scrobbling.description?.sanitize()
|
||||
requireViewBinding().spinnerStatus.setSelection(scrobbling.status?.ordinal ?: -1)
|
||||
requireViewBinding().imageViewLogo.contentDescription = getString(scrobbling.scrobbler.titleResId)
|
||||
requireViewBinding().imageViewLogo.setImageResource(scrobbling.scrobbler.iconResId)
|
||||
requireViewBinding().imageViewCover.newImageRequest(viewLifecycleOwner, scrobbling.coverUrl)?.apply {
|
||||
val binding = viewBinding ?: return
|
||||
binding.textViewTitle.text = scrobbling.title
|
||||
binding.ratingBar.rating = scrobbling.rating * binding.ratingBar.numStars
|
||||
binding.textViewDescription.text = scrobbling.description?.sanitize()
|
||||
binding.spinnerStatus.setSelection(scrobbling.status?.ordinal ?: -1)
|
||||
binding.imageViewLogo.contentDescription = getString(scrobbling.scrobbler.titleResId)
|
||||
binding.imageViewLogo.setImageResource(scrobbling.scrobbler.iconResId)
|
||||
binding.imageViewCover.newImageRequest(viewLifecycleOwner, scrobbling.coverUrl)?.apply {
|
||||
placeholder(R.drawable.ic_placeholder)
|
||||
fallback(R.drawable.ic_placeholder)
|
||||
error(R.drawable.ic_error_placeholder)
|
||||
|
||||
@@ -67,12 +67,20 @@ class UserDataSettingsFragment : BasePreferenceFragment(R.string.data_and_privac
|
||||
findPreference<Preference>(AppSettings.KEY_HTTP_CACHE_CLEAR)?.bindBytesSizeSummary(viewModel.httpCacheSize)
|
||||
findPreference<Preference>(AppSettings.KEY_SEARCH_HISTORY_CLEAR)?.let { pref ->
|
||||
viewModel.searchHistoryCount.observe(viewLifecycleOwner) {
|
||||
pref.summary = pref.context.resources.getQuantityString(R.plurals.items, it, it)
|
||||
pref.summary = if (it < 0) {
|
||||
view.context.getString(R.string.loading_)
|
||||
} else {
|
||||
pref.context.resources.getQuantityString(R.plurals.items, it, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
findPreference<Preference>(AppSettings.KEY_UPDATES_FEED_CLEAR)?.let { pref ->
|
||||
viewModel.feedItemsCount.observe(viewLifecycleOwner) {
|
||||
pref.summary = pref.context.resources.getQuantityString(R.plurals.items, it, it)
|
||||
pref.summary = if (it < 0) {
|
||||
view.context.getString(R.string.loading_)
|
||||
} else {
|
||||
pref.context.resources.getQuantityString(R.plurals.items, it, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
findPreference<StorageUsagePreference>("storage_usage")?.let { pref ->
|
||||
|
||||
@@ -13,8 +13,9 @@ class MultiSummaryProvider(@StringRes private val emptySummaryId: Int) :
|
||||
return preference.context.getString(emptySummaryId)
|
||||
} else {
|
||||
values.joinToString(", ") {
|
||||
preference.entries[preference.findIndexOfValue(it)]
|
||||
preference.entries.getOrNull(preference.findIndexOfValue(it))
|
||||
?: preference.context.getString(androidx.preference.R.string.not_set)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user