Skip to content

Commit

Permalink
fixed timeline loading, gradle dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearfog committed Oct 1, 2024
1 parent 1b1c334 commit 0646550
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ android {

dependencies {
//noinspection GradleDependency
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.cardview:cardview:1.0.0'
Expand All @@ -76,8 +76,8 @@ dependencies {
implementation 'com.kyleduo.switchbutton:library:2.1.0'
implementation 'com.github.UnifiedPush:android-connector:2.1.1'
//noinspection GradleDependency
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'jp.wasabeef:picasso-transformations:2.4.0'
implementation 'net.danlew:android.joda:2.12.7'
implementation 'org.jsoup:jsoup:1.17.2'
implementation 'net.danlew:android.joda:2.13.0'
implementation 'org.jsoup:jsoup:1.18.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -1592,16 +1592,23 @@ private Statuses getStatuses(String endpoint, long minId, long maxId) throws Mas
* @return status timeline
*/
private Statuses getStatuses(String endpoint, long minId, long maxId, List<String> params) throws MastodonException {
if (minId != 0L)
params.add("min_id=" + minId);
if (maxId != 0L)
params.add("max_id=" + maxId);
params.add("limit=" + settings.getListSize());
try {
Statuses result = createStatuses(get(endpoint, params));
// posts from reply endpoint should not be sorted
if (result.size() > 1 && !endpoint.endsWith("/context"))
if (result.size() > 1 && !endpoint.endsWith("/context")) {
Collections.sort(result);
// alternative to min_id parameter: filtering all posts below min_id
// to get the most recent posts first, instead of scrolling to top
for (int i = result.size() - 1; i >= 0; i--) {
Status item = result.get(i);
if (item != null && item.getId() <= minId) {
result.remove(i);
}
}
}
return result;
} catch (IOException e) {
throw new MastodonException(e);
Expand Down

0 comments on commit 0646550

Please sign in to comment.