Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
VassilisPallas committed Apr 4, 2016
1 parent 6df5e6c commit 9066d5a
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 46 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.balysv/material-ripple/1.0.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/jars" />
Expand Down Expand Up @@ -104,9 +105,9 @@
<orderEntry type="library" exported="" name="play-services-gcm-8.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-8.3.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="volley-1.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="module" module-name="volley" exported="" />
</component>
</module>
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ repositories {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile files('libs/mail-1.4.1.jar')
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:appcompat-v7:23.0.+'
compile 'com.android.support:design:23.0.+'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.android.support:support-v4:23.0.+'
compile 'com.balysv:material-ripple:1.0.2'
compile files('libs/mail-1.4.1.jar')
compile 'com.google.code.gson:gson:2.5'
compile project(':volley')
compile "com.google.android.gms:play-services-gcm:8.3.0"
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public void setSwipeRefreshLayout(CustomSwipeRefreshLayout swipeRefreshLayout) {
this.swipeRefreshLayout = swipeRefreshLayout;
}

public void getAnnouncements(String url,final String fileName) {
public void getAnnouncements(String url, final String fileName) {
if (swipeRefreshLayout != null)
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest userAnnouncementsRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest userAnnouncementsRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
announcementsJson = response.toString();
Expand Down Expand Up @@ -87,7 +87,7 @@ public void onErrorResponse(VolleyError error) {

private void getSiteName(Announcement.AnnouncementItems item, final int index) {
site_name_tag = User.getUserEid() + " " + item.getSiteId() + " name";
JsonObjectRequest siteNameRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + item.getSiteId() + ".json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest siteNameRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + item.getSiteId() + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void setSwipeRefreshLayout(CustomSwipeRefreshLayout swipeRefreshLayout) {
}

public void getAssignments(String url) {
JsonObjectRequest assignmentsRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest assignmentsRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand All @@ -72,15 +72,15 @@ public void onResponse(JSONObject response) {
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
callback.onError(error);
callback.onError(error);
}
});
AppController.getInstance().addToRequestQueue(assignmentsRequest, user_assignments_tag);
}

private void getSiteName(final Assignment.AssignmentsCollection collection, final Assignment assignment) {
site_name_tag = User.getUserEid() + " " + collection.getContext() + " assignment name";
JsonObjectRequest siteNameRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + collection.getContext() + ".json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest siteNameRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + collection.getContext() + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void getEvents(String eventUrl) {
if (swipeRefreshLayout != null)
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest eventsRequest = new JsonObjectRequest(Request.Method.GET, eventUrl, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest eventsRequest = new JsonObjectRequest(Request.Method.GET, eventUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Event event = gson.fromJson(response.toString(), Event.class);
Expand Down Expand Up @@ -105,7 +105,7 @@ public void onErrorResponse(VolleyError error) {

private void getOwnerData(String url, final int index, final String tag) {

ownerDataRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
ownerDataRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
UserEventOwner userEventOwner = gson.fromJson(response.toString(), UserEventOwner.class);
Expand All @@ -123,7 +123,7 @@ public void onErrorResponse(VolleyError error) {

private void getEventInfo(String url, final int index, final String tag) {

JsonObjectRequest eventInfoRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest eventInfoRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
EventInfo userEventOwnerPojo = gson.fromJson(response.toString(), EventInfo.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected Map<String, String> getParams() {

@Override
public void getLoginJson(final String... params) {
JsonObjectRequest loginJson = new JsonObjectRequest(Request.Method.GET, params[0] + "session/" + params[1] + ".json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest loginJson = new JsonObjectRequest(Request.Method.GET, params[0] + "session/" + params[1] + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down Expand Up @@ -158,7 +158,7 @@ public void onErrorResponse(VolleyError error) {
@Override
public void getUserDataJson(final String... params) {

JsonObjectRequest userDataJson = new JsonObjectRequest(Request.Method.GET, params[0] + "user/" + params[1] + ".json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest userDataJson = new JsonObjectRequest(Request.Method.GET, params[0] + "user/" + params[1] + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
UserData userData = gson.fromJson(response.toString(), UserData.class);
Expand Down Expand Up @@ -193,7 +193,7 @@ public void onErrorResponse(VolleyError error) {
@Override
public void getUserProfileDataJson(String... params) {

JsonObjectRequest userProfileDataJson = new JsonObjectRequest(Request.Method.GET, params[0] + "profile/" + params[1] + ".json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest userProfileDataJson = new JsonObjectRequest(Request.Method.GET, params[0] + "profile/" + params[1] + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Profile profile = gson.fromJson(response.toString(), Profile.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void getSites(String url) throws IOException {
if (swipeRefreshLayout != null)
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest membershipRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest membershipRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
Expand Down Expand Up @@ -118,7 +118,7 @@ public void onErrorResponse(VolleyError error) {
private void getData(final SiteData siteData, final String type, final int index) {
membership_id_tag = User.getUserEid() + " membership " + siteData.getId() + " data";

final JsonObjectRequest membershipDataRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + ".json", (String) null, new Response.Listener<JSONObject>() {
final JsonObjectRequest membershipDataRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + ".json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down Expand Up @@ -148,7 +148,7 @@ public void onErrorResponse(VolleyError error) {
private void getPages(final SiteData siteData, final String type, final int index) {
membership_page_tag = User.getUserEid() + " membership " + siteData.getId() + " pages";

JsonArrayRequest pagesRequest = new JsonArrayRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/pages.json", (String) null, new Response.Listener<JSONArray>() {
JsonArrayRequest pagesRequest = new JsonArrayRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/pages.json", null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Type collectionType = new TypeToken<List<SitePage>>() {
Expand Down Expand Up @@ -178,7 +178,7 @@ private void getPermissions(final SiteData siteData, final String type, final in

membership_perms_tag = User.getUserEid() + " membership " + siteData.getId() + " perms";

JsonObjectRequest pagePermissionsRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/perms.json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest pagePermissionsRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/perms.json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
PagePermissions pagePermissions = gson.fromJson(response.toString(), PagePermissions.class);
Expand All @@ -203,7 +203,7 @@ public void onErrorResponse(VolleyError error) {

private void getUserPermissions(final SiteData siteData, final String type, final int index) {
membership_user_perms_tag = User.getUserEid() + " membership " + siteData.getId() + " user perms";
JsonObjectRequest pageUserPermissionsRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/userPerms.json", (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest pageUserPermissionsRequest = new JsonObjectRequest(Request.Method.GET, context.getResources().getString(R.string.url) + "site/" + siteData.getId() + "/userPerms.json", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
PageUserPermissions pageUserPermissions = gson.fromJson(response.toString(), PageUserPermissions.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void getAnnouncements(String url) {
if (swipeRefreshLayout != null)
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest announcementsRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest announcementsRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void setSwipeRefreshLayout(CustomSwipeRefreshLayout swipeRefreshLayout) {
}

public void getAssignments(String url) {
JsonObjectRequest assignmentsRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest assignmentsRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void getDropboxItems() {
}

private void getItem(String url, String tag, final int index, final Member member) {
JsonObjectRequest dropboxRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest dropboxRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Dropbox dropbox = gson.fromJson(response.toString(), Dropbox.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void getEvents(String eventUrl) {
if (swipeRefreshLayout != null)
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest eventsRequest = new JsonObjectRequest(Request.Method.GET, eventUrl, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest eventsRequest = new JsonObjectRequest(Request.Method.GET, eventUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Event event = gson.fromJson(response.toString(), Event.class);
Expand Down Expand Up @@ -112,7 +112,7 @@ public void onErrorResponse(VolleyError error) {
}

private void getOwnerData(String url, final int index, final String tag) {
ownerDataRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
ownerDataRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
UserEventOwner userEventOwner = gson.fromJson(response.toString(), UserEventOwner.class);
Expand All @@ -131,7 +131,7 @@ public void onErrorResponse(VolleyError error) {

private void getEventInfo(String url, final int index, final String tag) {

JsonObjectRequest eventInfoRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest eventInfoRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
EventInfo userEventOwnerPojo = gson.fromJson(response.toString(), EventInfo.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public RosterService(Context context, SiteData siteData, org.sakaiproject.custom
public void getRoster(String url) {
swipeRefreshLayout.setRefreshing(true);

JsonObjectRequest rosterRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
JsonObjectRequest rosterRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Roster roster = gson.fromJson(response.toString(), Roster.class);
Expand Down Expand Up @@ -79,7 +79,7 @@ public void onErrorResponse(VolleyError error) {
private void getUserProfile(final String userId, final Roster roster, final int index) {
final String tag_user_image_url = userId + " image url";
String url = context.getResources().getString(R.string.url) + "profile/" + userId + ".json";
userProfileImageUrlRequest = new JsonObjectRequest(Request.Method.GET, url, (String) null, new Response.Listener<JSONObject>() {
userProfileImageUrlRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
UserProfileImage userProfileImage = gson.fromJson(response.toString(), UserProfileImage.class);
Expand Down
Loading

0 comments on commit 9066d5a

Please sign in to comment.