1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-25 08:07:29 +00:00
This commit is contained in:
Ammar Githam 2021-04-09 19:57:56 +09:00
parent 1c1e5f0654
commit 977ccce22c

View File

@ -414,10 +414,14 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
case SUCCESS: case SUCCESS:
Toast.makeText(context, R.string.marked_as_seen, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.marked_as_seen, Toast.LENGTH_SHORT).show();
case LOADING: case LOADING:
if (item != null) {
item.setEnabled(false); item.setEnabled(false);
}
break; break;
case ERROR: case ERROR:
if (item != null) {
item.setEnabled(true); item.setEnabled(true);
}
if (resource.message != null) { if (resource.message != null) {
Snackbar.make(context, binding.getRoot(), resource.message, Snackbar.LENGTH_LONG).show(); Snackbar.make(context, binding.getRoot(), resource.message, Snackbar.LENGTH_LONG).show();
return; return;
@ -956,7 +960,9 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
} }
final DirectThread thread = threadLiveData.getValue(); final DirectThread thread = threadLiveData.getValue();
if (thread == null) return; if (thread == null) return;
if (markAsSeenMenuItem != null) {
markAsSeenMenuItem.setEnabled(!DMUtils.isRead(thread)); markAsSeenMenuItem.setEnabled(!DMUtils.isRead(thread));
}
}); });
if (itemsAdapter == null) return; if (itemsAdapter == null) return;
itemsAdapter.submitList(items, () -> { itemsAdapter.submitList(items, () -> {