Last active
June 12, 2018 11:53
-
-
Save alexstyl/a4528e5ab5b254cf6de66eefef940643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun summaryViewModelOf(viewModels: List<ContactEventNotificationViewModel>): SummaryNotificationViewModel { | |
val title = NaturalLanguageUtils.joinContacts(strings, contacts, MAX_CONTACTS) | |
val label = strings.dontForgetToSendWishes() | |
val lines = arrayListOf<CharSequence>() | |
viewModels.forEach { contactViewModel -> | |
val boldedTitle = SpannableString("${contactViewModel.title}\t\t${contactViewModel.label}").apply { | |
setSpan(StyleSpan(Typeface.BOLD), 0, contactViewModel.title.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) | |
} | |
lines.add(boldedTitle) | |
} | |
return SummaryNotificationViewModel( | |
NotificationConstants.NOTIFICATION_ID_CONTACTS_SUMMARY, | |
title, label, lines | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment