add empty screen message
This commit is contained in:
parent
75378e5284
commit
b66faab71c
|
@ -64,7 +64,12 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootAction, Injectable {
|
|||
Status.SUCCESS -> {
|
||||
progressBar.hide()
|
||||
swipeRefreshLayout.isRefreshing = false
|
||||
errorMessageView.hide()
|
||||
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()
|
||||
|
|
|
@ -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 New Issue