From 3ef2ed53ef60ab21edc5faf61bedfd850d92af92 Mon Sep 17 00:00:00 2001 From: evilbunny2008 <34211365+evilbunny2008@users.noreply.github.com> Date: Thu, 17 May 2018 10:31:58 +1000 Subject: [PATCH] Added yahoo/weatherzone icons to the forecast on the main screen --- app/build.gradle | 4 ++-- .../com/odiousapps/weewxweather/Weather.java | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0d7bfca..422b5ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "com.odiousapps.weewxweather" minSdkVersion 16 targetSdkVersion 26 - versionCode 3017 - versionName "0.3.17" + versionCode 3018 + versionName "0.3.18" } buildTypes { release { diff --git a/app/src/main/java/com/odiousapps/weewxweather/Weather.java b/app/src/main/java/com/odiousapps/weewxweather/Weather.java index 2016672..fb335ba 100644 --- a/app/src/main/java/com/odiousapps/weewxweather/Weather.java +++ b/app/src/main/java/com/odiousapps/weewxweather/Weather.java @@ -233,13 +233,14 @@ private void loadWebView() String[] content = common.processYahoo(data); if(content == null || content.length <= 0) return; - final String fc = "" + content[0] + ""; + String yahoo = "
"; + final String fc = "" + yahoo + content[0] + ""; wv.post(new Runnable() { @Override public void run() { - wv.loadDataWithBaseURL(null, fc, "text/html", "utf-8", null); + wv.loadDataWithBaseURL("file:///android_res/drawable/", fc, "text/html", "utf-8", null); } }); @@ -247,17 +248,26 @@ public void run() String[] content = common.processWZ(data); if(content == null || content.length <= 0) return; - final String fc = "" + content[0] + ""; + + String wz = "
"; + final String fc = "" + wz + content[0] + ""; wv.post(new Runnable() { @Override public void run() { - wv.loadDataWithBaseURL(null, fc, "text/html", "utf-8", null); + wv.loadDataWithBaseURL("file:///android_res/drawable/", fc, "text/html", "utf-8", null); } }); + /* + if(common.GetStringPref("fctype", "yahoo").toLowerCase().equals("yahoo")) + im.setImageResource(R.drawable.purple); + else if(common.GetStringPref("fctype", "yahoo").toLowerCase().equals("weatherzone")) + im.setImageResource(R.drawable.wz); + */ + } } }