Skip to content

Commit

Permalink
description problem fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
VassilisPallas committed Dec 5, 2016
1 parent 3353fc0 commit 104de57
Show file tree
Hide file tree
Showing 31 changed files with 205 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

25 changes: 17 additions & 8 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/google-services/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
Expand All @@ -65,14 +67,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -81,8 +75,17 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
Expand All @@ -98,12 +101,18 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.3.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
buildToolsVersion '25'

defaultConfig {
applicationId "org.sakaiproject.sakai"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -96,6 +97,8 @@ public void onBindViewHolder(MembershipAdapter.ViewHolder holder, final int posi
holder.description.setText(context.getString(R.string.no_description));
} else {

Log.i("description", description);

List<String> sounds = ActionsHelper.findAudios(memberships.get(position).getDescription());

description = ActionsHelper.deleteHtmlTags(memberships.get(position).getDescription());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -88,7 +89,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -130,7 +133,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -115,7 +117,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand All @@ -131,7 +133,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -170,7 +174,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -117,7 +119,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -149,7 +153,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
32 changes: 18 additions & 14 deletions app/src/main/java/org/sakaiproject/api/json/JsonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,17 @@ public static void parseEventJson(Event event) {
*/
public static void parseEventInfoJson(EventInfo userEventOwnerPojo, int index) {

EventsCollection.getEventsList().get(index).setDescription(userEventOwnerPojo.getDescription());
EventsCollection.getEventsList().get(index).setLastTime(userEventOwnerPojo.getLastTime());
EventsCollection.getEventsList().get(index).setLocation(userEventOwnerPojo.getLocation());
EventsCollection.getEventsList().get(index).setRecurrenceRule(userEventOwnerPojo.getRecurrenceRule());
if (EventsCollection.getEventsList().get(index).getRecurrenceRule() != null)
EventsCollection.getEventsList().get(index).getRecurrenceRule().setEndDate();
EventsCollection.getEventsList().get(index).setAttachments(userEventOwnerPojo.getAttachments());

EventsCollection.getEventsList().get(index).setTimeDuration();
if (EventsCollection.getEventsList().size() > 0) {
EventsCollection.getEventsList().get(index).setDescription(userEventOwnerPojo.getDescription());
EventsCollection.getEventsList().get(index).setLastTime(userEventOwnerPojo.getLastTime());
EventsCollection.getEventsList().get(index).setLocation(userEventOwnerPojo.getLocation());
EventsCollection.getEventsList().get(index).setRecurrenceRule(userEventOwnerPojo.getRecurrenceRule());
if (EventsCollection.getEventsList().get(index).getRecurrenceRule() != null)
EventsCollection.getEventsList().get(index).getRecurrenceRule().setEndDate();
EventsCollection.getEventsList().get(index).setAttachments(userEventOwnerPojo.getAttachments());

EventsCollection.getEventsList().get(index).setTimeDuration();
}
}

/**
Expand All @@ -212,11 +214,13 @@ public static void parseEventInfoJson(EventInfo userEventOwnerPojo, int index) {
*/
public static void getEventCreatorDisplayName(Context context, UserEventOwner userEventOwner, int index) {

EventsCollection.getEventsList().get(index).setCreatorUserId(userEventOwner.getDisplayName());
SharedPreferences preferences = context.getSharedPreferences("event_owners", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString(EventsCollection.getEventsList().get(index).getEventId(), userEventOwner.getDisplayName());
editor.apply();
if (EventsCollection.getEventsList().size() > 0) {
EventsCollection.getEventsList().get(index).setCreatorUserId(userEventOwner.getDisplayName());
SharedPreferences preferences = context.getSharedPreferences("event_owners", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString(EventsCollection.getEventsList().get(index).getEventId(), userEventOwner.getDisplayName());
editor.apply();
}
}

/**
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/org/sakaiproject/api/logout/Logout.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,20 @@ public void logout(String url) {
StringRequest logoutrequest = new StringRequest(Request.Method.DELETE, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
return;
AppController.getInstance().clearQueue();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {

AppController.getInstance().clearQueue();
}
}){
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -175,7 +177,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -210,7 +214,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -245,7 +251,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down Expand Up @@ -292,7 +300,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public void onErrorResponse(VolleyError error) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("_validateSession", Connection.getSessionId());
if(Connection.getSessionId() != null){
headers.put("_validateSession", Connection.getSessionId());
}
return headers;
}
};
Expand Down
Loading

0 comments on commit 104de57

Please sign in to comment.