Filter saved posts

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
Balazs Toldi 2023-07-26 21:45:10 +02:00
parent 1f3d9e58d8
commit b82e4d9d37
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
3 changed files with 2 additions and 5 deletions

View File

@ -45,14 +45,10 @@ import eu.toldi.infinityforlemmy.post.PostPagingSource;
import eu.toldi.infinityforlemmy.readpost.InsertReadPost; import eu.toldi.infinityforlemmy.readpost.InsertReadPost;
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils; import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
import eu.toldi.infinityforlemmy.utils.Utils; import eu.toldi.infinityforlemmy.utils.Utils;
import retrofit2.Retrofit;
public class AccountSavedThingActivity extends BaseActivity implements ActivityToolbarInterface, public class AccountSavedThingActivity extends BaseActivity implements ActivityToolbarInterface,
PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, MarkPostAsReadInterface { PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, MarkPostAsReadInterface {
@Inject
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject @Inject
RedditDataRoomDatabase mRedditDataRoomDatabase; RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject @Inject

View File

@ -34,6 +34,7 @@ public interface LemmyAPI {
@Query("sort") String sort, @Query("sort") String sort,
@Query("page") Integer page, @Query("page") Integer page,
@Query("limit") Integer limit, @Query("limit") Integer limit,
@Query("saved_only") Boolean saved_only,
@Query("auth") String access_token); @Query("auth") String access_token);
@GET("api/v3/community/list") @GET("api/v3/community/list")

View File

@ -252,7 +252,7 @@ public class PostPagingSource extends ListenableFuturePagingSource<Integer, Post
private ListenableFuture<LoadResult<Integer, Post>> loadUserPosts(@NonNull LoadParams<Integer> loadParams, LemmyAPI api) { private ListenableFuture<LoadResult<Integer, Post>> loadUserPosts(@NonNull LoadParams<Integer> loadParams, LemmyAPI api) {
ListenableFuture<Response<String>> userPosts; ListenableFuture<Response<String>> userPosts;
userPosts = api.getUserPosts(subredditOrUserName, sortType.getType().value,loadParams.getKey(),25,accessToken); userPosts = api.getUserPosts(subredditOrUserName, sortType.getType().value, loadParams.getKey(), 25, userWhere.equals(USER_WHERE_SAVED), accessToken);
ListenableFuture<LoadResult<Integer, Post>> pageFuture = Futures.transform(userPosts, this::transformData, executor); ListenableFuture<LoadResult<Integer, Post>> pageFuture = Futures.transform(userPosts, this::transformData, executor);