From 143a744a85b0a2eff9742d84bf6026e0943995d6 Mon Sep 17 00:00:00 2001 From: micwallace Date: Mon, 20 Jun 2016 13:38:17 +1000 Subject: [PATCH] - Fixed html entity encoding in theme name. - Fixed list refresh bug when installing theme. --- .../com/wallaceit/reddinator/activity/ThemesActivity.java | 7 ++++++- .../au/com/wallaceit/reddinator/core/ThemeManager.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/reddinator/src/main/java/au/com/wallaceit/reddinator/activity/ThemesActivity.java b/reddinator/src/main/java/au/com/wallaceit/reddinator/activity/ThemesActivity.java index fda508e..bb9e8fe 100644 --- a/reddinator/src/main/java/au/com/wallaceit/reddinator/activity/ThemesActivity.java +++ b/reddinator/src/main/java/au/com/wallaceit/reddinator/activity/ThemesActivity.java @@ -99,10 +99,15 @@ public void onClick(DialogInterface dialog, int which) { } } + @Override + protected void onResume() { + super.onResume(); + refreshList(); + } + @Override public void onActivityResult(int requestCode, int resultCode, Intent data){ if (resultCode==RESULT_CODE_THEME_UPDATED) { - refreshList(); themesEdited = true; setResult(RESULT_CODE_THEME_UPDATED); } diff --git a/reddinator/src/main/java/au/com/wallaceit/reddinator/core/ThemeManager.java b/reddinator/src/main/java/au/com/wallaceit/reddinator/core/ThemeManager.java index 0b19c6f..b1bb2d7 100644 --- a/reddinator/src/main/java/au/com/wallaceit/reddinator/core/ThemeManager.java +++ b/reddinator/src/main/java/au/com/wallaceit/reddinator/core/ThemeManager.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.graphics.Color; +import android.text.Html; import org.json.JSONArray; import org.json.JSONException; @@ -165,6 +166,9 @@ private boolean validateThemeJson(JSONObject theme){ if (!theme.has("name") || "".equals(theme.get("name"))) return false; + // decode Html entities in name + theme.put("name", Html.fromHtml(theme.getString("name"))); + JSONObject impValues = theme.getJSONObject("values"); JSONObject defaults = defaultValues.getTheme().getJSONObject("values");