Commit a70b8fe9 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

port commit c884d1f1d844c8df2ce2c347f5a1381ff1043aff from nextcloudAndroidProject

parent c6b717a0
......@@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
......
#Thu Oct 25 12:00:00 CET 2018
#Tue Mar 05 13:55:31 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
......@@ -134,7 +134,7 @@ public class GetRemoteCapabilitiesOperation extends RemoteOperation {
private static final String NODE_RICHDOCUMENTS = "richdocuments";
private static final String NODE_MIMETYPES = "mimetypes";
private static final String NODE_RICHDOCUMENTS_DIRECT_EDITING = "direct_editing";
private static final String NODE_RICHDOCUMENTS_TEMPLATES = "templates";
// activity
private static final String NODE_ACTIVITY = "activity";
......@@ -403,10 +403,10 @@ public class GetRemoteCapabilitiesOperation extends RemoteOperation {
}
if (respCapabilities.has(NODE_RICHDOCUMENTS)) {
JSONObject richDocumentsCapability = respCapabilities.getJSONObject(NODE_RICHDOCUMENTS);
capability.setRichDocuments(CapabilityBooleanType.TRUE);
JSONArray mimeTypesArray = respCapabilities.getJSONObject(NODE_RICHDOCUMENTS)
.getJSONArray(NODE_MIMETYPES);
JSONArray mimeTypesArray = richDocumentsCapability.getJSONArray(NODE_MIMETYPES);
ArrayList<String> mimeTypes = new ArrayList<>();
......@@ -416,11 +416,25 @@ public class GetRemoteCapabilitiesOperation extends RemoteOperation {
capability.setRichDocumentsMimeTypeList(mimeTypes);
if (respCapabilities.has(NODE_RICHDOCUMENTS_DIRECT_EDITING)) {
capability.setRichDocumentsDirectEditing(CapabilityBooleanType.TRUE);
if (richDocumentsCapability.has(NODE_RICHDOCUMENTS_DIRECT_EDITING)) {
if (richDocumentsCapability.getBoolean(NODE_RICHDOCUMENTS_DIRECT_EDITING)) {
capability.setRichDocumentsDirectEditing(CapabilityBooleanType.TRUE);
} else {
capability.setRichDocumentsDirectEditing(CapabilityBooleanType.FALSE);
}
} else {
capability.setRichDocumentsDirectEditing(CapabilityBooleanType.FALSE);
}
if (richDocumentsCapability.has(NODE_RICHDOCUMENTS_TEMPLATES)) {
if (richDocumentsCapability.getBoolean(NODE_RICHDOCUMENTS_TEMPLATES)) {
capability.setRichdocumentsTemplatesAvailable(CapabilityBooleanType.TRUE);
} else {
capability.setRichdocumentsTemplatesAvailable(CapabilityBooleanType.FALSE);
}
} else {
capability.setRichdocumentsTemplatesAvailable(CapabilityBooleanType.FALSE);
}
} else {
capability.setRichDocuments(CapabilityBooleanType.FALSE);
}
......
......@@ -91,6 +91,7 @@ public class OCCapability {
// Richdocuments
private CapabilityBooleanType richdocuments;
private CapabilityBooleanType richdocumentsDirectEditing;
private CapabilityBooleanType richdocumentsTemplatesAvailable;
private List<String> richdocumentsMimeTypeList;
private CapabilityBooleanType activity;
......@@ -145,6 +146,7 @@ public class OCCapability {
richdocuments = CapabilityBooleanType.UNKNOWN;
richdocumentsMimeTypeList = new ArrayList<>();
richdocumentsDirectEditing = CapabilityBooleanType.FALSE;
richdocumentsTemplatesAvailable = CapabilityBooleanType.FALSE;
}
......@@ -496,4 +498,13 @@ public class OCCapability {
public CapabilityBooleanType getRichDocumentsDirectEditing() {
return richdocumentsDirectEditing;
}
public CapabilityBooleanType getRichdocumentsTemplatesAvailable() {
return richdocumentsTemplatesAvailable;
}
public void setRichdocumentsTemplatesAvailable(CapabilityBooleanType richdocumentsTemplatesAvailable) {
this.richdocumentsTemplatesAvailable = richdocumentsTemplatesAvailable;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment