summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2022-07-07 14:38:24 +0200
committerThomas <tschneider.ac@gmail.com>2022-07-07 14:38:24 +0200
commitb8addbc3f14c54467f7cd3df610bda8918e569c1 (patch)
tree82428fdb4a0902642c629995cc281d24b4022e78
parent0ef660240888b0b905e6cd1d1f215e002a549cdf (diff)
Some fixes
-rw-r--r--.gitignore2
-rw-r--r--app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java2
-rw-r--r--app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java6
3 files changed, 7 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 6de4017ff..18d1198a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,5 @@
local.properties
/cropper/build/
/build/
+/app/fdroid/release/
+/app/playstore/release/
diff --git a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java
index 28375c1e4..61586270a 100644
--- a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java
+++ b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java
@@ -170,7 +170,7 @@ public class PinnedTimelineHelper {
name = pinnedTimeline.mastodonList.title;
break;
case TAG:
- name = pinnedTimeline.tagTimeline.name;
+ name = pinnedTimeline.tagTimeline.name.replaceAll("#", "");
break;
case REMOTE:
name = pinnedTimeline.remoteInstance.host;
diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java
index 974dbba5b..6d3f97c3a 100644
--- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java
+++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java
@@ -453,9 +453,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
insertedPosition = insertStatus(statusReceived);
if (insertedPosition != STATUS_PRESENT && insertedPosition != STATUS_AT_THE_BOTTOM) {
numberInserted++;
+ //Find the first position of insertion, the initial id is set to STATUS_PRESENT
if (initialInsertedPosition == STATUS_PRESENT) {
initialInsertedPosition = insertedPosition;
}
+ //If next statuses have a lower id, there are inserted before (normally, that should not happen)
if (insertedPosition < initialInsertedPosition) {
initialInsertedPosition = lastInsertedPosition;
}
@@ -464,7 +466,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
lastInsertedPosition = initialInsertedPosition + numberInserted;
//lastInsertedPosition contains the position of the last inserted 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();
statusFetchMore.isFetchMore = true;
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
* @return int >= 0 | STATUS_PRESENT = -1 | STATUS_AT_THE_BOTTOM = -2