Browse Source

Possible fix for Tmp detached view error. Fixes austinhuang0131/barinsta#1200

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
1c5bdb1cca
  1. 6
      app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageInboxFragment.java

6
app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageInboxFragment.java

@ -96,7 +96,7 @@ public class DirectMessageInboxFragment extends Fragment implements SwipeRefresh
} }
} }
@SuppressLint("UnsafeExperimentalUsageError")
@SuppressLint({"UnsafeExperimentalUsageError", "UnsafeOptInUsageError"})
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
@ -176,7 +176,7 @@ public class DirectMessageInboxFragment extends Fragment implements SwipeRefresh
if (inboxAdapter == null) return; if (inboxAdapter == null) return;
inboxAdapter.submitList(list, () -> { inboxAdapter.submitList(list, () -> {
if (!scrollToTop) return; if (!scrollToTop) return;
binding.inboxList.smoothScrollToPosition(0);
binding.inboxList.post(() -> binding.inboxList.smoothScrollToPosition(0));
scrollToTop = false; scrollToTop = false;
}); });
}; };
@ -204,7 +204,7 @@ public class DirectMessageInboxFragment extends Fragment implements SwipeRefresh
viewModel.getPendingRequestsTotal().observe(getViewLifecycleOwner(), this::attachPendingRequestsBadge); viewModel.getPendingRequestsTotal().observe(getViewLifecycleOwner(), this::attachPendingRequestsBadge);
} }
@SuppressLint("UnsafeExperimentalUsageError")
@SuppressLint({"UnsafeExperimentalUsageError", "UnsafeOptInUsageError"})
private void attachPendingRequestsBadge(@Nullable final Integer count) { private void attachPendingRequestsBadge(@Nullable final Integer count) {
if (pendingRequestsMenuItem == null) { if (pendingRequestsMenuItem == null) {
final Handler handler = new Handler(); final Handler handler = new Handler();

Loading…
Cancel
Save