mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-08 07:57:28 +00:00
Fix feed stories not rendered if app goes in background immediately after startup. Fixes austinhuang0131/barinsta#1258
This commit is contained in:
parent
7797ca3205
commit
1e94c73e10
@ -337,6 +337,12 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
binding.getRoot().postDelayed(feedStoriesAdapter::notifyDataSetChanged, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
binding.feedRecyclerView.refresh();
|
||||
@ -418,15 +424,16 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre
|
||||
}
|
||||
|
||||
private void fetchStories() {
|
||||
if (storiesFetching) return;
|
||||
// final String cookie = settingsHelper.getString(Constants.COOKIE);
|
||||
storiesFetching = true;
|
||||
updateSwipeRefreshState();
|
||||
storiesService.getFeedStories(new ServiceCallback<List<FeedStoryModel>>() {
|
||||
@Override
|
||||
public void onSuccess(final List<FeedStoryModel> result) {
|
||||
storiesFetching = false;
|
||||
feedStoriesViewModel.getList().postValue(result);
|
||||
feedStoriesAdapter.submitList(result);
|
||||
storiesFetching = false;
|
||||
if (storyListMenu != null) storyListMenu.setVisible(true);
|
||||
updateSwipeRefreshState();
|
||||
}
|
||||
|
@ -10,11 +10,11 @@
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toTopOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/privatePage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="@dimen/private_page_margins"
|
||||
android:id="@+id/privatePage"
|
||||
android:visibility="visible"
|
||||
motion:layout_constraintTop_toBottomOf="@+id/header" />
|
||||
</ConstraintSet>
|
||||
<ConstraintSet android:id="@+id/end">
|
||||
|
Loading…
Reference in New Issue
Block a user