Fix issue #607 - Issue with fetchmore

maths
Thomas 2 years ago
parent a81f27faff
commit 886f066071

@ -634,7 +634,9 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
}
if (statusReply.spoiler_text != null) {
statusDraftList.get(0).spoiler_text = statusReply.spoiler_text;
statusDraftList.get(0).spoilerChecked = true;
if (statusReply.spoiler_text.trim().length() > 0) {
statusDraftList.get(0).spoilerChecked = true;
}
}
if (statusReply.language != null && !statusReply.language.isEmpty()) {
statusDraftList.get(0).language = statusReply.language;

@ -109,8 +109,8 @@ public class Status implements Serializable, Cloneable {
public Attachment art_attachment;
public boolean isExpended = false;
public boolean isTruncated = true;
public boolean isFetchMore = false;
public PositionFetchMore positionFetchMore = PositionFetchMore.BOTTOM;
public transient boolean isFetchMore = false;
public transient PositionFetchMore positionFetchMore = PositionFetchMore.BOTTOM;
public boolean isChecked = false;
public String translationContent;
public boolean translationShown;

@ -2031,7 +2031,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
drawerFetchMoreBinding.fetchMoreMin.setOnClickListener(v -> {
status.isFetchMore = false;
int position = holder.getBindingAdapterPosition();
int position2 = getStatusPosition(statusList, status);
adapter.notifyItemChanged(position);
if (position < statusList.size() - 1) {
String fromId;

@ -407,7 +407,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
binding.swipeContainer.setRefreshing(false);
binding.loadingNextElements.setVisibility(View.GONE);
flagLoading = false;
int currentPosition = mLayoutManager.findFirstVisibleItemPosition();
if (timelineStatuses != null && fetched_statuses != null && fetched_statuses.statuses != null && fetched_statuses.statuses.size() > 0) {
try {
if (statusToUpdate != null) {
@ -470,7 +470,10 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
update.onUpdate(0, timelineType, slug);
}
if (direction == DIRECTION.TOP && fetchingMissing) {
binding.recyclerView.scrollToPosition(getPosition(fetched_statuses.statuses.get(fetched_statuses.statuses.size() - 1)) + 1);
int newPosition = currentPosition + fetched_statuses.statuses.size() + 1;
if (newPosition < timelineStatuses.size()) {
binding.recyclerView.scrollToPosition(newPosition);
}
}
if (!fetchingMissing) {
if (fetched_statuses.pagination.max_id == null) {

Loading…
Cancel
Save