From bf5fbdfbe35a523823fe53da1d9100144575b65f Mon Sep 17 00:00:00 2001 From: Matthew Frederick Date: Wed, 14 Jul 2021 13:43:28 -0400 Subject: [PATCH 1/2] migration update --- .../com/thunderhead/optimizationexample/MainActivity.kt | 7 ++----- .../app/src/main/res/xml/network_security_config.xml | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt b/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt index d42fbb3..40fcc00 100644 --- a/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt +++ b/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt @@ -1,7 +1,6 @@ package com.thunderhead.optimizationexample import android.os.Bundle -import android.text.Html import android.util.Base64 import android.util.Log import android.view.LayoutInflater @@ -160,15 +159,13 @@ class FirstFragment : Fragment() { actions?.run { this.filter { it.getString("name").contains("banner") } .map { it.getJSONObject("asset").getString("content") } - .map { content -> JSONObject(Html.fromHtml(content).toString()) } - .forEach { contentJson -> updateContent(contentJson, true) } + .forEach { contentJson -> updateContent(JSONObject(contentJson), false) } } actions?.run { this.filter { it.getString("name").contains("card") } .map { it.getJSONObject("asset").getString("content") } - .map { content -> JSONObject(Html.fromHtml(content).toString()) } - .forEach { contentJson -> updateContent(contentJson, false) } + .forEach { contentJson -> updateContent(JSONObject(contentJson), false) } } } diff --git a/examples/optimizing-programmatically-using-json-example/app/src/main/res/xml/network_security_config.xml b/examples/optimizing-programmatically-using-json-example/app/src/main/res/xml/network_security_config.xml index f04aad3..ba4d81f 100644 --- a/examples/optimizing-programmatically-using-json-example/app/src/main/res/xml/network_security_config.xml +++ b/examples/optimizing-programmatically-using-json-example/app/src/main/res/xml/network_security_config.xml @@ -1,3 +1,4 @@ + From 06845caeca1fc35dd53e083f3cf5f6fefd966ad4 Mon Sep 17 00:00:00 2001 From: Matthew Frederick Date: Wed, 14 Jul 2021 13:59:24 -0400 Subject: [PATCH 2/2] update is banner value --- .../java/com/thunderhead/optimizationexample/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt b/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt index 40fcc00..c302676 100644 --- a/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt +++ b/examples/optimizing-programmatically-using-json-example/app/src/main/java/com/thunderhead/optimizationexample/MainActivity.kt @@ -159,7 +159,7 @@ class FirstFragment : Fragment() { actions?.run { this.filter { it.getString("name").contains("banner") } .map { it.getJSONObject("asset").getString("content") } - .forEach { contentJson -> updateContent(JSONObject(contentJson), false) } + .forEach { contentJson -> updateContent(JSONObject(contentJson), true) } } actions?.run {