|
|
@ -314,7 +314,6 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
|
|
|
mLayoutManager = new LinearLayoutManager(requireActivity());
|
|
|
|
mLayoutManager = new LinearLayoutManager(requireActivity());
|
|
|
|
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
|
|
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
|
|
binding.recyclerView.setAdapter(notificationAdapter);
|
|
|
|
binding.recyclerView.setAdapter(notificationAdapter);
|
|
|
|
|
|
|
|
|
|
|
|
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
|
|
binding.recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
|
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
|
@ -390,7 +389,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
|
|
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
|
|
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
|
|
|
boolean useCache = sharedpreferences.getBoolean(getString(R.string.SET_USE_CACHE), true);
|
|
|
|
boolean useCache = sharedpreferences.getBoolean(getString(R.string.SET_USE_CACHE), true);
|
|
|
|
|
|
|
|
|
|
|
|
TimelinesVM.TimelineParams timelineParams = new TimelinesVM.TimelineParams(Timeline.TimeLineEnum.NOTIFICATION, direction, null);
|
|
|
|
TimelinesVM.TimelineParams timelineParams = new TimelinesVM.TimelineParams(requireActivity(), Timeline.TimeLineEnum.NOTIFICATION, direction, null);
|
|
|
|
timelineParams.limit = MastodonHelper.notificationsPerCall(requireActivity());
|
|
|
|
timelineParams.limit = MastodonHelper.notificationsPerCall(requireActivity());
|
|
|
|
if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH || direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) {
|
|
|
|
if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH || direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) {
|
|
|
|
timelineParams.maxId = null;
|
|
|
|
timelineParams.maxId = null;
|
|
|
@ -406,6 +405,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
|
|
|
}
|
|
|
|
}
|
|
|
|
timelineParams.excludeType = getExcludeType();
|
|
|
|
timelineParams.excludeType = getExcludeType();
|
|
|
|
timelineParams.fetchingMissing = fetchingMissing;
|
|
|
|
timelineParams.fetchingMissing = fetchingMissing;
|
|
|
|
|
|
|
|
|
|
|
|
if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) {
|
|
|
|
if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) {
|
|
|
|
getCachedNotifications(direction, fetchingMissing, timelineParams);
|
|
|
|
getCachedNotifications(direction, fetchingMissing, timelineParams);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|