fix crash in AccountMediaFragment (again)

This commit is contained in:
Conny Duck 2018-07-09 08:59:06 +02:00
parent fbafdf8dc3
commit 4df93c49cb
1 changed files with 12 additions and 10 deletions

View File

@ -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())
}
}
}
}