diff options
| author | David van Tonder <david.vantonder@gmail.com> | 2012-05-15 22:30:37 -0400 |
|---|---|---|
| committer | elektroschmock <elektroschmock78@googlemail.com> | 2012-05-26 22:08:52 +0200 |
| commit | b0a4ed8386abed54a88a22352c6800855398dbfb (patch) | |
| tree | 955cb3853e573f5f059cdd0d6a306ce4fd0ce64d | |
| parent | 2dddab5176a697d0ab99edb129186d939c190de1 (diff) | |
| download | frameworks_base-b0a4ed8386abed54a88a22352c6800855398dbfb.zip frameworks_base-b0a4ed8386abed54a88a22352c6800855398dbfb.tar.gz frameworks_base-b0a4ed8386abed54a88a22352c6800855398dbfb.tar.bz2 | |
Framework: Lock screen weather (Part 2 of 2)
This commit adds the framework side support for displaying the
current weather forecast on the lock screen.
Special thanks to Devatwork for his help with the update code,
Blunden for his help with the weather images and the AOKP team
for the original Yahoo! Weather parsing code.
Patch set 2 - Whitespace cleanup
Patch set 3 - Default show location, timestamp and metric to on
Patch set 4 - Adds AOKP copyright to util classes
Patch set 5 - Fixes derp introduced by Ps4
Patch set 6 - Fixes (incl music control widget size)
Patch set 7 - Minor tweak to the music control widget size
Patch set 8 - Better 'error' message on startup
Patch set 9 - Even better start up message and Cid image
Patch set 10 - German translation
Change-Id: Ib12951f163d4fe04cbfa2e4ae9fc59058b71f47e
164 files changed, 1298 insertions, 21 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index eb1f2a5..a450375 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2395,6 +2395,48 @@ public final class Settings { public static final String QUIET_HOURS_DIM = "quiet_hours_dim"; /** + * Show the weather on the lock screen + * @hide + */ + public static final String LOCKSCREEN_WEATHER = "lockscreen_weather"; + + /** + * Show the current weather location on the lock screen + * @hide + */ + public static final String WEATHER_SHOW_LOCATION = "weather_show_location"; + + /** + * Show the current weather location on the lock screen + * @hide + */ + public static final String WEATHER_SHOW_TIMESTAMP = "weather_show_timestamp"; + + /** + * Use the custom/manually configured weather location + * @hide + */ + public static final String WEATHER_USE_CUSTOM_LOCATION = "weather_use_custom_location"; + + /** + * Stores the custom/manually configured weather location + * @hide + */ + public static final String WEATHER_CUSTOM_LOCATION = "weather_custom_location"; + + /** + * Stores the weather update frequency + * @hide + */ + public static final String WEATHER_UPDATE_INTERVAL = "weather_update_interval"; + + /** + * Use Metric measurements (celcius, km/h) for weather data + * @hide + */ + public static final String WEATHER_USE_METRIC = "weather_use_metric"; + + /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. * diff --git a/core/java/com/android/internal/util/weather/HttpRetriever.java b/core/java/com/android/internal/util/weather/HttpRetriever.java new file mode 100644 index 0000000..cb72b63 --- /dev/null +++ b/core/java/com/android/internal/util/weather/HttpRetriever.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2012 The AOKP Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.util.weather; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.util.EntityUtils; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; + +import android.util.Log; + +public class HttpRetriever { + + private final String TAG = getClass().getSimpleName(); + private DefaultHttpClient client = new DefaultHttpClient(); + private HttpURLConnection httpConnection; + + public String retrieve(String url) { + HttpGet get = new HttpGet(url); + try { + HttpResponse getResponse = client.execute(get); + HttpEntity getResponseEntity = getResponse.getEntity(); + if (getResponseEntity != null) { + String response = EntityUtils.toString(getResponseEntity); + return response; + } + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + private void requestConnectServer(String strURL) throws IOException { + httpConnection = (HttpURLConnection) new URL(strURL).openConnection(); + httpConnection.connect(); + + if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { + Log.e(TAG, "Something wrong with connection"); + httpConnection.disconnect(); + throw new IOException("Error in connection: " + httpConnection.getResponseCode()); + } + } + + private void requestDisconnect() { + if (httpConnection != null) { + httpConnection.disconnect(); + } + } + + public Document getDocumentFromURL(String strURL) throws IOException { + if (strURL == null) { + Log.e(TAG, "Invalid input URL"); + return null; + } + + // Connect to server, get data and close + requestConnectServer(strURL); + String strDocContent = getDataFromConnection(); + requestDisconnect(); + + if (strDocContent == null) { + Log.e(TAG, "Cannot get XML content"); + return null; + } + + int strContentSize = strDocContent.length(); + StringBuffer strBuff = new StringBuffer(); + strBuff.setLength(strContentSize + 1); + strBuff.append(strDocContent); + ByteArrayInputStream is = new ByteArrayInputStream(strDocContent.getBytes()); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db; + Document docData = null; + + try { + db = dbf.newDocumentBuilder(); + docData = db.parse(is); + } catch (Exception e) { + Log.e(TAG, "Parser data error"); + return null; + } + return docData; + } + + private String getDataFromConnection() throws IOException { + if (httpConnection == null) { + Log.e(TAG, "Connection is null"); + return null; + } + + String strValue = null; + InputStream inputStream = httpConnection.getInputStream(); + if (inputStream == null) { + Log.e(TAG, "Input stream error"); + return null; + } + + StringBuffer strBuf = new StringBuffer(); + BufferedReader buffReader = new BufferedReader(new InputStreamReader(inputStream)); + String strLine = ""; + + while ((strLine = buffReader.readLine()) != null) { + strBuf.append(strLine + "\n"); + strValue += strLine + "\n"; + } + + // Release resource to system + buffReader.close(); + inputStream.close(); + return strBuf.toString(); + } +} diff --git a/core/java/com/android/internal/util/weather/WeatherInfo.java b/core/java/com/android/internal/util/weather/WeatherInfo.java new file mode 100644 index 0000000..db0a59c --- /dev/null +++ b/core/java/com/android/internal/util/weather/WeatherInfo.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2012 The AOKP Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.util.weather; + +import android.content.Context; +import com.android.internal.R; + +public class WeatherInfo { + + public static final String NODATA = "-"; + + public String city, forecast_date, condition, condition_code, temp, temp_unit, + humidity, wind, wind_dir, speed_unit, low, high; + public long last_sync; + + public WeatherInfo() { + this.city = NODATA; + this.forecast_date = NODATA; + this.condition = NODATA; + this.condition_code = NODATA; + this.temp = NODATA; + this.temp_unit = NODATA; + this.humidity = NODATA; + this.wind = NODATA; + this.wind_dir = NODATA; + this.speed_unit = NODATA; + this.low = NODATA; + this.high = NODATA; + this.last_sync = 0; + } + + public WeatherInfo(Context context, String city, String fdate, String condition, String condition_code, + String temp, String temp_unit, String humidity, + String wind, String wind_dir, String speed_unit, + String low, String high, long last_sync) { + this.city = city; + this.forecast_date = fdate; + this.condition = condition; + this.condition_code = condition_code; + this.humidity = humidity + "%"; + this.wind = calcDirection(context, wind_dir) + " " + trimSpeed(wind) + speed_unit; + this.speed_unit = speed_unit; + this.last_sync = last_sync; + // Only the current temperature gets the temp_unit added. + this.temp_unit = temp_unit; + this.temp = temp + "°" + temp_unit.toLowerCase(); + this.low = low + "°"; + this.high = high + "°"; + } + + /** + * find the optimal weather string (helper function for translation) + * + * @param conditionCode condition code from Yahoo (this is the main + * identifier which will be used to find a matching translation + * in the project's resources + * @param providedString + * @return either the defaultString (which should be Yahoo's weather + * condition text), or the translated version from resources + */ + public static String getTranslatedConditionString(Context context, int conditionCode, + String providedString) { + int resID = context.getResources().getIdentifier("weather_" + conditionCode, "string", + context.getPackageName()); + return (resID != 0) ? context.getResources().getString(resID) : providedString; + } + + private String calcDirection(Context context, String degrees) { + int deg = Integer.parseInt(degrees); + if (deg >= 338 || deg <= 22) + return context.getResources().getString(R.string.weather_N); + else if (deg < 68) + return context.getResources().getString(R.string.weather_NE); + else if (deg < 113) + return context.getResources().getString(R.string.weather_E); + else if (deg < 158) + return context.getResources().getString(R.string.weather_SE); + else if (deg < 203) + return context.getResources().getString(R.string.weather_S); + else if (deg < 248) + return context.getResources().getString(R.string.weather_SW); + else if (deg < 293) + return context.getResources().getString(R.string.weather_W); + else if (deg < 338) + return context.getResources().getString(R.string.weather_NW); + else + return ""; + } + + private String trimSpeed(String speed) { + return String.valueOf(Math.round(Float.parseFloat(speed))); + } +} diff --git a/core/java/com/android/internal/util/weather/WeatherXmlParser.java b/core/java/com/android/internal/util/weather/WeatherXmlParser.java new file mode 100644 index 0000000..b9731dc --- /dev/null +++ b/core/java/com/android/internal/util/weather/WeatherXmlParser.java @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2012 The AOKP Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.util.weather; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import android.content.Context; +import android.util.Log; + +public class WeatherXmlParser { + + protected static final String TAG = "WeatherXmlParser"; + + /** Yahoo attributes */ + private static final String PARAM_YAHOO_LOCATION = "yweather:location"; + private static final String PARAM_YAHOO_UNIT = "yweather:units"; + private static final String PARAM_YAHOO_ATMOSPHERE = "yweather:atmosphere"; + private static final String PARAM_YAHOO_CONDITION = "yweather:condition"; + private static final String PARAM_YAHOO_WIND = "yweather:wind"; + private static final String PARAM_YAHOO_FORECAST = "yweather:forecast"; + + private static final String ATT_YAHOO_CITY = "city"; + private static final String ATT_YAHOO_TEMP = "temp"; + private static final String ATT_YAHOO_CODE = "code"; + private static final String ATT_YAHOO_TEMP_UNIT = "temperature"; + private static final String ATT_YAHOO_HUMIDITY = "humidity"; + private static final String ATT_YAHOO_TEXT = "text"; + private static final String ATT_YAHOO_DATE = "date"; + private static final String ATT_YAHOO_SPEED = "speed"; + private static final String ATT_YAHOO_DIRECTION = "direction"; + private static final String ATT_YAHOO_TODAY_HIGH = "high"; + private static final String ATT_YAHOO_TODAY_LOW = "low"; + + private Context mContext; + + public WeatherXmlParser(Context context) { + mContext = context; + } + + public WeatherInfo parseWeatherResponse(Document docWeather) { + if (docWeather == null) { + Log.e(TAG, "Invalid doc weather"); + return null; + } + + String strCity = null; + String strDate = null; + String strCondition = null; + String strCondition_code = null; + String strTemp = null; + String strTempUnit = null; + String strHumidity = null; + String strWindSpeed = null; + String strWindDir = null; + String strSpeedUnit = null; + String strHigh = null; + String strLow = null; + + try { + Element root = docWeather.getDocumentElement(); + root.normalize(); + + NamedNodeMap locationNode = root.getElementsByTagName(PARAM_YAHOO_LOCATION).item(0) + .getAttributes(); + if (locationNode != null) { + strCity = locationNode.getNamedItem(ATT_YAHOO_CITY).getNodeValue(); + } + + NamedNodeMap unitNode = root.getElementsByTagName(PARAM_YAHOO_UNIT).item(0) + .getAttributes(); + + if (locationNode != null) { + strTempUnit = unitNode.getNamedItem(ATT_YAHOO_TEMP_UNIT).getNodeValue(); + strSpeedUnit = unitNode.getNamedItem(ATT_YAHOO_SPEED).getNodeValue(); + } + + NamedNodeMap atmosNode = root.getElementsByTagName(PARAM_YAHOO_ATMOSPHERE).item(0) + .getAttributes(); + if (atmosNode != null) { + strHumidity = atmosNode.getNamedItem(ATT_YAHOO_HUMIDITY).getNodeValue(); + } + + NamedNodeMap conditionNode = root.getElementsByTagName(PARAM_YAHOO_CONDITION).item(0) + .getAttributes(); + if (conditionNode != null) { + strCondition = conditionNode.getNamedItem(ATT_YAHOO_TEXT).getNodeValue(); + strCondition_code = conditionNode.getNamedItem(ATT_YAHOO_CODE).getNodeValue(); + strCondition = WeatherInfo.getTranslatedConditionString(mContext, Integer.parseInt(strCondition_code), strCondition); + strTemp = conditionNode.getNamedItem(ATT_YAHOO_TEMP).getNodeValue(); + strDate = conditionNode.getNamedItem(ATT_YAHOO_DATE).getNodeValue(); + } + + NamedNodeMap temNode = root.getElementsByTagName(PARAM_YAHOO_WIND).item(0) + .getAttributes(); + if (temNode != null) { + strWindSpeed = temNode.getNamedItem(ATT_YAHOO_SPEED).getNodeValue(); + strWindDir = temNode.getNamedItem(ATT_YAHOO_DIRECTION).getNodeValue(); + } + + NamedNodeMap fcNode = root.getElementsByTagName(PARAM_YAHOO_FORECAST).item(0).getAttributes(); + if (fcNode != null) { + strHigh = fcNode.getNamedItem(ATT_YAHOO_TODAY_HIGH).getNodeValue(); + strLow = fcNode.getNamedItem(ATT_YAHOO_TODAY_LOW).getNodeValue(); + } + } catch (Exception e) { + Log.e(TAG, "Something wrong with parser data: " + e.toString()); + return null; + } + + /* Weather info */ + WeatherInfo yahooWeatherInfo = new WeatherInfo(mContext, strCity, strDate, strCondition, strCondition_code, strTemp, + strTempUnit, strHumidity, strWindSpeed, strWindDir, strSpeedUnit, strLow, strHigh, System.currentTimeMillis()); + + Log.d(TAG, "Weather updated for " + strCity + ": " + strDate + ", " + strCondition + "(" + strCondition_code + + "), " + strTemp + strTempUnit + ", " + strHumidity + "% humidity, " + ", wind: " + strWindDir + " at " + + strWindSpeed + strSpeedUnit + ", low: " + strLow + strTempUnit + " high: " + strHigh + strTempUnit); + + return yahooWeatherInfo; + } + + public String parsePlaceFinderResponse(String response) { + try { + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(new InputSource(new StringReader(response))); + + NodeList resultNodes = doc.getElementsByTagName("Result"); + + Node resultNode = resultNodes.item(0); + NodeList attrsList = resultNode.getChildNodes(); + + for (int i = 0; i < attrsList.getLength(); i++) { + Node node = attrsList.item(i); + Node firstChild = node.getFirstChild(); + if ("woeid".equalsIgnoreCase(node.getNodeName()) && firstChild != null) { + return firstChild.getNodeValue(); + } + } + } catch (Exception e) { + Log.e(TAG, e.toString()); + } + return null; + } +} diff --git a/core/java/com/android/internal/util/weather/YahooPlaceFinder.java b/core/java/com/android/internal/util/weather/YahooPlaceFinder.java new file mode 100644 index 0000000..fb8efe4 --- /dev/null +++ b/core/java/com/android/internal/util/weather/YahooPlaceFinder.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The AOKP Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.util.weather; + +import android.content.Context; + +public class YahooPlaceFinder { + + private static final String YAHOO_API_BASE_REV_URL = "http://where.yahooapis.com/geocode?appid=jYkTZp64&q=%1$s,+%2$s&gflags=R"; + private static final String YAHOO_API_BASE_URL = "http://where.yahooapis.com/geocode?appid=jYkTZp64&q=%1$s"; + + public static String reverseGeoCode(Context c, double latitude, double longitude) { + + String url = String.format(YAHOO_API_BASE_REV_URL, String.valueOf(latitude), + String.valueOf(longitude)); + String response = new HttpRetriever().retrieve(url); + return new WeatherXmlParser(c).parsePlaceFinderResponse(response); + + } + + public static String GeoCode(Context c, String location) { + String url = String.format(YAHOO_API_BASE_URL, location).replace(' ', '+'); + String response = new HttpRetriever().retrieve(url); + return new WeatherXmlParser(c).parsePlaceFinderResponse(response); + } + +} diff --git a/core/res/res/drawable-hdpi/weather_0.png b/core/res/res/drawable-hdpi/weather_0.png Binary files differnew file mode 100644 index 0000000..9e539b6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_0.png diff --git a/core/res/res/drawable-hdpi/weather_1.png b/core/res/res/drawable-hdpi/weather_1.png Binary files differnew file mode 100644 index 0000000..9e539b6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_1.png diff --git a/core/res/res/drawable-hdpi/weather_10.png b/core/res/res/drawable-hdpi/weather_10.png Binary files differnew file mode 100644 index 0000000..daf991e --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_10.png diff --git a/core/res/res/drawable-hdpi/weather_11.png b/core/res/res/drawable-hdpi/weather_11.png Binary files differnew file mode 100644 index 0000000..91a74a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_11.png diff --git a/core/res/res/drawable-hdpi/weather_12.png b/core/res/res/drawable-hdpi/weather_12.png Binary files differnew file mode 100644 index 0000000..91a74a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_12.png diff --git a/core/res/res/drawable-hdpi/weather_13.png b/core/res/res/drawable-hdpi/weather_13.png Binary files differnew file mode 100644 index 0000000..b2f41a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_13.png diff --git a/core/res/res/drawable-hdpi/weather_14.png b/core/res/res/drawable-hdpi/weather_14.png Binary files differnew file mode 100644 index 0000000..b2f41a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_14.png diff --git a/core/res/res/drawable-hdpi/weather_15.png b/core/res/res/drawable-hdpi/weather_15.png Binary files differnew file mode 100644 index 0000000..2e92b35 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_15.png diff --git a/core/res/res/drawable-hdpi/weather_16.png b/core/res/res/drawable-hdpi/weather_16.png Binary files differnew file mode 100644 index 0000000..bf4564c --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_16.png diff --git a/core/res/res/drawable-hdpi/weather_17.png b/core/res/res/drawable-hdpi/weather_17.png Binary files differnew file mode 100644 index 0000000..f7948c1 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_17.png diff --git a/core/res/res/drawable-hdpi/weather_18.png b/core/res/res/drawable-hdpi/weather_18.png Binary files differnew file mode 100644 index 0000000..802a80f --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_18.png diff --git a/core/res/res/drawable-hdpi/weather_19.png b/core/res/res/drawable-hdpi/weather_19.png Binary files differnew file mode 100644 index 0000000..b67ba5e --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_19.png diff --git a/core/res/res/drawable-hdpi/weather_2.png b/core/res/res/drawable-hdpi/weather_2.png Binary files differnew file mode 100644 index 0000000..9e539b6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_2.png diff --git a/core/res/res/drawable-hdpi/weather_20.png b/core/res/res/drawable-hdpi/weather_20.png Binary files differnew file mode 100644 index 0000000..fd40f33 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_20.png diff --git a/core/res/res/drawable-hdpi/weather_21.png b/core/res/res/drawable-hdpi/weather_21.png Binary files differnew file mode 100644 index 0000000..8349b21 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_21.png diff --git a/core/res/res/drawable-hdpi/weather_22.png b/core/res/res/drawable-hdpi/weather_22.png Binary files differnew file mode 100644 index 0000000..b67ba5e --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_22.png diff --git a/core/res/res/drawable-hdpi/weather_23.png b/core/res/res/drawable-hdpi/weather_23.png Binary files differnew file mode 100644 index 0000000..ca015be --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_23.png diff --git a/core/res/res/drawable-hdpi/weather_24.png b/core/res/res/drawable-hdpi/weather_24.png Binary files differnew file mode 100644 index 0000000..ca015be --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_24.png diff --git a/core/res/res/drawable-hdpi/weather_25.png b/core/res/res/drawable-hdpi/weather_25.png Binary files differnew file mode 100644 index 0000000..32cb0d8 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_25.png diff --git a/core/res/res/drawable-hdpi/weather_26.png b/core/res/res/drawable-hdpi/weather_26.png Binary files differnew file mode 100644 index 0000000..ce9761a --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_26.png diff --git a/core/res/res/drawable-hdpi/weather_27.png b/core/res/res/drawable-hdpi/weather_27.png Binary files differnew file mode 100644 index 0000000..67433a7 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_27.png diff --git a/core/res/res/drawable-hdpi/weather_28.png b/core/res/res/drawable-hdpi/weather_28.png Binary files differnew file mode 100644 index 0000000..43f3df8 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_28.png diff --git a/core/res/res/drawable-hdpi/weather_29.png b/core/res/res/drawable-hdpi/weather_29.png Binary files differnew file mode 100644 index 0000000..67433a7 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_29.png diff --git a/core/res/res/drawable-hdpi/weather_3.png b/core/res/res/drawable-hdpi/weather_3.png Binary files differnew file mode 100644 index 0000000..708a2e6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_3.png diff --git a/core/res/res/drawable-hdpi/weather_30.png b/core/res/res/drawable-hdpi/weather_30.png Binary files differnew file mode 100644 index 0000000..43f3df8 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_30.png diff --git a/core/res/res/drawable-hdpi/weather_31.png b/core/res/res/drawable-hdpi/weather_31.png Binary files differnew file mode 100644 index 0000000..d545d77 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_31.png diff --git a/core/res/res/drawable-hdpi/weather_32.png b/core/res/res/drawable-hdpi/weather_32.png Binary files differnew file mode 100644 index 0000000..c55e4b3 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_32.png diff --git a/core/res/res/drawable-hdpi/weather_33.png b/core/res/res/drawable-hdpi/weather_33.png Binary files differnew file mode 100644 index 0000000..d545d77 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_33.png diff --git a/core/res/res/drawable-hdpi/weather_34.png b/core/res/res/drawable-hdpi/weather_34.png Binary files differnew file mode 100644 index 0000000..c55e4b3 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_34.png diff --git a/core/res/res/drawable-hdpi/weather_35.png b/core/res/res/drawable-hdpi/weather_35.png Binary files differnew file mode 100644 index 0000000..3cd1b81 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_35.png diff --git a/core/res/res/drawable-hdpi/weather_36.png b/core/res/res/drawable-hdpi/weather_36.png Binary files differnew file mode 100644 index 0000000..06cb774 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_36.png diff --git a/core/res/res/drawable-hdpi/weather_37.png b/core/res/res/drawable-hdpi/weather_37.png Binary files differnew file mode 100644 index 0000000..8b2c4d1 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_37.png diff --git a/core/res/res/drawable-hdpi/weather_38.png b/core/res/res/drawable-hdpi/weather_38.png Binary files differnew file mode 100644 index 0000000..f0509ef --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_38.png diff --git a/core/res/res/drawable-hdpi/weather_39.png b/core/res/res/drawable-hdpi/weather_39.png Binary files differnew file mode 100644 index 0000000..8b2c4d1 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_39.png diff --git a/core/res/res/drawable-hdpi/weather_4.png b/core/res/res/drawable-hdpi/weather_4.png Binary files differnew file mode 100644 index 0000000..708a2e6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_4.png diff --git a/core/res/res/drawable-hdpi/weather_40.png b/core/res/res/drawable-hdpi/weather_40.png Binary files differnew file mode 100644 index 0000000..fb3c06d --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_40.png diff --git a/core/res/res/drawable-hdpi/weather_41.png b/core/res/res/drawable-hdpi/weather_41.png Binary files differnew file mode 100644 index 0000000..bf4564c --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_41.png diff --git a/core/res/res/drawable-hdpi/weather_42.png b/core/res/res/drawable-hdpi/weather_42.png Binary files differnew file mode 100644 index 0000000..7b81366 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_42.png diff --git a/core/res/res/drawable-hdpi/weather_43.png b/core/res/res/drawable-hdpi/weather_43.png Binary files differnew file mode 100644 index 0000000..bf4564c --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_43.png diff --git a/core/res/res/drawable-hdpi/weather_44.png b/core/res/res/drawable-hdpi/weather_44.png Binary files differnew file mode 100644 index 0000000..67433a7 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_44.png diff --git a/core/res/res/drawable-hdpi/weather_45.png b/core/res/res/drawable-hdpi/weather_45.png Binary files differnew file mode 100644 index 0000000..708a2e6 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_45.png diff --git a/core/res/res/drawable-hdpi/weather_46.png b/core/res/res/drawable-hdpi/weather_46.png Binary files differnew file mode 100644 index 0000000..b2f41a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_46.png diff --git a/core/res/res/drawable-hdpi/weather_47.png b/core/res/res/drawable-hdpi/weather_47.png Binary files differnew file mode 100644 index 0000000..f0509ef --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_47.png diff --git a/core/res/res/drawable-hdpi/weather_5.png b/core/res/res/drawable-hdpi/weather_5.png Binary files differnew file mode 100644 index 0000000..802a80f --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_5.png diff --git a/core/res/res/drawable-hdpi/weather_6.png b/core/res/res/drawable-hdpi/weather_6.png Binary files differnew file mode 100644 index 0000000..802a80f --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_6.png diff --git a/core/res/res/drawable-hdpi/weather_7.png b/core/res/res/drawable-hdpi/weather_7.png Binary files differnew file mode 100644 index 0000000..802a80f --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_7.png diff --git a/core/res/res/drawable-hdpi/weather_8.png b/core/res/res/drawable-hdpi/weather_8.png Binary files differnew file mode 100644 index 0000000..e36a680 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_8.png diff --git a/core/res/res/drawable-hdpi/weather_9.png b/core/res/res/drawable-hdpi/weather_9.png Binary files differnew file mode 100644 index 0000000..7651b3e --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_9.png diff --git a/core/res/res/drawable-hdpi/weather_na.png b/core/res/res/drawable-hdpi/weather_na.png Binary files differnew file mode 100644 index 0000000..4a43283 --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_na.png diff --git a/core/res/res/drawable-hdpi/weather_na_cid.png b/core/res/res/drawable-hdpi/weather_na_cid.png Binary files differnew file mode 100644 index 0000000..92759cb --- /dev/null +++ b/core/res/res/drawable-hdpi/weather_na_cid.png diff --git a/core/res/res/drawable-mdpi/weather_0.png b/core/res/res/drawable-mdpi/weather_0.png Binary files differnew file mode 100644 index 0000000..1553c55 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_0.png diff --git a/core/res/res/drawable-mdpi/weather_1.png b/core/res/res/drawable-mdpi/weather_1.png Binary files differnew file mode 100644 index 0000000..1553c55 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_1.png diff --git a/core/res/res/drawable-mdpi/weather_10.png b/core/res/res/drawable-mdpi/weather_10.png Binary files differnew file mode 100644 index 0000000..c44b8f7 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_10.png diff --git a/core/res/res/drawable-mdpi/weather_11.png b/core/res/res/drawable-mdpi/weather_11.png Binary files differnew file mode 100644 index 0000000..ee01b1cf --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_11.png diff --git a/core/res/res/drawable-mdpi/weather_12.png b/core/res/res/drawable-mdpi/weather_12.png Binary files differnew file mode 100644 index 0000000..ee01b1cf --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_12.png diff --git a/core/res/res/drawable-mdpi/weather_13.png b/core/res/res/drawable-mdpi/weather_13.png Binary files differnew file mode 100644 index 0000000..c922139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_13.png diff --git a/core/res/res/drawable-mdpi/weather_14.png b/core/res/res/drawable-mdpi/weather_14.png Binary files differnew file mode 100644 index 0000000..c922139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_14.png diff --git a/core/res/res/drawable-mdpi/weather_15.png b/core/res/res/drawable-mdpi/weather_15.png Binary files differnew file mode 100644 index 0000000..27dbc3f --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_15.png diff --git a/core/res/res/drawable-mdpi/weather_16.png b/core/res/res/drawable-mdpi/weather_16.png Binary files differnew file mode 100644 index 0000000..d575139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_16.png diff --git a/core/res/res/drawable-mdpi/weather_17.png b/core/res/res/drawable-mdpi/weather_17.png Binary files differnew file mode 100644 index 0000000..7ac7828 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_17.png diff --git a/core/res/res/drawable-mdpi/weather_18.png b/core/res/res/drawable-mdpi/weather_18.png Binary files differnew file mode 100644 index 0000000..a1ae654 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_18.png diff --git a/core/res/res/drawable-mdpi/weather_19.png b/core/res/res/drawable-mdpi/weather_19.png Binary files differnew file mode 100644 index 0000000..b750e26 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_19.png diff --git a/core/res/res/drawable-mdpi/weather_2.png b/core/res/res/drawable-mdpi/weather_2.png Binary files differnew file mode 100644 index 0000000..1553c55 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_2.png diff --git a/core/res/res/drawable-mdpi/weather_20.png b/core/res/res/drawable-mdpi/weather_20.png Binary files differnew file mode 100644 index 0000000..8790ddd --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_20.png diff --git a/core/res/res/drawable-mdpi/weather_21.png b/core/res/res/drawable-mdpi/weather_21.png Binary files differnew file mode 100644 index 0000000..242ab7a --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_21.png diff --git a/core/res/res/drawable-mdpi/weather_22.png b/core/res/res/drawable-mdpi/weather_22.png Binary files differnew file mode 100644 index 0000000..b750e26 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_22.png diff --git a/core/res/res/drawable-mdpi/weather_23.png b/core/res/res/drawable-mdpi/weather_23.png Binary files differnew file mode 100644 index 0000000..ddefbf1 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_23.png diff --git a/core/res/res/drawable-mdpi/weather_24.png b/core/res/res/drawable-mdpi/weather_24.png Binary files differnew file mode 100644 index 0000000..ddefbf1 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_24.png diff --git a/core/res/res/drawable-mdpi/weather_25.png b/core/res/res/drawable-mdpi/weather_25.png Binary files differnew file mode 100644 index 0000000..766d094 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_25.png diff --git a/core/res/res/drawable-mdpi/weather_26.png b/core/res/res/drawable-mdpi/weather_26.png Binary files differnew file mode 100644 index 0000000..1445f9e --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_26.png diff --git a/core/res/res/drawable-mdpi/weather_27.png b/core/res/res/drawable-mdpi/weather_27.png Binary files differnew file mode 100644 index 0000000..3835d5b --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_27.png diff --git a/core/res/res/drawable-mdpi/weather_28.png b/core/res/res/drawable-mdpi/weather_28.png Binary files differnew file mode 100644 index 0000000..a362aaf --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_28.png diff --git a/core/res/res/drawable-mdpi/weather_29.png b/core/res/res/drawable-mdpi/weather_29.png Binary files differnew file mode 100644 index 0000000..3835d5b --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_29.png diff --git a/core/res/res/drawable-mdpi/weather_3.png b/core/res/res/drawable-mdpi/weather_3.png Binary files differnew file mode 100644 index 0000000..0fd0158 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_3.png diff --git a/core/res/res/drawable-mdpi/weather_30.png b/core/res/res/drawable-mdpi/weather_30.png Binary files differnew file mode 100644 index 0000000..a362aaf --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_30.png diff --git a/core/res/res/drawable-mdpi/weather_31.png b/core/res/res/drawable-mdpi/weather_31.png Binary files differnew file mode 100644 index 0000000..886b845 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_31.png diff --git a/core/res/res/drawable-mdpi/weather_32.png b/core/res/res/drawable-mdpi/weather_32.png Binary files differnew file mode 100644 index 0000000..4e6827a --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_32.png diff --git a/core/res/res/drawable-mdpi/weather_33.png b/core/res/res/drawable-mdpi/weather_33.png Binary files differnew file mode 100644 index 0000000..886b845 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_33.png diff --git a/core/res/res/drawable-mdpi/weather_34.png b/core/res/res/drawable-mdpi/weather_34.png Binary files differnew file mode 100644 index 0000000..4e6827a --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_34.png diff --git a/core/res/res/drawable-mdpi/weather_35.png b/core/res/res/drawable-mdpi/weather_35.png Binary files differnew file mode 100644 index 0000000..b8ba7c4 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_35.png diff --git a/core/res/res/drawable-mdpi/weather_36.png b/core/res/res/drawable-mdpi/weather_36.png Binary files differnew file mode 100644 index 0000000..005295a --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_36.png diff --git a/core/res/res/drawable-mdpi/weather_37.png b/core/res/res/drawable-mdpi/weather_37.png Binary files differnew file mode 100644 index 0000000..290e2a2 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_37.png diff --git a/core/res/res/drawable-mdpi/weather_38.png b/core/res/res/drawable-mdpi/weather_38.png Binary files differnew file mode 100644 index 0000000..92785f5 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_38.png diff --git a/core/res/res/drawable-mdpi/weather_39.png b/core/res/res/drawable-mdpi/weather_39.png Binary files differnew file mode 100644 index 0000000..290e2a2 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_39.png diff --git a/core/res/res/drawable-mdpi/weather_4.png b/core/res/res/drawable-mdpi/weather_4.png Binary files differnew file mode 100644 index 0000000..0fd0158 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_4.png diff --git a/core/res/res/drawable-mdpi/weather_40.png b/core/res/res/drawable-mdpi/weather_40.png Binary files differnew file mode 100644 index 0000000..25fbd20 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_40.png diff --git a/core/res/res/drawable-mdpi/weather_41.png b/core/res/res/drawable-mdpi/weather_41.png Binary files differnew file mode 100644 index 0000000..d575139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_41.png diff --git a/core/res/res/drawable-mdpi/weather_42.png b/core/res/res/drawable-mdpi/weather_42.png Binary files differnew file mode 100644 index 0000000..f259805 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_42.png diff --git a/core/res/res/drawable-mdpi/weather_43.png b/core/res/res/drawable-mdpi/weather_43.png Binary files differnew file mode 100644 index 0000000..d575139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_43.png diff --git a/core/res/res/drawable-mdpi/weather_44.png b/core/res/res/drawable-mdpi/weather_44.png Binary files differnew file mode 100644 index 0000000..3835d5b --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_44.png diff --git a/core/res/res/drawable-mdpi/weather_45.png b/core/res/res/drawable-mdpi/weather_45.png Binary files differnew file mode 100644 index 0000000..0fd0158 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_45.png diff --git a/core/res/res/drawable-mdpi/weather_46.png b/core/res/res/drawable-mdpi/weather_46.png Binary files differnew file mode 100644 index 0000000..c922139 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_46.png diff --git a/core/res/res/drawable-mdpi/weather_47.png b/core/res/res/drawable-mdpi/weather_47.png Binary files differnew file mode 100644 index 0000000..92785f5 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_47.png diff --git a/core/res/res/drawable-mdpi/weather_5.png b/core/res/res/drawable-mdpi/weather_5.png Binary files differnew file mode 100644 index 0000000..a1ae654 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_5.png diff --git a/core/res/res/drawable-mdpi/weather_6.png b/core/res/res/drawable-mdpi/weather_6.png Binary files differnew file mode 100644 index 0000000..a1ae654 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_6.png diff --git a/core/res/res/drawable-mdpi/weather_7.png b/core/res/res/drawable-mdpi/weather_7.png Binary files differnew file mode 100644 index 0000000..a1ae654 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_7.png diff --git a/core/res/res/drawable-mdpi/weather_8.png b/core/res/res/drawable-mdpi/weather_8.png Binary files differnew file mode 100644 index 0000000..37a339e --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_8.png diff --git a/core/res/res/drawable-mdpi/weather_9.png b/core/res/res/drawable-mdpi/weather_9.png Binary files differnew file mode 100644 index 0000000..0a9c8c3 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_9.png diff --git a/core/res/res/drawable-mdpi/weather_na.png b/core/res/res/drawable-mdpi/weather_na.png Binary files differnew file mode 100644 index 0000000..48c2879 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_na.png diff --git a/core/res/res/drawable-mdpi/weather_na_cid.png b/core/res/res/drawable-mdpi/weather_na_cid.png Binary files differnew file mode 100644 index 0000000..52f4e27 --- /dev/null +++ b/core/res/res/drawable-mdpi/weather_na_cid.png diff --git a/core/res/res/drawable-xhdpi/weather_0.png b/core/res/res/drawable-xhdpi/weather_0.png Binary files differnew file mode 100644 index 0000000..335af4b --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_0.png diff --git a/core/res/res/drawable-xhdpi/weather_1.png b/core/res/res/drawable-xhdpi/weather_1.png Binary files differnew file mode 100644 index 0000000..335af4b --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_1.png diff --git a/core/res/res/drawable-xhdpi/weather_10.png b/core/res/res/drawable-xhdpi/weather_10.png Binary files differnew file mode 100644 index 0000000..9432a13 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_10.png diff --git a/core/res/res/drawable-xhdpi/weather_11.png b/core/res/res/drawable-xhdpi/weather_11.png Binary files differnew file mode 100644 index 0000000..3f7c5ad --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_11.png diff --git a/core/res/res/drawable-xhdpi/weather_12.png b/core/res/res/drawable-xhdpi/weather_12.png Binary files differnew file mode 100644 index 0000000..3f7c5ad --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_12.png diff --git a/core/res/res/drawable-xhdpi/weather_13.png b/core/res/res/drawable-xhdpi/weather_13.png Binary files differnew file mode 100644 index 0000000..3f9e500 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_13.png diff --git a/core/res/res/drawable-xhdpi/weather_14.png b/core/res/res/drawable-xhdpi/weather_14.png Binary files differnew file mode 100644 index 0000000..3f9e500 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_14.png diff --git a/core/res/res/drawable-xhdpi/weather_15.png b/core/res/res/drawable-xhdpi/weather_15.png Binary files differnew file mode 100644 index 0000000..2ad1e46 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_15.png diff --git a/core/res/res/drawable-xhdpi/weather_16.png b/core/res/res/drawable-xhdpi/weather_16.png Binary files differnew file mode 100644 index 0000000..4bad358 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_16.png diff --git a/core/res/res/drawable-xhdpi/weather_17.png b/core/res/res/drawable-xhdpi/weather_17.png Binary files differnew file mode 100644 index 0000000..6fced6c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_17.png diff --git a/core/res/res/drawable-xhdpi/weather_18.png b/core/res/res/drawable-xhdpi/weather_18.png Binary files differnew file mode 100644 index 0000000..aae6d11 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_18.png diff --git a/core/res/res/drawable-xhdpi/weather_19.png b/core/res/res/drawable-xhdpi/weather_19.png Binary files differnew file mode 100644 index 0000000..d8e5e82 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_19.png diff --git a/core/res/res/drawable-xhdpi/weather_2.png b/core/res/res/drawable-xhdpi/weather_2.png Binary files differnew file mode 100644 index 0000000..335af4b --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_2.png diff --git a/core/res/res/drawable-xhdpi/weather_20.png b/core/res/res/drawable-xhdpi/weather_20.png Binary files differnew file mode 100644 index 0000000..73cbc39 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_20.png diff --git a/core/res/res/drawable-xhdpi/weather_21.png b/core/res/res/drawable-xhdpi/weather_21.png Binary files differnew file mode 100644 index 0000000..800f484 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_21.png diff --git a/core/res/res/drawable-xhdpi/weather_22.png b/core/res/res/drawable-xhdpi/weather_22.png Binary files differnew file mode 100644 index 0000000..d8e5e82 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_22.png diff --git a/core/res/res/drawable-xhdpi/weather_23.png b/core/res/res/drawable-xhdpi/weather_23.png Binary files differnew file mode 100644 index 0000000..be446c2 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_23.png diff --git a/core/res/res/drawable-xhdpi/weather_24.png b/core/res/res/drawable-xhdpi/weather_24.png Binary files differnew file mode 100644 index 0000000..be446c2 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_24.png diff --git a/core/res/res/drawable-xhdpi/weather_25.png b/core/res/res/drawable-xhdpi/weather_25.png Binary files differnew file mode 100644 index 0000000..63f019a --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_25.png diff --git a/core/res/res/drawable-xhdpi/weather_26.png b/core/res/res/drawable-xhdpi/weather_26.png Binary files differnew file mode 100644 index 0000000..3eb5734 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_26.png diff --git a/core/res/res/drawable-xhdpi/weather_27.png b/core/res/res/drawable-xhdpi/weather_27.png Binary files differnew file mode 100644 index 0000000..abf4096 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_27.png diff --git a/core/res/res/drawable-xhdpi/weather_28.png b/core/res/res/drawable-xhdpi/weather_28.png Binary files differnew file mode 100644 index 0000000..0cbae30 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_28.png diff --git a/core/res/res/drawable-xhdpi/weather_29.png b/core/res/res/drawable-xhdpi/weather_29.png Binary files differnew file mode 100644 index 0000000..abf4096 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_29.png diff --git a/core/res/res/drawable-xhdpi/weather_3.png b/core/res/res/drawable-xhdpi/weather_3.png Binary files differnew file mode 100644 index 0000000..7dda34c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_3.png diff --git a/core/res/res/drawable-xhdpi/weather_30.png b/core/res/res/drawable-xhdpi/weather_30.png Binary files differnew file mode 100644 index 0000000..0cbae30 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_30.png diff --git a/core/res/res/drawable-xhdpi/weather_31.png b/core/res/res/drawable-xhdpi/weather_31.png Binary files differnew file mode 100644 index 0000000..16f2d9f --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_31.png diff --git a/core/res/res/drawable-xhdpi/weather_32.png b/core/res/res/drawable-xhdpi/weather_32.png Binary files differnew file mode 100644 index 0000000..409373d --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_32.png diff --git a/core/res/res/drawable-xhdpi/weather_33.png b/core/res/res/drawable-xhdpi/weather_33.png Binary files differnew file mode 100644 index 0000000..16f2d9f --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_33.png diff --git a/core/res/res/drawable-xhdpi/weather_34.png b/core/res/res/drawable-xhdpi/weather_34.png Binary files differnew file mode 100644 index 0000000..409373d --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_34.png diff --git a/core/res/res/drawable-xhdpi/weather_35.png b/core/res/res/drawable-xhdpi/weather_35.png Binary files differnew file mode 100644 index 0000000..445b884 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_35.png diff --git a/core/res/res/drawable-xhdpi/weather_36.png b/core/res/res/drawable-xhdpi/weather_36.png Binary files differnew file mode 100644 index 0000000..a424ad6 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_36.png diff --git a/core/res/res/drawable-xhdpi/weather_37.png b/core/res/res/drawable-xhdpi/weather_37.png Binary files differnew file mode 100644 index 0000000..e98c8b8 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_37.png diff --git a/core/res/res/drawable-xhdpi/weather_38.png b/core/res/res/drawable-xhdpi/weather_38.png Binary files differnew file mode 100644 index 0000000..b47249c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_38.png diff --git a/core/res/res/drawable-xhdpi/weather_39.png b/core/res/res/drawable-xhdpi/weather_39.png Binary files differnew file mode 100644 index 0000000..e98c8b8 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_39.png diff --git a/core/res/res/drawable-xhdpi/weather_4.png b/core/res/res/drawable-xhdpi/weather_4.png Binary files differnew file mode 100644 index 0000000..7dda34c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_4.png diff --git a/core/res/res/drawable-xhdpi/weather_40.png b/core/res/res/drawable-xhdpi/weather_40.png Binary files differnew file mode 100644 index 0000000..1505fea --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_40.png diff --git a/core/res/res/drawable-xhdpi/weather_41.png b/core/res/res/drawable-xhdpi/weather_41.png Binary files differnew file mode 100644 index 0000000..4bad358 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_41.png diff --git a/core/res/res/drawable-xhdpi/weather_42.png b/core/res/res/drawable-xhdpi/weather_42.png Binary files differnew file mode 100644 index 0000000..196026d --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_42.png diff --git a/core/res/res/drawable-xhdpi/weather_43.png b/core/res/res/drawable-xhdpi/weather_43.png Binary files differnew file mode 100644 index 0000000..4bad358 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_43.png diff --git a/core/res/res/drawable-xhdpi/weather_44.png b/core/res/res/drawable-xhdpi/weather_44.png Binary files differnew file mode 100644 index 0000000..abf4096 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_44.png diff --git a/core/res/res/drawable-xhdpi/weather_45.png b/core/res/res/drawable-xhdpi/weather_45.png Binary files differnew file mode 100644 index 0000000..7dda34c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_45.png diff --git a/core/res/res/drawable-xhdpi/weather_46.png b/core/res/res/drawable-xhdpi/weather_46.png Binary files differnew file mode 100644 index 0000000..3f9e500 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_46.png diff --git a/core/res/res/drawable-xhdpi/weather_47.png b/core/res/res/drawable-xhdpi/weather_47.png Binary files differnew file mode 100644 index 0000000..b47249c --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_47.png diff --git a/core/res/res/drawable-xhdpi/weather_5.png b/core/res/res/drawable-xhdpi/weather_5.png Binary files differnew file mode 100644 index 0000000..aae6d11 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_5.png diff --git a/core/res/res/drawable-xhdpi/weather_6.png b/core/res/res/drawable-xhdpi/weather_6.png Binary files differnew file mode 100644 index 0000000..aae6d11 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_6.png diff --git a/core/res/res/drawable-xhdpi/weather_7.png b/core/res/res/drawable-xhdpi/weather_7.png Binary files differnew file mode 100644 index 0000000..aae6d11 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_7.png diff --git a/core/res/res/drawable-xhdpi/weather_8.png b/core/res/res/drawable-xhdpi/weather_8.png Binary files differnew file mode 100644 index 0000000..1a7e699 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_8.png diff --git a/core/res/res/drawable-xhdpi/weather_9.png b/core/res/res/drawable-xhdpi/weather_9.png Binary files differnew file mode 100644 index 0000000..0da4419 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_9.png diff --git a/core/res/res/drawable-xhdpi/weather_na.png b/core/res/res/drawable-xhdpi/weather_na.png Binary files differnew file mode 100644 index 0000000..8125ce2 --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_na.png diff --git a/core/res/res/drawable-xhdpi/weather_na_cid.png b/core/res/res/drawable-xhdpi/weather_na_cid.png Binary files differnew file mode 100644 index 0000000..daa2bfb --- /dev/null +++ b/core/res/res/drawable-xhdpi/weather_na_cid.png diff --git a/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml b/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml index 4fafc3c..85455d5 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml @@ -38,12 +38,100 @@ android:visibility="gone" /> + <!-- CyanogenMod Weather Panel --> + <RelativeLayout + android:id="@+id/weather_panel" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:orientation="horizontal" > + + <ImageView + android:id="@+id/weather_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:src="@android:drawable/ic_dialog_alert" /> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@id/weather_image" + android:orientation="horizontal" + android:padding="4dip" > + + <TextView + android:id="@+id/weather_city" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="14sp" + android:textStyle="bold" + android:layout_alignParentRight="true" + android:textColor="?android:attr/textColorPrimary"/> + + <TextView + android:id="@+id/weather_condition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_city" + android:layout_alignParentRight="true" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + <TextView + android:id="@+id/update_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_condition" + android:layout_alignParentRight="true" + android:textSize="6sp" + android:textColor="?android:attr/textColorSecondary" /> + + </RelativeLayout> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/weather_image" + android:orientation="horizontal" + android:layout_centerVertical="true" > + + <TextView + android:id="@+id/weather_temp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:textSize="20sp" + android:textColor="?android:attr/textColorPrimary" /> + + <View + android:id="@+id/weather_divider" + android:layout_below="@id/weather_temp" + android:layout_width="44dip" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> + + <TextView + android:id="@+id/weather_low_high" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_divider" + android:layout_centerHorizontal="true" + android:paddingTop="2dip" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + </RelativeLayout> + + </RelativeLayout> + <com.android.internal.widget.DigitalClock android:id="@+id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dip" - android:layout_marginBottom="8dip" - > + android:layout_marginBottom="8dip" > <!-- Because we can't have multi-tone fonts, we render two TextViews, one on top of the other. Hence the redundant layout... --> diff --git a/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml b/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml index dfab3e3..489edea 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml @@ -40,11 +40,100 @@ android:visibility="gone" /> + <!-- CyanogenMod Weather Panel --> + <RelativeLayout + android:id="@+id/weather_panel" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:orientation="horizontal" > + + <ImageView + android:id="@+id/weather_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:src="@android:drawable/ic_dialog_alert" /> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@id/weather_image" + android:orientation="horizontal" + android:padding="4dip" > + + <TextView + android:id="@+id/weather_city" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="14sp" + android:textStyle="bold" + android:layout_alignParentRight="true" + android:textColor="?android:attr/textColorPrimary"/> + + <TextView + android:id="@+id/weather_condition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_city" + android:layout_alignParentRight="true" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + <TextView + android:id="@+id/update_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_condition" + android:layout_alignParentRight="true" + android:textSize="6sp" + android:textColor="?android:attr/textColorSecondary" /> + + </RelativeLayout> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/weather_image" + android:orientation="horizontal" + android:layout_centerVertical="true" > + + <TextView + android:id="@+id/weather_temp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:textSize="20sp" + android:textColor="?android:attr/textColorPrimary" /> + + <View + android:id="@+id/weather_divider" + android:layout_below="@id/weather_temp" + android:layout_width="44dip" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> + + <TextView + android:id="@+id/weather_low_high" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_divider" + android:layout_centerHorizontal="true" + android:paddingTop="2dip" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + </RelativeLayout> + + </RelativeLayout> + <com.android.internal.widget.DigitalClock android:id="@+id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dip" - android:layout_marginBottom="8dip"> + android:layout_marginBottom="8dip" > <!-- Because we can't have multi-tone fonts, we render two TextViews, one on top of the other. Hence the redundant layout... --> diff --git a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml index 73dadb4..929adf7 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml @@ -53,6 +53,7 @@ /> <include layout="@layout/keyguard_screen_status_port" + android:id="@+id/screen_status_port" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="50dip" @@ -121,4 +122,3 @@ </LinearLayout> </LinearLayout> - diff --git a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml index 10b1ace..d4a2d75 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml @@ -51,6 +51,7 @@ /> <include layout="@layout/keyguard_screen_status_land" + android:id="@+id/screen_status_land" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="50dip" @@ -60,9 +61,9 @@ android:layout_alignParentTop="true" android:layout_alignParentLeft="true"/> - </RelativeLayout> + </RelativeLayout> - </RelativeLayout> + </RelativeLayout> <!-- right side --> <RelativeLayout diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml index 0ec8f75..31804b0 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml @@ -102,6 +102,97 @@ android:drawablePadding="4dip" /> + <!-- CyanogenMod Weather Panel --> + <RelativeLayout + android:id="@+id/weather_panel" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingTop="4dip" > + + <ImageView + android:id="@+id/weather_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:src="@android:drawable/ic_dialog_alert" /> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@id/weather_image" + android:orientation="horizontal" + android:padding="4dip" > + + <TextView + android:id="@+id/weather_city" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="14sp" + android:textStyle="bold" + android:layout_alignParentRight="true" + android:textColor="?android:attr/textColorPrimary"/> + + <TextView + android:id="@+id/weather_condition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_city" + android:layout_alignParentRight="true" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + <TextView + android:id="@+id/update_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_condition" + android:layout_alignParentRight="true" + android:textSize="6sp" + android:textColor="?android:attr/textColorSecondary" /> + + </RelativeLayout> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/weather_image" + android:orientation="horizontal" + android:layout_centerVertical="true" > + + <TextView + android:id="@+id/weather_temp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:textSize="20sp" + android:textColor="?android:attr/textColorPrimary" /> + + <View + android:id="@+id/weather_divider" + android:layout_below="@id/weather_temp" + android:layout_width="44dip" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> + + <TextView + android:id="@+id/weather_low_high" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_divider" + android:layout_centerHorizontal="true" + android:paddingTop="2dip" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + </RelativeLayout> + + </RelativeLayout> + <Space android:layout_gravity="fill" /> <!-- emergency call button shown when sim is PUKd and tab_selector is hidden --> @@ -121,7 +212,7 @@ <RelativeLayout android:layout_width="match_parent" - android:layout_height="302dip"> + android:layout_height="292dip"> <!-- was 302 --> <com.android.internal.widget.multiwaveview.MultiWaveView android:id="@+id/unlock_widget" @@ -188,7 +279,7 @@ layout="@layout/keyguard_transport_control" android:layout_row="0" android:layout_column="0" - android:layout_rowSpan="4" + android:layout_rowSpan="5" android:layout_columnSpan="1" android:layout_gravity="fill" android:layout_width="0dip" diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml index 294f91e..16acf18 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml @@ -30,8 +30,9 @@ <!-- Column 0 --> <com.android.internal.widget.DigitalClock android:id="@+id/time" - android:layout_marginTop="80dip" + android:layout_marginTop="40dip" android:layout_marginBottom="8dip" + android:layout_columnSpan="3" android:layout_gravity="right"> <!-- Because we can't have multi-tone fonts, we render two TextViews, one on @@ -64,7 +65,7 @@ <TextView android:id="@+id/date" - android:layout_width="0dip" + android:layout_columnSpan="3" android:layout_gravity="fill_horizontal" android:gravity="right" android:layout_marginTop="6dip" @@ -76,6 +77,7 @@ <TextView android:id="@+id/alarm_status" + android:layout_columnSpan="3" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceMedium" @@ -87,7 +89,7 @@ <TextView android:id="@+id/status1" - android:layout_width="0dip" + android:layout_columnSpan="3" android:layout_gravity="fill_horizontal" android:gravity="right" android:layout_marginTop="4dip" @@ -98,11 +100,102 @@ android:drawablePadding="4dip" /> + <!-- CyanogenMod Weather Panel --> + <RelativeLayout + android:id="@+id/weather_panel" + android:layout_columnSpan="3" + android:gravity="right" + android:layout_gravity="fill_horizontal" + android:layout_height="wrap_content" + android:orientation="horizontal" > + + <ImageView + android:id="@+id/weather_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:src="@android:drawable/ic_dialog_alert" /> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@id/weather_image" + android:orientation="horizontal" + android:padding="4dip" > + + <TextView + android:id="@+id/weather_city" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="14sp" + android:textStyle="bold" + android:layout_alignParentRight="true" + android:textColor="?android:attr/textColorPrimary"/> + + <TextView + android:id="@+id/weather_condition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_city" + android:layout_alignParentRight="true" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + <TextView + android:id="@+id/update_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_condition" + android:layout_alignParentRight="true" + android:textSize="6sp" + android:textColor="?android:attr/textColorSecondary" /> + + </RelativeLayout> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/weather_image" + android:orientation="horizontal" + android:layout_centerVertical="true" > + + <TextView + android:id="@+id/weather_temp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:textSize="20sp" + android:textColor="?android:attr/textColorPrimary" /> + + <View + android:id="@+id/weather_divider" + android:layout_below="@id/weather_temp" + android:layout_width="44dip" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> + + <TextView + android:id="@+id/weather_low_high" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/weather_divider" + android:layout_centerHorizontal="true" + android:paddingTop="2dip" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimary" /> + + </RelativeLayout> + + </RelativeLayout> + <Space android:layout_gravity="fill" /> <TextView android:id="@+id/carrier" - android:layout_width="0dip" + android:layout_columnSpan="3" android:layout_gravity="fill_horizontal" android:layout_marginBottom="12dip" android:gravity="right" diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index e2441a5..9baf842 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -1255,4 +1255,70 @@ <!--Application killed toast --> <string name="app_killed_message">Anwendung beendet</string> + + <!-- Lock screen Weather - Weather codes --> + <string name="weather_0">Tornado</string> + <string name="weather_1">Tropensturm</string> + <string name="weather_2">Hurrikan</string> + <string name="weather_3">Heftige Gewitter</string> + <string name="weather_4">Gewitter</string> + <string name="weather_5">Wechselnd Regen und Schnee</string> + <string name="weather_6">Wechselnd Regen und Schneeregen</string> + <string name="weather_7">Wechselnd Schnee und Schneeregen</string> + <string name="weather_8">Gefrierender Niesel</string> + <string name="weather_9">Niesel</string> + <string name="weather_10">Gefrierender Regen</string> + <string name="weather_11">Schauer</string> + <string name="weather_12">Schauer</string> + <string name="weather_13">Scheegestöber</string> + <string name="weather_14">Leichte Schneeschauer</string> + <string name="weather_15">Schneesturm</string> + <string name="weather_16">Schnee</string> + <string name="weather_17">Hagel</string> + <string name="weather_18">Schneeregen</string> + <string name="weather_19">Staubig</string> + <string name="weather_20">Neblig</string> + <string name="weather_21">Dunst</string> + <string name="weather_22">Rauch</string> + <string name="weather_23">Stürmisch</string> + <string name="weather_24">Windig</string> + <string name="weather_25">Kalt</string> + <string name="weather_26">Bedeckt</string> + <string name="weather_27">Stark bewölkt</string> <!-- Night --> + <string name="weather_28">Stark bewölkt</string> <!-- Day --> + <string name="weather_29">Teilweise bewölkt</string> <!-- Night --> + <string name="weather_30">Teilweise bewölkt</string> <!-- Day --> + <string name="weather_31">Klar</string> <!-- Night --> + <string name="weather_32">Sonnig</string> + <string name="weather_33">Heiter</string> <!-- Night --> + <string name="weather_34">Heiter</string> <!-- Day --> + <string name="weather_35">Wechselnd Regen und Hagel</string> + <string name="weather_36">Heiß</string> + <string name="weather_37">Örtliche Gewitter</string> + <string name="weather_38">Einzelne Gewitter</string> + <string name="weather_39">Einzelne Gewitter</string> + <string name="weather_40">Einzelne Schauer</string> + <string name="weather_41">Heftiger Schneefall</string> + <string name="weather_42">Einzelne Schneeschauer</string> + <string name="weather_43">Heftiger Schneefall</string> + <string name="weather_44">Teilweise bewölkt</string> + <string name="weather_45">Gewitterschauer</string> + <string name="weather_46">Schneeschauer</string> + <string name="weather_47">Örtliche Gewitterschauer</string> + <!-- Forecast unavailable --> + <string name="weather_3200"></string> + + <!-- Lock screen Weather - Wind directions --> + <string name="weather_N">N</string> + <string name="weather_NE">NO</string> + <string name="weather_E">O</string> + <string name="weather_SE">SO</string> + <string name="weather_S">S</string> + <string name="weather_SW">SW</string> + <string name="weather_W">W</string> + <string name="weather_NW">NW</string> + + <!-- Lock screen Weather - error messages --> + <string name="weather_tap_to_refresh">Zum Aktualisieren berühren</string> + </resources> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 193ec42..537926b 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3444,4 +3444,69 @@ <!--Application killed toast --> <string name="app_killed_message">Application killed</string> + <!-- Lock screen Weather - Weather codes --> + <string name="weather_0">Tornado</string> + <string name="weather_1">Tropical Storm</string> + <string name="weather_2">Hurricane</string> + <string name="weather_3">Severe Thunderstorms</string> + <string name="weather_4">Thunderstorms</string> + <string name="weather_5">Mixed Rain and Snow</string> + <string name="weather_6">Mixed Rain and Sleet</string> + <string name="weather_7">Mixed Snow and Sleet</string> + <string name="weather_8">Freezing Drizzle</string> + <string name="weather_9">Drizzle</string> + <string name="weather_10">Freezing Rain</string> + <string name="weather_11">Showers</string> + <string name="weather_12">Showers</string> + <string name="weather_13">Snow Flurries</string> + <string name="weather_14">Light Snow Showers</string> + <string name="weather_15">Blowing Snow</string> + <string name="weather_16">Snow</string> + <string name="weather_17">Hail</string> + <string name="weather_18">Sleet</string> + <string name="weather_19">Dust</string> + <string name="weather_20">Foggy</string> + <string name="weather_21">Haze</string> + <string name="weather_22">Smoky</string> + <string name="weather_23">Blustery</string> + <string name="weather_24">Windy</string> + <string name="weather_25">Cold</string> + <string name="weather_26">Cloudy</string> + <string name="weather_27">Mostly Cloudy</string> <!-- Night --> + <string name="weather_28">Mostly Cloudy</string> <!-- Day --> + <string name="weather_29">Partly Cloudy</string> <!-- Night --> + <string name="weather_30">Partly Cloudy</string> <!-- Day --> + <string name="weather_31">Clear</string> <!-- Night --> + <string name="weather_32">Sunny</string> + <string name="weather_33">Fair</string> <!-- Night --> + <string name="weather_34">Fair</string> <!-- Day --> + <string name="weather_35">Mixed Rain and Hail</string> + <string name="weather_36">Hot</string> + <string name="weather_37">Isolated Thunderstorms</string> + <string name="weather_38">Scattered Thunderstorms</string> + <string name="weather_39">Scattered Thunderstorms</string> + <string name="weather_40">Scattered Showers</string> + <string name="weather_41">Heavy Snow</string> + <string name="weather_42">Scattered Snow Showers</string> + <string name="weather_43">Heavy Snow</string> + <string name="weather_44">Partly Cloudy</string> + <string name="weather_45">Thundershowers</string> + <string name="weather_46">Snow Showers</string> + <string name="weather_47">Isolated Thundershowers</string> + <!-- Forecast unavailable --> + <string name="weather_3200"></string> + + <!-- Lock screen Weather - Wind directions --> + <string name="weather_N">N</string> + <string name="weather_NE">NE</string> + <string name="weather_E">E</string> + <string name="weather_SE">SE</string> + <string name="weather_S">S</string> + <string name="weather_SW">SW</string> + <string name="weather_W">W</string> + <string name="weather_NW">NW</string> + + <!-- Lock screen Weather - error messages --> + <string name="weather_tap_to_refresh">Tap to refresh</string> + </resources> diff --git a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java index 76d3df0..150d3bb 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java @@ -16,20 +16,22 @@ package com.android.internal.policy.impl; -import com.android.internal.R; -import com.android.internal.telephony.IccCard; -import com.android.internal.telephony.IccCard.State; -import com.android.internal.widget.LockPatternUtils; -import com.android.internal.widget.TransportControlView; -import com.android.internal.policy.impl.KeyguardUpdateMonitor.SimStateCallback; - +import java.io.IOException; import java.util.ArrayList; import java.util.Date; import libcore.util.MutableInt; +import org.w3c.dom.Document; + import android.content.ContentResolver; import android.content.Context; +import android.content.res.Resources; +import android.location.Criteria; +import android.location.Location; +import android.location.LocationManager; +import android.os.Handler; +import android.os.Message; import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; @@ -37,8 +39,21 @@ import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; +import android.widget.ImageView; +import android.widget.RelativeLayout; import android.widget.TextView; +import com.android.internal.R; +import com.android.internal.policy.impl.KeyguardUpdateMonitor.SimStateCallback; +import com.android.internal.telephony.IccCard; +import com.android.internal.telephony.IccCard.State; +import com.android.internal.util.weather.HttpRetriever; +import com.android.internal.util.weather.WeatherInfo; +import com.android.internal.util.weather.WeatherXmlParser; +import com.android.internal.util.weather.YahooPlaceFinder; +import com.android.internal.widget.LockPatternUtils; +import com.android.internal.widget.TransportControlView; + /*** * Manages a number of views inside of LockScreen layouts. See below for a list of widgets * @@ -72,6 +87,9 @@ class KeyguardStatusViewManager implements OnClickListener { private TextView mOwnerInfoView; private TextView mAlarmStatusView; private TransportControlView mTransportView; + private RelativeLayout mWeatherPanel; + private TextView mWeatherCity, mWeatherCondition, mWeatherLowHigh, mWeatherTemp, mUpdateTime; + private ImageView mWeatherImage; // Top-level container view for above views private View mContainer; @@ -182,6 +200,21 @@ class KeyguardStatusViewManager implements OnClickListener { mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton); mEmergencyCallButtonEnabledInScreen = emergencyButtonEnabledInScreen; + // Weather panel + mWeatherPanel = (RelativeLayout) findViewById(R.id.weather_panel); + mWeatherCity = (TextView) findViewById(R.id.weather_city); + mWeatherCondition = (TextView) findViewById(R.id.weather_condition); + mWeatherImage = (ImageView) findViewById(R.id.weather_image); + mWeatherTemp = (TextView) findViewById(R.id.weather_temp); + mWeatherLowHigh = (TextView) findViewById(R.id.weather_low_high); + mUpdateTime = (TextView) findViewById(R.id.update_time); + + // Hide Weather panel view until we know we need to show it. + if (mWeatherPanel != null) { + mWeatherPanel.setVisibility(View.GONE); + mWeatherPanel.setOnClickListener(this); + } + // Hide transport control view until we know we need to show it. if (mTransportView != null) { mTransportView.setVisibility(View.GONE); @@ -201,6 +234,7 @@ class KeyguardStatusViewManager implements OnClickListener { resetStatusInfo(); refreshDate(); updateOwnerInfo(); + refreshWeather(); // Required to get Marquee to work. final View scrollableViews[] = { mCarrierView, mDateView, mStatus1View, mOwnerInfoView, @@ -212,6 +246,252 @@ class KeyguardStatusViewManager implements OnClickListener { } } + /* + * CyanogenMod Lock screen Weather related functionality + */ + private static final String URL_YAHOO_API_WEATHER = "http://weather.yahooapis.com/forecastrss?w=%s&u="; + private static WeatherInfo mWeatherInfo = new WeatherInfo(); + private static final int QUERY_WEATHER = 0; + private static final int UPDATE_WEATHER = 1; + + private Handler mHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case QUERY_WEATHER: + Thread queryWeather = new Thread(new Runnable() { + @Override + public void run() { + LocationManager locationManager = (LocationManager) getContext(). + getSystemService(Context.LOCATION_SERVICE); + final ContentResolver resolver = getContext().getContentResolver(); + boolean useCustomLoc = Settings.System.getInt(resolver, + Settings.System.WEATHER_USE_CUSTOM_LOCATION, 0) == 1; + String customLoc = Settings.System.getString(resolver, + Settings.System.WEATHER_CUSTOM_LOCATION); + String woeid = null; + + // custom location + if (customLoc != null && useCustomLoc) { + try { + woeid = YahooPlaceFinder.GeoCode(getContext().getApplicationContext(), customLoc); + if (DEBUG) + Log.d(TAG, "Yahoo location code for " + customLoc + " is " + woeid); + } catch (Exception e) { + Log.e(TAG, "ERROR: Could not get Location code"); + e.printStackTrace(); + } + // network location + } else { + Criteria crit = new Criteria(); + crit.setAccuracy(Criteria.ACCURACY_COARSE); + String bestProvider = locationManager.getBestProvider(crit, true); + Location loc = null; + if (bestProvider != null) { + loc = locationManager.getLastKnownLocation(bestProvider); + } else { + loc = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER); + } + try { + woeid = YahooPlaceFinder.reverseGeoCode(getContext(), loc.getLatitude(), + loc.getLongitude()); + if (DEBUG) + Log.d(TAG, "Yahoo location code for current geolocation is " + woeid); + } catch (Exception e) { + Log.e(TAG, "ERROR: Could not get Location code"); + e.printStackTrace(); + } + } + Message msg = Message.obtain(); + msg.what = UPDATE_WEATHER; + msg.obj = woeid; + mHandler.sendMessage(msg); + } + }); + queryWeather.setPriority(Thread.MIN_PRIORITY); + queryWeather.start(); + break; + case UPDATE_WEATHER: + String woeid = (String) msg.obj; + if (woeid != null) { + if (DEBUG) { + Log.d(TAG, "Location code is " + woeid); + } + WeatherInfo w = null; + try { + w = parseXml(getDocument(woeid)); + } catch (Exception e) { + } + if (w == null) { + setNoWeatherData(); + } else { + setWeatherData(w); + mWeatherInfo = w; + } + } else { + if (mWeatherInfo.temp.equals(WeatherInfo.NODATA)) { + setNoWeatherData(); + } else { + setWeatherData(mWeatherInfo); + } + } + break; + } + } + }; + + /** + * Reload the weather forecast + */ + private void refreshWeather() { + final ContentResolver resolver = getContext().getContentResolver(); + boolean showWeather = Settings.System.getInt(resolver,Settings.System.LOCKSCREEN_WEATHER, 0) == 1; + if (showWeather) { + final long interval = Settings.System.getLong(resolver, + Settings.System.WEATHER_UPDATE_INTERVAL, 60); // Default to hourly + if (((System.currentTimeMillis() - mWeatherInfo.last_sync) / 60000) >= interval) { + mHandler.sendEmptyMessage(QUERY_WEATHER); + } else { + setWeatherData(mWeatherInfo); + } + } else { + // Hide the Weather panel view + if (mWeatherPanel != null) { + mWeatherPanel.setVisibility(View.GONE); + } + } + } + + /** + * Display the weather information + * @param w + */ + private void setWeatherData(WeatherInfo w) { + final ContentResolver resolver = getContext().getContentResolver(); + final Resources res = getContext().getResources(); + boolean showLocation = Settings.System.getInt(resolver, + Settings.System.WEATHER_SHOW_LOCATION, 1) == 1; + boolean showTimestamp = Settings.System.getInt(resolver, + Settings.System.WEATHER_SHOW_TIMESTAMP, 1) == 1; + + if (mWeatherPanel != null) { + if (mWeatherCity != null) { + mWeatherCity.setText(w.city); + mWeatherCity.setVisibility(showLocation ? View.VISIBLE : View.GONE); + } + if (mWeatherCondition != null) { + mWeatherCondition.setText(w.condition); + } + if (mUpdateTime != null) { + Date lastTime = new Date(mWeatherInfo.last_sync); + String date = DateFormat.getDateFormat(getContext()).format(lastTime); + String time = DateFormat.getTimeFormat(getContext()).format(lastTime); + mUpdateTime.setText(date + " " + time); + mUpdateTime.setVisibility(showTimestamp ? View.VISIBLE : View.GONE); + } + if (mWeatherTemp != null) { + mWeatherTemp.setText(w.temp); + } + if (mWeatherLowHigh != null) { + mWeatherLowHigh.setText(w.low + " | " + w.high); + } + + if (mWeatherImage != null) { + String conditionCode = w.condition_code; + String condition_filename = "weather_" + conditionCode; + int resID = res.getIdentifier(condition_filename, "drawable", + getContext().getPackageName()); + + if (DEBUG) + Log.d("Weather", "Condition:" + conditionCode + " ID:" + resID); + + if (resID != 0) { + mWeatherImage.setImageDrawable(res.getDrawable(resID)); + } else { + mWeatherImage.setImageResource(R.drawable.weather_na); + } + } + + // Show the Weather panel view + mWeatherPanel.setVisibility(View.VISIBLE); + } + } + + /** + * There is no data to display, display 'empty' fields and the + * 'Tap to reload' message + */ + private void setNoWeatherData() { + final ContentResolver resolver = getContext().getContentResolver(); + boolean useMetric = Settings.System.getInt(resolver, + Settings.System.WEATHER_USE_METRIC, 1) == 1; + + if (mWeatherPanel != null) { + if (mWeatherCity != null) { + mWeatherCity.setText("CM Weather"); //Hard coding this on purpose + mWeatherCity.setVisibility(View.VISIBLE); + } + if (mWeatherCondition != null) { + mWeatherCondition.setText(R.string.weather_tap_to_refresh); + } + if (mUpdateTime != null) { + mUpdateTime.setVisibility(View.GONE); + } + if (mWeatherTemp != null) { + mWeatherTemp.setText(useMetric ? "0°c" : "0°f"); + } + if (mWeatherLowHigh != null) { + mWeatherLowHigh.setText("0° | 0°"); + } + if (mWeatherImage != null) { + mWeatherImage.setImageResource(R.drawable.weather_na_cid); + } + + // Show the Weather panel view + mWeatherPanel.setVisibility(View.VISIBLE); + } + } + + /** + * Get the weather forecast XML document for a specific location + * @param woeid + * @return + */ + private Document getDocument(String woeid) { + try { + boolean celcius = Settings.System.getInt(getContext().getContentResolver(), + Settings.System.WEATHER_USE_METRIC, 1) == 1; + String urlWithDegreeUnit; + + if (celcius) { + urlWithDegreeUnit = URL_YAHOO_API_WEATHER + "c"; + } else { + urlWithDegreeUnit = URL_YAHOO_API_WEATHER + "f"; + } + + return new HttpRetriever().getDocumentFromURL(String.format(urlWithDegreeUnit, woeid)); + } catch (IOException e) { + Log.e(TAG, "Error querying Yahoo weather"); + } + + return null; + } + + /** + * Parse the weather XML document + * @param wDoc + * @return + */ + private WeatherInfo parseXml(Document wDoc) { + try { + return new WeatherXmlParser(getContext()).parseWeatherResponse(wDoc); + } catch (Exception e) { + Log.e(TAG, "Error parsing Yahoo weather XML document"); + e.printStackTrace(); + } + return null; + } + private boolean inWidgetMode() { return mTransportView != null && mTransportView.getVisibility() == View.VISIBLE; } @@ -663,6 +943,10 @@ class KeyguardStatusViewManager implements OnClickListener { public void onClick(View v) { if (v == mEmergencyCallButton) { mCallback.takeEmergencyCallAction(); + } else if (v == mWeatherPanel) { + if (!mHandler.hasMessages(QUERY_WEATHER)) { + mHandler.sendEmptyMessage(QUERY_WEATHER); + } } } |
