forked from grishka/Houseclub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add funkcionality: show mutual followers
- Loading branch information
1 parent
e507c4f
commit 7331f11
Showing
5 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Houseclub/src/main/java/me/grishka/houseclub/api/methods/GetMutualFollowers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.grishka.houseclub.api.methods; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
import me.grishka.houseclub.api.ClubhouseAPIRequest; | ||
import me.grishka.houseclub.api.model.FullUser; | ||
|
||
public class GetMutualFollowers extends ClubhouseAPIRequest<GetMutualFollowers.Response>{ | ||
public GetMutualFollowers(int userID, int pageSize, int page){ | ||
super("GET", "get_mutual_follows", Response.class); | ||
queryParams=new HashMap<>(); | ||
queryParams.put("user_id", userID+""); | ||
queryParams.put("page_size", pageSize+""); | ||
queryParams.put("page", page+""); | ||
} | ||
|
||
public static class Response{ | ||
public List<FullUser> users; | ||
public int count; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Houseclub/src/main/java/me/grishka/houseclub/fragments/MutualFollowersFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package me.grishka.houseclub.fragments; | ||
|
||
import android.app.Activity; | ||
|
||
import me.grishka.appkit.api.SimpleCallback; | ||
import me.grishka.houseclub.R; | ||
import me.grishka.houseclub.api.methods.GetMutualFollowers; | ||
|
||
public class MutualFollowersFragment extends UserListFragment{ | ||
|
||
@Override | ||
public void onAttach(Activity activity){ | ||
super.onAttach(activity); | ||
setTitle(R.string.mutual_followers_title); | ||
} | ||
|
||
@Override | ||
protected void doLoadData(int offset, int count){ | ||
currentRequest=new GetMutualFollowers(getArguments().getInt("id"), 50, offset/50+1) | ||
.setCallback(new SimpleCallback<GetMutualFollowers.Response>(this){ | ||
@Override | ||
public void onSuccess(GetMutualFollowers.Response result){ | ||
currentRequest=null; | ||
onDataLoaded(result.users, data.size()+preloadedData.size()+result.users.size()<result.count); | ||
} | ||
}) | ||
.exec(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters