add empty screen message
This commit is contained in:
parent
75378e5284
commit
b66faab71c
3 changed files with 9 additions and 2 deletions
|
@ -64,7 +64,12 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootAction, Injectable {
|
||||||
Status.SUCCESS -> {
|
Status.SUCCESS -> {
|
||||||
progressBar.hide()
|
progressBar.hide()
|
||||||
swipeRefreshLayout.isRefreshing = false
|
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 -> {
|
Status.RUNNING -> {
|
||||||
errorMessageView.hide()
|
errorMessageView.hide()
|
||||||
|
|
|
@ -37,7 +37,7 @@ class BackgroundMessageView @JvmOverloads constructor(
|
||||||
* If [clickListener] is `null` then the button will be hidden.
|
* If [clickListener] is `null` then the button will be hidden.
|
||||||
*/
|
*/
|
||||||
fun setup(@DrawableRes imageRes: Int, @StringRes messageRes: Int,
|
fun setup(@DrawableRes imageRes: Int, @StringRes messageRes: Int,
|
||||||
clickListener: ((v: View) -> Unit)?) {
|
clickListener: ((v: View) -> Unit)? = null) {
|
||||||
messageTextView.setText(messageRes)
|
messageTextView.setText(messageRes)
|
||||||
messageTextView.setCompoundDrawablesWithIntrinsicBounds(0, imageRes, 0, 0)
|
messageTextView.setCompoundDrawablesWithIntrinsicBounds(0, imageRes, 0, 0)
|
||||||
button.setOnClickListener(clickListener)
|
button.setOnClickListener(clickListener)
|
||||||
|
|
|
@ -545,4 +545,6 @@
|
||||||
<string name="edit_poll">Edit</string>
|
<string name="edit_poll">Edit</string>
|
||||||
<string name="post_lookup_error_format">Error looking up post %s</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>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue