mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 00:30:03 +02:00
Some fixes
This commit is contained in:
parent
0ef6602408
commit
b8addbc3f1
3 changed files with 7 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,3 +10,5 @@
|
||||||
local.properties
|
local.properties
|
||||||
/cropper/build/
|
/cropper/build/
|
||||||
/build/
|
/build/
|
||||||
|
/app/fdroid/release/
|
||||||
|
/app/playstore/release/
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class PinnedTimelineHelper {
|
||||||
name = pinnedTimeline.mastodonList.title;
|
name = pinnedTimeline.mastodonList.title;
|
||||||
break;
|
break;
|
||||||
case TAG:
|
case TAG:
|
||||||
name = pinnedTimeline.tagTimeline.name;
|
name = pinnedTimeline.tagTimeline.name.replaceAll("#", "");
|
||||||
break;
|
break;
|
||||||
case REMOTE:
|
case REMOTE:
|
||||||
name = pinnedTimeline.remoteInstance.host;
|
name = pinnedTimeline.remoteInstance.host;
|
||||||
|
|
|
@ -453,9 +453,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
insertedPosition = insertStatus(statusReceived);
|
insertedPosition = insertStatus(statusReceived);
|
||||||
if (insertedPosition != STATUS_PRESENT && insertedPosition != STATUS_AT_THE_BOTTOM) {
|
if (insertedPosition != STATUS_PRESENT && insertedPosition != STATUS_AT_THE_BOTTOM) {
|
||||||
numberInserted++;
|
numberInserted++;
|
||||||
|
//Find the first position of insertion, the initial id is set to STATUS_PRESENT
|
||||||
if (initialInsertedPosition == STATUS_PRESENT) {
|
if (initialInsertedPosition == STATUS_PRESENT) {
|
||||||
initialInsertedPosition = insertedPosition;
|
initialInsertedPosition = insertedPosition;
|
||||||
}
|
}
|
||||||
|
//If next statuses have a lower id, there are inserted before (normally, that should not happen)
|
||||||
if (insertedPosition < initialInsertedPosition) {
|
if (insertedPosition < initialInsertedPosition) {
|
||||||
initialInsertedPosition = lastInsertedPosition;
|
initialInsertedPosition = lastInsertedPosition;
|
||||||
}
|
}
|
||||||
|
@ -464,7 +466,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
lastInsertedPosition = initialInsertedPosition + numberInserted;
|
lastInsertedPosition = initialInsertedPosition + numberInserted;
|
||||||
//lastInsertedPosition contains the position of the last inserted status
|
//lastInsertedPosition contains the position of the last inserted status
|
||||||
//If there were no overlap for top status
|
//If there were no overlap for top status
|
||||||
if (fetchingMissing && insertedPosition != STATUS_PRESENT && insertedPosition != STATUS_AT_THE_BOTTOM && this.statuses.size() > insertedPosition) {
|
if (fetchingMissing && insertedPosition != STATUS_PRESENT && insertedPosition != STATUS_AT_THE_BOTTOM && this.statuses.size() > insertedPosition && numberInserted == MastodonHelper.statusesPerCall(requireActivity())) {
|
||||||
Status statusFetchMore = new Status();
|
Status statusFetchMore = new Status();
|
||||||
statusFetchMore.isFetchMore = true;
|
statusFetchMore.isFetchMore = true;
|
||||||
statusFetchMore.id = Helper.generateString();
|
statusFetchMore.id = Helper.generateString();
|
||||||
|
@ -485,7 +487,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a status if not yet in the timeline
|
* Insert a status if not yet in the timeline and returns its position of insertion
|
||||||
*
|
*
|
||||||
* @param statusReceived - Status coming from the api/db
|
* @param statusReceived - Status coming from the api/db
|
||||||
* @return int >= 0 | STATUS_PRESENT = -1 | STATUS_AT_THE_BOTTOM = -2
|
* @return int >= 0 | STATUS_PRESENT = -1 | STATUS_AT_THE_BOTTOM = -2
|
||||||
|
|
Loading…
Reference in a new issue