Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c1a0fdd
Fix NumberFormatException when showing current weather for Ischgl, Au…
m-rm Nov 18, 2015
e6aea4b
Cleanup YahooWeatherProvider.java
m-rm Nov 18, 2015
4b6af17
Unify parsing of current weather and forecast
m-rm Nov 18, 2015
0ed1647
Adaptions to recent Yahoo weather changes
m-rm Apr 18, 2016
b76b89d
Adaptions to Yahoo GeoPlanet shutdown
m-rm Sep 5, 2016
9c4170b
Fix WeatherUnderground parsing exception
m-rm Jan 11, 2017
34c4346
Fix Java 8 build
m-rm Jan 11, 2017
5d444c7
Upgrade to newest Gradle and Android plugin version
m-rm Jan 11, 2017
b00096b
Get latitude and longitude from City class
m-rm Jan 11, 2017
e090139
Upgrading Android build tools
m-rm Jan 11, 2017
6293f99
Publish to local Nexus for internal use
m-rm Jan 11, 2017
bf3013a
Using new android plugin names
m-rm Jan 12, 2017
d2cbb64
Update to new publish plugin
m-rm Jan 12, 2017
bfff932
Fixing some error produced by android-reporting
m-rm Jan 13, 2017
bf50cbf
Use unofficial snapshot of maven-settings-plugin that support Android…
m-rm Jan 13, 2017
c9cfa18
Use unofficial snapshot of maven-settings-plugin that support Android…
m-rm Jan 13, 2017
13827b7
Fix deployment
m-rm Jan 16, 2017
ec78c06
Switching lat & lon in some methods, write location in City class
m-rm Jan 16, 2017
a353a4f
Refactor WeatherUndergroundProvider, add parsed humidity to forecast
m-rm Jan 16, 2017
632ab8a
Adding Android Location to WeatherRequest possibilities
m-rm Jan 19, 2017
00cdaeb
Refactoring model and providers
m-rm Jan 19, 2017
59edbe8
Add snapshot repo
Jan 20, 2017
ee7a4e2
Refactoring provider
Jan 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions OkHttpClient/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'android-library'
apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down Expand Up @@ -54,4 +54,5 @@ task makeJar(type: Copy) {
}

makeJar.dependsOn(clearJar, build)
apply from: '../maven_push.gradle'
//apply from: '../maven_push.gradle'
apply from: '../nexus_push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void run() {
*/
@Override
public void searchCity(double lat, double lon, CityEventListener listener) throws ApiKeyRequiredException {
String url = provider.getQueryCityURLByCoord(lon, lat);
String url = provider.getQueryCityURLByCoord(lat, lon);
_doSearchCity(url, listener);
}

Expand Down
16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

