adding some animations
This commit is contained in:
parent
0e07117b3a
commit
ab50b0b74a
5 changed files with 42 additions and 21 deletions
|
|
@ -247,6 +247,7 @@ class MainActivity : SimpleActivity() {
|
|||
conversations_list.adapter = this
|
||||
}
|
||||
|
||||
conversations_list.scheduleLayoutAnimation()
|
||||
conversations_fastscroller.setViews(conversations_list) {
|
||||
val listItem = (conversations_list.adapter as? ConversationsAdapter)?.conversations?.getOrNull(it)
|
||||
conversations_fastscroller.updateBubbleText(listItem?.title ?: "")
|
||||
|
|
|
|||
|
|
@ -138,24 +138,31 @@ class NewConversationActivity : SimpleActivity() {
|
|||
no_contacts_placeholder.text = getString(placeholderText)
|
||||
}
|
||||
|
||||
ContactsAdapter(this, contacts, contacts_list, null) {
|
||||
hideKeyboard()
|
||||
val contact = it as SimpleContact
|
||||
val phoneNumbers = contact.phoneNumbers
|
||||
if (phoneNumbers.size > 1) {
|
||||
val items = ArrayList<RadioItem>()
|
||||
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
||||
items.add(RadioItem(index, phoneNumber, phoneNumber))
|
||||
}
|
||||
val currAdapter = contacts_list.adapter
|
||||
if (currAdapter == null) {
|
||||
ContactsAdapter(this, contacts, contacts_list, null) {
|
||||
hideKeyboard()
|
||||
val contact = it as SimpleContact
|
||||
val phoneNumbers = contact.phoneNumbers
|
||||
if (phoneNumbers.size > 1) {
|
||||
val items = ArrayList<RadioItem>()
|
||||
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
||||
items.add(RadioItem(index, phoneNumber, phoneNumber))
|
||||
}
|
||||
|
||||
RadioGroupDialog(this, items) {
|
||||
launchThreadActivity(it as String, contact.name)
|
||||
RadioGroupDialog(this, items) {
|
||||
launchThreadActivity(it as String, contact.name)
|
||||
}
|
||||
} else {
|
||||
launchThreadActivity(phoneNumbers.first(), contact.name)
|
||||
}
|
||||
} else {
|
||||
launchThreadActivity(phoneNumbers.first(), contact.name)
|
||||
}.apply {
|
||||
contacts_list.adapter = this
|
||||
}
|
||||
}.apply {
|
||||
contacts_list.adapter = this
|
||||
|
||||
contacts_list.scheduleLayoutAnimation()
|
||||
} else {
|
||||
(currAdapter as ContactsAdapter).updateContacts(contacts)
|
||||
}
|
||||
|
||||
setupLetterFastscroller(contacts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue