mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 10:11:58 +00:00
fix snackbar display
This commit is contained in:
parent
ded2e1db86
commit
d4a5275aa4
2 changed files with 20 additions and 6 deletions
|
|
@ -259,10 +259,16 @@ fun PartyInviteView(
|
|||
inviteButtonState = LoadingButtonState.CONTENT
|
||||
}
|
||||
}) {
|
||||
viewModel.sendInvites()
|
||||
inviteButtonState = LoadingButtonState.SUCCESS
|
||||
delay(2.toDuration(DurationUnit.SECONDS))
|
||||
dismiss()
|
||||
val responses = viewModel.sendInvites()
|
||||
if ((responses?.size ?: 0) > 0) {
|
||||
inviteButtonState = LoadingButtonState.SUCCESS
|
||||
delay(2.toDuration(DurationUnit.SECONDS))
|
||||
dismiss()
|
||||
} else {
|
||||
inviteButtonState = LoadingButtonState.FAILED
|
||||
delay(2.toDuration(DurationUnit.SECONDS))
|
||||
inviteButtonState = LoadingButtonState.CONTENT
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -251,10 +251,18 @@ private constructor(parent: ViewGroup, content: View, callback: ContentViewCallb
|
|||
duration: Int = Snackbar.LENGTH_LONG
|
||||
) {
|
||||
val snackbar = make(container, duration)
|
||||
.setTitle(title)
|
||||
.setText(content)
|
||||
.setSpecialView(specialView)
|
||||
.setLeftIcon(leftImage)
|
||||
if (title?.isNotBlank() == true) {
|
||||
snackbar.setTitle(title)
|
||||
}
|
||||
if (content?.isNotBlank() == true) {
|
||||
if (title?.isNotBlank() != true) {
|
||||
snackbar.setTitle(content)
|
||||
} else {
|
||||
snackbar.setText(content)
|
||||
}
|
||||
}
|
||||
rightTextColor?.let {
|
||||
snackbar.setRightDiff(rightIcon, rightTextColor, rightText)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue