diff --git a/CHANGELOG.md b/CHANGELOG.md index bc2f6274..69a4fa88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # CHANGELOG +## Version 3.15.1 + +### Date: 24-June-2024 + +- added support to convert json to html + +--- + ## Version 3.15.0 ### Date: 20-May-2024 diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 035e17c7..9e9f1fb9 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true mavenPublishing { publishToMavenCentral(SonatypeHost.DEFAULT) signAllPublications() - coordinates("com.contentstack.sdk", "android", "3.15.0") + coordinates("com.contentstack.sdk", "android", "3.15.1") pom { name = "contentstack-android" @@ -76,6 +76,11 @@ android { // } } } + // signing { + // // Specify key and other signing details + // useGpgCmd() + // sign configurations.archives + // } signingConfigs { debug { storeFile file("../key.keystore") @@ -111,12 +116,12 @@ android { testCoverageEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - buildConfigField "String", "host", localProperties['host'] - buildConfigField "String", "APIKey", localProperties['APIKey'] - buildConfigField "String", "deliveryToken", localProperties['deliveryToken'] - buildConfigField "String", "environment", localProperties['environment'] - buildConfigField "String", "contentTypeUID", localProperties['contentType'] - buildConfigField "String", "assetUID", localProperties['assetUid'] + buildConfigField "String", "host", localProperties['host'] + buildConfigField "String", "APIKey", localProperties['APIKey'] + buildConfigField "String", "deliveryToken", localProperties['deliveryToken'] + buildConfigField "String", "environment", localProperties['environment'] + buildConfigField "String", "contentTypeUID", localProperties['contentType'] + buildConfigField "String", "assetUID", localProperties['assetUid'] } release { minifyEnabled false diff --git a/contentstack/src/main/java/com/contentstack/sdk/DefaultOption.java b/contentstack/src/main/java/com/contentstack/sdk/DefaultOption.java new file mode 100644 index 00000000..39eff7d8 --- /dev/null +++ b/contentstack/src/main/java/com/contentstack/sdk/DefaultOption.java @@ -0,0 +1,216 @@ +package com.contentstack.sdk; + +import android.text.TextUtils; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; + +public class DefaultOption implements Option { + @Override + public String renderOptions(JSONObject embeddedObject, Metadata metadata) { + switch (metadata.getStyleType()) { + case BLOCK: + return "
" + findTitleOrUid(embeddedObject) + "
Content type: " + embeddedObject.optString("_content_type_uid") + "
" + children + "
"; + case "a": + return "" + children + ""; + case "img": + String assetLink = getNodeStr(nodeObject, "asset-link"); + if (!assetLink.isEmpty()) { + JSONObject attrs = nodeObject.optJSONObject("attrs"); + if (attrs.has("link")) { + return "" + "" + children + ""; + } + return "" + children; + } + return "" + children; + case "embed": + return "