add empty screen message
This commit is contained in:
parent
75378e5284
commit
b66faab71c
3 changed files with 9 additions and 2 deletions
|
@ -64,8 +64,13 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootAction, Injectable {
|
|||
Status.SUCCESS -> {
|
||||
progressBar.hide()
|
||||
swipeRefreshLayout.isRefreshing = false
|
||||
if(viewModel.data.value?.loadedCount == 0) {
|
||||
errorMessageView.setup(R.drawable.elephant_friend_empty, R.string.no_scheduled_status)
|
||||
errorMessageView.show()
|
||||
} else {
|
||||
errorMessageView.hide()
|
||||
}
|
||||
}
|
||||
Status.RUNNING -> {
|
||||
errorMessageView.hide()
|
||||
if(viewModel.data.value?.loadedCount ?: 0 > 0) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class BackgroundMessageView @JvmOverloads constructor(
|
|||
* If [clickListener] is `null` then the button will be hidden.
|
||||
*/
|
||||
fun setup(@DrawableRes imageRes: Int, @StringRes messageRes: Int,
|
||||
clickListener: ((v: View) -> Unit)?) {
|
||||
clickListener: ((v: View) -> Unit)? = null) {
|
||||
messageTextView.setText(messageRes)
|
||||
messageTextView.setCompoundDrawablesWithIntrinsicBounds(0, imageRes, 0, 0)
|
||||
button.setOnClickListener(clickListener)
|
||||
|
|
|
@ -545,4 +545,6 @@
|
|||
<string name="edit_poll">Edit</string>
|
||||
<string name="post_lookup_error_format">Error looking up post %s</string>
|
||||
|
||||
<string name="no_scheduled_status">You don\'t have any scheduled statuses.</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue