Skip to content

Commit

Permalink
Added yahoo/weatherzone icons to the forecast on the main screen
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbunny2008 committed May 17, 2018
1 parent 5afd24b commit 3ef2ed5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 14 additions & 4 deletions app/src/main/java/com/odiousapps/weewxweather/Weather.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,31 +233,41 @@ private void loadWebView()
String[] content = common.processYahoo(data);
if(content == null || content.length <= 0)
return;
final String fc = "<html><body style='text-align:center'>" + content[0] + "</body></html>";
String yahoo = "<img src='purple.png' height='29px'/><br/>";
final String fc = "<html><body style='text-align:center'>" + yahoo + content[0] + "</body></html>";
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);
}
});

} else if(fctype.toLowerCase().equals("weatherzone")) {
String[] content = common.processWZ(data);
if(content == null || content.length <= 0)
return;
final String fc = "<html><body style='text-align:center'>" + content[0] + "</body></html>";

String wz = "<img src='wz.png' height='29px'/><br/>";
final String fc = "<html><body style='text-align:center'>" + wz + content[0] + "</body></html>";

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);
*/

}
}
}
Expand Down

0 comments on commit 3ef2ed5

Please sign in to comment.