mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Add interactions call to APIManager.
This commit is contained in:
parent
10fc3c6e8e
commit
0734d31ab6
3 changed files with 22 additions and 3 deletions
|
@ -29,7 +29,6 @@ public class ProfileDetailsFragment extends Fragment implements OnClickListener
|
||||||
private TextView username, bio, location, sharedCount, followerCount, followingCount, website;
|
private TextView username, bio, location, sharedCount, followerCount, followingCount, website;
|
||||||
private View locationIcon;
|
private View locationIcon;
|
||||||
private ImageView imageView;
|
private ImageView imageView;
|
||||||
private String noBio, noLocation;
|
|
||||||
private boolean viewingSelf = false;
|
private boolean viewingSelf = false;
|
||||||
private ImageLoader imageLoader;
|
private ImageLoader imageLoader;
|
||||||
private Button followButton, unfollowButton;
|
private Button followButton, unfollowButton;
|
||||||
|
@ -38,8 +37,6 @@ public class ProfileDetailsFragment extends Fragment implements OnClickListener
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
noBio = getString(R.string.profile_no_bio);
|
|
||||||
noLocation = getActivity().getResources().getString(R.string.profile_no_location);
|
|
||||||
imageLoader = ((NewsBlurApplication) getActivity().getApplicationContext()).getImageLoader();
|
imageLoader = ((NewsBlurApplication) getActivity().getApplicationContext()).getImageLoader();
|
||||||
apiManager = new APIManager(getActivity());
|
apiManager = new APIManager(getActivity());
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.newsblur.domain.Story;
|
||||||
import com.newsblur.domain.ValueMultimap;
|
import com.newsblur.domain.ValueMultimap;
|
||||||
import com.newsblur.network.domain.ActivitiesResponse;
|
import com.newsblur.network.domain.ActivitiesResponse;
|
||||||
import com.newsblur.network.domain.FeedFolderResponse;
|
import com.newsblur.network.domain.FeedFolderResponse;
|
||||||
|
import com.newsblur.network.domain.InteractionsResponse;
|
||||||
import com.newsblur.network.domain.NewsBlurResponse;
|
import com.newsblur.network.domain.NewsBlurResponse;
|
||||||
import com.newsblur.network.domain.ProfileResponse;
|
import com.newsblur.network.domain.ProfileResponse;
|
||||||
import com.newsblur.network.domain.RegisterResponse;
|
import com.newsblur.network.domain.RegisterResponse;
|
||||||
|
@ -452,6 +453,20 @@ public class APIManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InteractionsResponse getInteractions(String userId, int pageNumber) {
|
||||||
|
final ContentValues values = new ContentValues();
|
||||||
|
values.put(APIConstants.PARAMETER_USER_ID, userId);
|
||||||
|
values.put(APIConstants.PARAMETER_LIMIT, "10");
|
||||||
|
values.put(APIConstants.PARAMETER_PAGE_NUMBER, Integer.toString(pageNumber));
|
||||||
|
final APIResponse response = get(APIConstants.URL_USER_INTERACTIONS, values);
|
||||||
|
if (!response.isError()) {
|
||||||
|
InteractionsResponse interactionsResponse = (InteractionsResponse) response.getResponse(gson, InteractionsResponse.class);
|
||||||
|
return interactionsResponse;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public StoryTextResponse getStoryText(String feedId, String storyId) {
|
public StoryTextResponse getStoryText(String feedId, String storyId) {
|
||||||
final ContentValues values = new ContentValues();
|
final ContentValues values = new ContentValues();
|
||||||
values.put(APIConstants.PARAMETER_FEEDID, feedId);
|
values.put(APIConstants.PARAMETER_FEEDID, feedId);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.newsblur.network.domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mark on 03/06/15.
|
||||||
|
*/
|
||||||
|
public class InteractionsResponse {
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue