mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-01-07 00:20:08 +02:00
Fix error message when adding the first list
This commit is contained in:
parent
4f8377d9d9
commit
9c728f24c3
1 changed files with 8 additions and 1 deletions
|
@ -279,8 +279,15 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
|||
if (mastodonListList == null) {
|
||||
mastodonListList = new ArrayList<>();
|
||||
}
|
||||
if (newMastodonList != null && mastodonListAdapter != null) {
|
||||
if (newMastodonList != null) {
|
||||
mastodonListList.add(0, newMastodonList);
|
||||
if (mastodonListAdapter == null) {
|
||||
mastodonListAdapter = new MastodonListAdapter(mastodonListList);
|
||||
mastodonListAdapter.actionOnList = MastodonListActivity.this;
|
||||
binding.notContent.setVisibility(View.GONE);
|
||||
binding.recyclerView.setAdapter(mastodonListAdapter);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(MastodonListActivity.this));
|
||||
}
|
||||
mastodonListAdapter.notifyItemInserted(0);
|
||||
} else {
|
||||
Toasty.error(MastodonListActivity.this, getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
|
||||
|
|
Loading…
Reference in a new issue