mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-30 08:25:01 +01:00
fixed #346
This commit is contained in:
parent
038f16cbc8
commit
aee2e0d049
@ -259,9 +259,9 @@ public abstract class AbsActivitiesFragment<Data> extends AbsContentListRecycler
|
||||
} else {
|
||||
lastVisiblePos = layoutManager.findFirstVisibleItemPosition();
|
||||
}
|
||||
final int activityStartIndex = adapter.getActivityStartIndex();
|
||||
final int activityEndIndex = activityStartIndex + adapter.getActivityCount();
|
||||
if (lastVisiblePos != RecyclerView.NO_POSITION && lastVisiblePos < adapter.getItemCount()) {
|
||||
final int activityStartIndex = adapter.getActivityStartIndex();
|
||||
final int activityEndIndex = activityStartIndex + adapter.getActivityCount();
|
||||
final int lastItemIndex = Math.min(activityEndIndex, lastVisiblePos);
|
||||
lastReadId = adapter.getTimestamp(lastItemIndex);
|
||||
final View positionView = layoutManager.findViewByPosition(lastItemIndex);
|
||||
@ -275,6 +275,8 @@ public abstract class AbsActivitiesFragment<Data> extends AbsContentListRecycler
|
||||
}
|
||||
adapter.setData(data);
|
||||
setRefreshEnabled(true);
|
||||
final int activityStartIndex = adapter.getActivityStartIndex();
|
||||
final int activityEndIndex = activityStartIndex + adapter.getActivityCount();
|
||||
if (!(loader instanceof IExtendedLoader) || ((IExtendedLoader) loader).isFromUser()) {
|
||||
adapter.setLoadMoreSupportedPosition(hasMoreData(data) ? IndicatorPosition.END : IndicatorPosition.NONE);
|
||||
int pos = -1;
|
||||
|
@ -269,9 +269,9 @@ public abstract class AbsStatusesFragment<Data> extends AbsContentListRecyclerVi
|
||||
} else {
|
||||
lastVisiblePos = layoutManager.findFirstVisibleItemPosition();
|
||||
}
|
||||
final int statusStartIndex = adapter.getStatusStartIndex();
|
||||
final int statusEndIndex = statusStartIndex + adapter.getStatusCount();
|
||||
if (lastVisiblePos != RecyclerView.NO_POSITION && lastVisiblePos < adapter.getItemCount()) {
|
||||
final int statusStartIndex = adapter.getStatusStartIndex();
|
||||
final int statusEndIndex = statusStartIndex + adapter.getStatusCount();
|
||||
final int lastItemIndex = Math.min(statusEndIndex, lastVisiblePos);
|
||||
lastReadId = adapter.getStatusId(lastItemIndex);
|
||||
final View positionView = layoutManager.findViewByPosition(lastItemIndex);
|
||||
@ -285,6 +285,8 @@ public abstract class AbsStatusesFragment<Data> extends AbsContentListRecyclerVi
|
||||
}
|
||||
adapter.setData(data);
|
||||
setRefreshEnabled(true);
|
||||
final int statusStartIndex = adapter.getStatusStartIndex();
|
||||
final int statusEndIndex = statusStartIndex + adapter.getStatusCount();
|
||||
if (!(loader instanceof IExtendedLoader) || ((IExtendedLoader) loader).isFromUser()) {
|
||||
adapter.setLoadMoreSupportedPosition(hasMoreData(data) ? IndicatorPosition.END : IndicatorPosition.NONE);
|
||||
int pos = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user