allprojects {
version = VERSION_NAME
group = GROUP
Expand All @@ -25,8 +32,7 @@ allprojects {

ext {
compileSdkVersion = 19
buildToolsVersion = "21.0.1"
buildToolsVersion = "25.0.2"
}


apply plugin: 'android-reporting'
3 changes: 1 addition & 2 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'android-sdk-manager'
apply plugin: 'android'
apply plugin: 'com.android.application'


android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
dayCloud.setText("" + forecast.weather.clouds.getPerc() + "%");
dayDescr.setText(forecast.weather.currentCondition.getDescr());
try {
float rainVal = forecast.weather.rain[0].getAmmount();
dayRain.setText("Rain:" + String.valueOf((int) rainVal));
final Double rainVal = forecast.weather.rain[0].getAmmount();
dayRain.setText("Rain:" + rainVal.intValue());
}
catch(Throwable t) {}
return convertView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ public void onWeatherRetrieved(CurrentWeather cWeather) {
condDescr.setText(weather.currentCondition.getCondition() + "(" + weather.currentCondition.getDescr() + ")");
LogUtils.LOGD("SwA", "Temp [" + temp + "]");
LogUtils.LOGD("SwA", "Val [" + weather.temperature.getTemp() + "]");
temp.setText("" + ((int) weather.temperature.getTemp()));
temp.setText(weather.temperature.getTemp().intValue());
unitTemp.setText(cWeather.getUnit().tempUnit);
colorTextLine.setBackgroundResource(WeatherUtil.getResource(weather.temperature.getTemp(), config));
colorTextLine.setBackgroundResource(WeatherUtil.getResource(weather.temperature.getTemp().floatValue(), config));
hum.setText(weather.currentCondition.getHumidity() + "%");
tempMin.setText(weather.temperature.getMinTemp() + cWeather.getUnit().tempUnit);
tempMax.setText(weather.temperature.getMaxTemp() + cWeather.getUnit().tempUnit);
windSpeed.setText(weather.wind.getSpeed() + cWeather.getUnit().speedUnit);
windDeg.setText((int) weather.wind.getDeg() + "° (" + WindDirection.getDir((int) weather.wind.getDeg()) + ")");
windDeg.setText(weather.wind.getDeg().intValue() + "° (" + WindDirection.getDir(weather.wind.getDeg().intValue()) + ")");
press.setText(weather.currentCondition.getPressure() + cWeather.getUnit().pressureUnit);

sunrise.setText(WeatherUtil.convertDate(weather.location.getSunrise()));
Expand Down
3 changes: 1 addition & 2 deletions demo15/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'android-sdk-manager'
apply plugin: 'android'
apply plugin: 'com.android.application'

repositories {
mavenCentral()
Expand Down
16 changes: 9 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
VERSION_NAME=1.6.0
VERSION_NAME=1.6.1-SNAPSHOT
VERSION_CODE=19
GROUP=com.survivingwithandroid
GROUP=at.ac.ait.hbs.android

POM_DESCRIPTION=Android Weather Lib
POM_URL=https://github.com/survivingwithandroid/WeatherLib
POM_SCM_URL=https://github.com/survivingwithandroid/WeatherLib
POM_SCM_CONNECTION=scm:[email protected]:survivingwithandroid/weatherlib.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:survivingwithandroid/weatherlib.git
POM_URL=https://github.com/m-rm/WeatherLib
POM_SCM_URL=https://github.com/m-rm/WeatherLib
POM_SCM_CONNECTION=scm:[email protected]:m-rm/weatherlib.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:m-rm/weatherlib.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=survivingwithandroid
POM_DEVELOPER_NAME=Francesco Azzola
POM_DEVELOPER_NAME=Francesco Azzola
POM_DEVELOPER2_ID=m-rm
POM_DEVELOPER2_NAME=M-RM
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
5 changes: 3 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Maven
apply plugin: 'android-library'
apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down Expand Up @@ -52,4 +52,5 @@ task makeJar(type: Copy) {
makeJar.dependsOn(clearJar, build)


apply from: '../maven_push.gradle'
//apply from: '../maven_push.gradle'
apply from: '../nexus_push.gradle'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.survivingwithandroid.weather.lib;

/**
* Created by muellner-riederm on 19.01.2017.
*/

public final class DefaultValues {
private DefaultValues() {}

// These values are used if no value was assigned
public static Integer DEFAULT_INTEGER = null;
public static Long DEFAULT_LONG = null;
public static Double DEFAULT_DOUBLE = null;
public static String DEFAULT_STRING = "";

// These values are used when parsing fails
public static Integer ERROR_INTEGER = null;
public static Long ERROR_LONG = null;
public static Double ERROR_DOUBLE = null;
public static String ERROR_STRING = "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ public void setRegion(String region) {
this.region = region;
}

public double getLatitude(){
return lat;
}

public double getLongitude(){
return lon;
}

public String toString(){
return this.name + ", " + this.country;
}
Expand Down Expand Up @@ -162,7 +170,7 @@ public CityBuilder region(String region) {
return this;
}

public CityBuilder geoCoord(double lon, double lat) {
public CityBuilder geoCoord(double lat, double lon) {
this.lat = lat;
this.lon = lon;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package com.survivingwithandroid.weather.lib.model;

import com.survivingwithandroid.weather.lib.DefaultValues;

import java.text.SimpleDateFormat;
import java.util.Date;

Expand All @@ -33,12 +35,12 @@ public class DayForecast extends WeatherForecastData {
* Forecast temperature
* */
public class ForecastTemp {
public float day;
public float min;
public float max;
public float night;
public float eve;
public float morning;
public Double day = DefaultValues.DEFAULT_DOUBLE;
public Double min = DefaultValues.DEFAULT_DOUBLE;
public Double max = DefaultValues.DEFAULT_DOUBLE;
public Double night = DefaultValues.DEFAULT_DOUBLE;
public Double eve = DefaultValues.DEFAULT_DOUBLE;
public Double morning = DefaultValues.DEFAULT_DOUBLE;
}

public String getStringDate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package com.survivingwithandroid.weather.lib.model;

import com.survivingwithandroid.weather.lib.DefaultValues;

import java.io.Serializable;

/**
Expand All @@ -26,45 +28,45 @@
public class Location implements Serializable {


private float longitude;
private float latitude;
private long sunset;
private long sunrise;
private String country;
private String city;
private String region;
private Double longitude = DefaultValues.DEFAULT_DOUBLE;
private Double latitude = DefaultValues.DEFAULT_DOUBLE;
private Long sunset = DefaultValues.DEFAULT_LONG;
private Long sunrise = DefaultValues.DEFAULT_LONG;
private String country = DefaultValues.DEFAULT_STRING;
private String city = DefaultValues.DEFAULT_STRING;
private String region = DefaultValues.DEFAULT_STRING;
private Astronomy astronomy = new Astronomy();
private long population;
private Long population = DefaultValues.DEFAULT_LONG;

public float getLongitude() {
public Double getLongitude() {
return longitude;
}

public void setLongitude(float longitude) {
public void setLongitude(Double longitude) {
this.longitude = longitude;
}

public float getLatitude() {
public Double getLatitude() {
return latitude;
}

public void setLatitude(float latitude) {
public void setLatitude(Double latitude) {
this.latitude = latitude;
}

public long getSunset() {
public Long getSunset() {
return sunset;
}

public void setSunset(long sunset) {
public void setSunset(Long sunset) {
this.sunset = sunset;
}

public long getSunrise() {
public Long getSunrise() {
return sunrise;
}

public void setSunrise(long sunrise) {
public void setSunrise(Long sunrise) {
this.sunrise = sunrise;
}

Expand Down Expand Up @@ -100,11 +102,11 @@ public void setAstronomy(Astronomy astronomy) {
this.astronomy = astronomy;
}

public long getPopulation() {
public Long getPopulation() {
return population;
}

public void setPopulation(long population) {
public void setPopulation(Long population) {
this.population = population;
}

Expand Down
Loading