Small code improvements
Removed some non-translatable strings and just hardcoded them in the code, like it's being done for other string separators. This also deduplicates some code by using Localization. Used some Kotlin feature to reduce code.
This commit is contained in:
parent
a4f3b3b105
commit
2a4add2571
6 changed files with 18 additions and 32 deletions
|
|
@ -108,13 +108,7 @@ class NotificationsSettingsFragment : BasePreferenceFragment(), OnSharedPreferen
|
|||
private fun updateSubscriptions(subscriptions: List<SubscriptionEntity>) {
|
||||
val notified = subscriptions.count { it.notificationMode != NotificationMode.DISABLED }
|
||||
val preference = findPreference<Preference>(getString(R.string.streams_notifications_channels_key))
|
||||
if (preference != null) {
|
||||
preference.summary = preference.context.getString(
|
||||
R.string.streams_notifications_channels_summary,
|
||||
notified,
|
||||
subscriptions.size
|
||||
)
|
||||
}
|
||||
preference?.apply { summary = "$notified/${subscriptions.size}" }
|
||||
}
|
||||
|
||||
private fun onError(e: Throwable) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue