From 838965d3e598259d1cd33d931b4fb23b651a80cd Mon Sep 17 00:00:00 2001 From: Survivingwithandroid Date: Mon, 19 Oct 2015 22:25:55 +0200 Subject: [PATCH] 1.6.0 --- OkHttpClient/build.gradle | 4 ++-- demo/build.gradle | 4 ++-- .../weather/lib/demo15/fragment/ChartFragment.java | 2 +- gradle.properties | 4 ++-- lib/build.gradle | 4 ++-- .../provider/openweathermap/OpenweathermapProvider.java | 8 +++++--- settings.gradle | 2 +- volleyclient/build.gradle | 4 ++-- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/OkHttpClient/build.gradle b/OkHttpClient/build.gradle index 7e9180c..a0e129e 100644 --- a/OkHttpClient/build.gradle +++ b/OkHttpClient/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 19 - versionCode 159 - versionName "1.5.9" + versionCode 160 + versionName "1.6.0" } buildTypes { release { diff --git a/demo/build.gradle b/demo/build.gradle index 13d536c..f40ac01 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -27,8 +27,8 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.survivingwithandroid:weatherlib:1.5.2' - compile 'com.survivingwithandroid:weatherlib_volleyclient:1.5.2' + compile project(':lib') + compile project(':volleyclient') compile 'com.mcxiaoke.volley:library:1.0.6@aar' compile 'com.android.support:support-v4:20.0.0' } diff --git a/demo15/src/main/java/com/survivingwithandroid/weather/lib/demo15/fragment/ChartFragment.java b/demo15/src/main/java/com/survivingwithandroid/weather/lib/demo15/fragment/ChartFragment.java index dca0d5c..a33dc22 100644 --- a/demo15/src/main/java/com/survivingwithandroid/weather/lib/demo15/fragment/ChartFragment.java +++ b/demo15/src/main/java/com/survivingwithandroid/weather/lib/demo15/fragment/ChartFragment.java @@ -138,7 +138,7 @@ public void onWeatherRetrieved(WeatherForecast weatherForecast) { @Override public void onWeatherError(WeatherLibException e) { - Log.e("SwA", "#####à ERROR #####", e); + Log.e("SwA", "##### ERROR #####", e); Toast.makeText(getActivity(), "Forecast: Error parsing the data", Toast.LENGTH_LONG).show(); } diff --git a/gradle.properties b/gradle.properties index d60cbc0..ab3d441 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.5.9 -VERSION_CODE=18 +VERSION_NAME=1.6.0 +VERSION_CODE=19 GROUP=com.survivingwithandroid POM_DESCRIPTION=Android Weather Lib diff --git a/lib/build.gradle b/lib/build.gradle index 89f362f..ce81efe 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 19 - versionCode 159 - versionName "1.5.9" + versionCode 1591 + versionName "1.6.0" } buildTypes { release { diff --git a/lib/src/main/java/com/survivingwithandroid/weather/lib/provider/openweathermap/OpenweathermapProvider.java b/lib/src/main/java/com/survivingwithandroid/weather/lib/provider/openweathermap/OpenweathermapProvider.java index c1499e0..0e1e974 100755 --- a/lib/src/main/java/com/survivingwithandroid/weather/lib/provider/openweathermap/OpenweathermapProvider.java +++ b/lib/src/main/java/com/survivingwithandroid/weather/lib/provider/openweathermap/OpenweathermapProvider.java @@ -437,7 +437,7 @@ public void setConfig(WeatherConfig config) { @Override public String getQueryCityURL(String cityNamePattern) { - return SEARCH_URL + cityNamePattern + createAPPID(); // + "&cnt=" + config.maxResult; + return SEARCH_URL + cityNamePattern + createAPPID(); } /* @@ -464,12 +464,12 @@ public void setWeatherCodeProvider(IWeatherCodeProvider codeProvider) { @Override public String getQueryCityURLByLocation(android.location.Location location) throws ApiKeyRequiredException { - return SEARCH_URL_GEO + "&lat=" + location.getLatitude() + "&lon=" + location.getLongitude() + "&cnt=3"; + return SEARCH_URL_GEO + "&lat=" + location.getLatitude() + "&lon=" + location.getLongitude() + "&cnt=3" + createAPPID(); } @Override public String getQueryCityURLByCoord(double lon, double lat) throws ApiKeyRequiredException { - return SEARCH_URL_GEO + "&lat=" + lat + "&lon=" + lon + "&cnt=3"; + return SEARCH_URL_GEO + "&lat=" + lat + "&lon=" + lon + "&cnt=3" + createAPPID() ; } @@ -495,9 +495,11 @@ public String getQueryLayerURL(String cityId, Params params) throws ApiKeyRequir private String createAPPID() { + if (config.ApiKey == null || config.ApiKey.equals("")) return ""; + return "&APPID=" + config.ApiKey; } diff --git a/settings.gradle b/settings.gradle index 2bea0b2..d5f2cd1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':lib', ':volleyclient', ':demo15', ':OkHttpClient', 'demo' +include ':lib', ':volleyclient', ':demo15', ':OkHttpClient', ':weathertestapp', 'demo' diff --git a/volleyclient/build.gradle b/volleyclient/build.gradle index 99e0743..5690780 100644 --- a/volleyclient/build.gradle +++ b/volleyclient/build.gradle @@ -6,8 +6,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 19 - versionCode 159 - versionName '1.5.9' + versionCode 160 + versionName '1.6.0' } buildTypes { release {