fix crash in AccountMediaFragment (again)

main
Conny Duck 6 years ago
parent f8423aa10b
commit e6270f1a5e
  1. 6
      app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt

@ -36,6 +36,7 @@ import com.keylesspalace.tusky.entity.Attachment
import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.network.MastodonApi
import com.keylesspalace.tusky.util.ThemeUtils
import com.keylesspalace.tusky.util.visible
import com.keylesspalace.tusky.view.SquareImageView
import com.keylesspalace.tusky.viewdata.AttachmentViewData
import com.squareup.picasso.Picasso
@ -92,7 +93,7 @@ class AccountMediaFragment : BaseFragment(), Injectable {
if(isAdded) {
swipe_refresh_layout.isRefreshing = false
progress_bar.visibility = View.GONE
}
val body = response.body()
body?.let { fetched ->
statuses.addAll(0, fetched)
@ -102,7 +103,8 @@ class AccountMediaFragment : BaseFragment(), Injectable {
result.addAll(AttachmentViewData.list(status))
}
adapter.addTop(result)
nothing_message.visibility = if (statuses.isEmpty()) View.VISIBLE else View.GONE
nothing_message.visible(statuses.isEmpty())
}
}
}
}

Loading…
Cancel
Save