|
@ -337,6 +337,12 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre |
|
|
return super.onOptionsItemSelected(item); |
|
|
return super.onOptionsItemSelected(item); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onResume() { |
|
|
|
|
|
super.onResume(); |
|
|
|
|
|
binding.getRoot().postDelayed(feedStoriesAdapter::notifyDataSetChanged, 1000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onRefresh() { |
|
|
public void onRefresh() { |
|
|
binding.feedRecyclerView.refresh(); |
|
|
binding.feedRecyclerView.refresh(); |
|
@ -418,15 +424,16 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void fetchStories() { |
|
|
private void fetchStories() { |
|
|
|
|
|
if (storiesFetching) return; |
|
|
// final String cookie = settingsHelper.getString(Constants.COOKIE); |
|
|
// final String cookie = settingsHelper.getString(Constants.COOKIE); |
|
|
storiesFetching = true; |
|
|
storiesFetching = true; |
|
|
updateSwipeRefreshState(); |
|
|
updateSwipeRefreshState(); |
|
|
storiesService.getFeedStories(new ServiceCallback<List<FeedStoryModel>>() { |
|
|
storiesService.getFeedStories(new ServiceCallback<List<FeedStoryModel>>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onSuccess(final List<FeedStoryModel> result) { |
|
|
public void onSuccess(final List<FeedStoryModel> result) { |
|
|
|
|
|
storiesFetching = false; |
|
|
feedStoriesViewModel.getList().postValue(result); |
|
|
feedStoriesViewModel.getList().postValue(result); |
|
|
feedStoriesAdapter.submitList(result); |
|
|
feedStoriesAdapter.submitList(result); |
|
|
storiesFetching = false; |
|
|
|
|
|
if (storyListMenu != null) storyListMenu.setVisible(true); |
|
|
if (storyListMenu != null) storyListMenu.setVisible(true); |
|
|
updateSwipeRefreshState(); |
|
|
updateSwipeRefreshState(); |
|
|
} |
|
|
} |
|
|