diff options
author | DvTonder <david.vantonder@gmail.com> | 2012-11-24 21:52:16 -0500 |
---|---|---|
committer | DvTonder <david.vantonder@gmail.com> | 2012-11-24 21:58:36 -0500 |
commit | 0c330122aab023b524b9479010e1d63fc30710de (patch) | |
tree | f279cad8972a6767561aa278b849055c8892449b | |
parent | 31865f74dd0d61796fbf7c0c1366777be783f14d (diff) | |
download | frameworks_base-0c330122aab023b524b9479010e1d63fc30710de.zip frameworks_base-0c330122aab023b524b9479010e1d63fc30710de.tar.gz frameworks_base-0c330122aab023b524b9479010e1d63fc30710de.tar.bz2 |
Framework: Remove CyanogenMod Weather and Calendar support
These features will be re-written to support Lock screen widgets
Change-Id: Ibba0fc2e158a6ac526e1a88499bb35b1ec362319
160 files changed, 3 insertions, 1754 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 9d24216..cef301d 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2827,89 +2827,6 @@ public final class Settings { */ public static final String LOCKSCREEN_BACKGROUND = "lockscreen_background"; - /** - * 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"; - - /** - * Invert low/high temperature display - * @hide - */ - public static final String WEATHER_INVERT_LOWHIGH = "weather_invert_lowhigh"; - - /** - * Whether to show the next calendar event - * @hide - */ - public static final String LOCKSCREEN_CALENDAR = "lockscreen_calendar"; - - /** - * Whether to show the next calendar event's location - * @hide - */ - public static final String LOCKSCREEN_CALENDAR_SHOW_LOCATION = "lockscreen_calendar_show_location"; - - /** - * Whether to show the next calendar event's description - * @hide - */ - public static final String LOCKSCREEN_CALENDAR_SHOW_DESCRIPTION = "lockscreen_calendar_show_description"; - - /** - * Which calendars to look for events - * @hide - */ - public static final String LOCKSCREEN_CALENDARS = "lockscreen_calendars"; - - /** - * How far in the future to look for events - * @hide - */ - public static final String LOCKSCREEN_CALENDAR_LOOKAHEAD = "lockscreen_calendar_lookahead"; - - /** - * Whether to find only events with reminders - * @hide - */ - public static final String LOCKSCREEN_CALENDAR_REMINDERS_ONLY = "lockscreen_calendar_reminders_only"; /** * Show the pending notification counts as overlays on the status bar diff --git a/core/java/com/android/internal/util/weather/HttpRetriever.java b/core/java/com/android/internal/util/weather/HttpRetriever.java deleted file mode 100644 index a3417a0..0000000 --- a/core/java/com/android/internal/util/weather/HttpRetriever.java +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************************************** - * Class : HttpConnectHelper.java * - * Main Weather activity, in this demo apps i use API from yahoo, you can * - * use other weather web service which you prefer * - * * - * Version : v1.0 * - * Date : May 09, 2011 * - * Copyright (c)-2011 DatNQ some right reserved * - * You can distribute, modify or what ever you want but WITHOUT ANY WARRANTY * - * Be honest by keep credit of this file * - * * - * If you have any concern, feel free to contact with me via email, i will * - * check email in free time * - * Email: nguyendatnq@gmail.com * - * ---------------------------------------------------------------------------* - * Modification Logs: * - * KEYCHANGE DATE AUTHOR DESCRIPTION * - * ---------------------------------------------------------------------------* - * ------- May 09, 2011 DatNQ Create new * - ******************************************************************************/ - -/** - * Modification into Android-internal HttpRetreiver.java - * Copyright (C) 2012 The AOKP Project - */ - - -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 deleted file mode 100644 index 2b65785..0000000 --- a/core/java/com/android/internal/util/weather/WeatherInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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; - 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) { - try { - 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 ""; - } catch (NumberFormatException e) { - return ""; - } - } - - private String trimSpeed(String speed) { - try { - return String.valueOf(Math.round(Float.parseFloat(speed))); - } catch (NumberFormatException e) { - return ""; - } - } -} diff --git a/core/java/com/android/internal/util/weather/WeatherXmlParser.java b/core/java/com/android/internal/util/weather/WeatherXmlParser.java deleted file mode 100644 index a2986fc..0000000 --- a/core/java/com/android/internal/util/weather/WeatherXmlParser.java +++ /dev/null @@ -1,177 +0,0 @@ -/****************************************************************************** - * Class : YahooWeatherHelper.java * - * Parser helper for Yahoo * - * * - * Version : v1.0 * - * Date : May 06, 2011 * - * Copyright (c)-2011 DatNQ some right reserved * - * You can distribute, modify or what ever you want but WITHOUT ANY WARRANTY * - * Be honest by keep credit of this file * - * * - * If you have any concern, feel free to contact with me via email, i will * - * check email in free time * - * Email: nguyendatnq@gmail.com * - * ---------------------------------------------------------------------------* - * Modification Logs: * - * KEYCHANGE DATE AUTHOR DESCRIPTION * - * ---------------------------------------------------------------------------* - * ------- May 06, 2011 DatNQ Create new * - ******************************************************************************/ -/* - * Modification into Android-internal WeatherXmlParser.java - * Copyright (C) 2012 The AOKP Project - */ - -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 deleted file mode 100644 index fb8efe4..0000000 --- a/core/java/com/android/internal/util/weather/YahooPlaceFinder.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 8f419e4..5453a0b 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -1047,166 +1047,6 @@ public class LockPatternUtils { return nextAlarm; } - /** - * @return A formatted string of the next calendar event with a reminder - * (for showing on the lock screen), or null if there is no next event - * within a certain look-ahead time. - */ - public String[] getNextCalendarAlarm(long lookahead, String[] calendars, - boolean remindersOnly) { - long now = System.currentTimeMillis(); - long later = now + lookahead; - - StringBuilder where = new StringBuilder(); - if (remindersOnly) { - where.append(CalendarContract.Events.HAS_ALARM + "=1"); - } - if (calendars != null && calendars.length > 0) { - if (remindersOnly) { - where.append(" AND "); - } - where.append(CalendarContract.Events.CALENDAR_ID + " in ("); - for (int i = 0; i < calendars.length; i++) { - where.append(calendars[i]); - if (i != calendars.length - 1) { - where.append(","); - } - } - where.append(") "); - } - - // Projection array - String[] projection = new String[] { - CalendarContract.Events.TITLE, - CalendarContract.Instances.BEGIN, - CalendarContract.Events.DESCRIPTION, - CalendarContract.Events.EVENT_LOCATION, - CalendarContract.Events.ALL_DAY - }; - - // The indices for the projection array - int TITLE_INDEX = 0; - int BEGIN_TIME_INDEX = 1; - int DESCRIPTION_INDEX = 2; - int LOCATION_INDEX = 3; - int ALL_DAY_INDEX = 4; - - Uri uri = Uri.withAppendedPath(CalendarContract.Instances.CONTENT_URI, - String.format("%d/%d", now, later)); - String[] nextCalendarAlarm = new String[2]; - Cursor cursor = null; - - try { - cursor = mContentResolver.query(uri, projection, - where.toString(), null, "begin ASC"); - - if (cursor != null && cursor.moveToFirst()) { - - String title = cursor.getString(TITLE_INDEX); - long begin = cursor.getLong(BEGIN_TIME_INDEX); - String description = cursor.getString(DESCRIPTION_INDEX); - String location = cursor.getString(LOCATION_INDEX); - boolean allDay = cursor.getInt(ALL_DAY_INDEX) != 0; - - // Check the next event in the case of all day event. As UTC is used for all day - // events, the next event may be the one that actually starts sooner - if (allDay && !cursor.isLast()) { - cursor.moveToNext(); - long nextBegin = cursor.getLong(BEGIN_TIME_INDEX); - if (nextBegin < begin + TimeZone.getDefault().getOffset(begin)) { - title = cursor.getString(TITLE_INDEX); - begin = nextBegin; - description = cursor.getString(DESCRIPTION_INDEX); - location = cursor.getString(LOCATION_INDEX); - allDay = cursor.getInt(ALL_DAY_INDEX) != 0; - } - } - - // Set the event title as the first array item - nextCalendarAlarm[0] = title.toString(); - - // Start building the event details string - // Starting with the date - Date start = new Date(begin); - StringBuilder sb = new StringBuilder(); - - if (allDay) { - SimpleDateFormat sdf = new SimpleDateFormat( - mContext.getString(R.string.abbrev_wday_month_day_no_year)); - // Calendar stores all-day events in UTC -- setting the time zone ensures - // the correct date is shown. - sdf.setTimeZone(TimeZone.getTimeZone(Time.TIMEZONE_UTC)); - sb.append(sdf.format(start)); - } else { - sb.append(DateFormat.format("E", start)); - sb.append(" "); - sb.append(DateFormat.getTimeFormat(mContext).format(start)); - } - - // Add the event location if it should be shown - int showLocation = Settings.System.getInt(mContext.getContentResolver(), - Settings.System.LOCKSCREEN_CALENDAR_SHOW_LOCATION, 0); - if (showLocation != 0 && !TextUtils.isEmpty(location)) { - switch(showLocation) { - case 1: - // Show first line - int end = location.indexOf('\n'); - if(end == -1) { - sb.append(": " + location); - } else { - sb.append(": " + location.substring(0, end)); - } - break; - case 2: - // Show all - sb.append(": " + location); - break; - } - } - - // Add the event description if it should be shown - int showDescription = Settings.System.getInt(mContext.getContentResolver(), - Settings.System.LOCKSCREEN_CALENDAR_SHOW_DESCRIPTION, 0); - if (showDescription != 0 && !TextUtils.isEmpty(description)) { - - // Show the appropriate separator - if (showLocation == 0) { - sb.append(": "); - } else { - sb.append(" - "); - } - - switch(showDescription) { - case 1: - // Show first line - int end = description.indexOf('\n'); - if(end == -1) { - sb.append(description); - } else { - sb.append(description.substring(0, end)); - } - break; - case 2: - // Show all - sb.append(description); - break; - } - } - - // Set the time, location and description as the second array item - nextCalendarAlarm[1] = sb.toString(); - } - } catch (Exception e) { - // Do nothing - } finally { - if (cursor != null) { - cursor.close(); - } - } - - return nextCalendarAlarm; - } - private boolean getBoolean(String secureSettingKey, boolean defaultValue) { try { return getLockSettings().getBoolean(secureSettingKey, defaultValue, diff --git a/core/res/res/drawable-hdpi/weather_0.png b/core/res/res/drawable-hdpi/weather_0.png Binary files differdeleted file mode 100644 index 9e539b6..0000000 --- a/core/res/res/drawable-hdpi/weather_0.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_1.png b/core/res/res/drawable-hdpi/weather_1.png Binary files differdeleted file mode 100644 index 9e539b6..0000000 --- a/core/res/res/drawable-hdpi/weather_1.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_10.png b/core/res/res/drawable-hdpi/weather_10.png Binary files differdeleted file mode 100644 index daf991e..0000000 --- a/core/res/res/drawable-hdpi/weather_10.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_11.png b/core/res/res/drawable-hdpi/weather_11.png Binary files differdeleted file mode 100644 index 91a74a5..0000000 --- a/core/res/res/drawable-hdpi/weather_11.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_12.png b/core/res/res/drawable-hdpi/weather_12.png Binary files differdeleted file mode 100644 index 91a74a5..0000000 --- a/core/res/res/drawable-hdpi/weather_12.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_13.png b/core/res/res/drawable-hdpi/weather_13.png Binary files differdeleted file mode 100644 index b2f41a5..0000000 --- a/core/res/res/drawable-hdpi/weather_13.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_14.png b/core/res/res/drawable-hdpi/weather_14.png Binary files differdeleted file mode 100644 index b2f41a5..0000000 --- a/core/res/res/drawable-hdpi/weather_14.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_15.png b/core/res/res/drawable-hdpi/weather_15.png Binary files differdeleted file mode 100644 index 2e92b35..0000000 --- a/core/res/res/drawable-hdpi/weather_15.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_16.png b/core/res/res/drawable-hdpi/weather_16.png Binary files differdeleted file mode 100644 index bf4564c..0000000 --- a/core/res/res/drawable-hdpi/weather_16.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_17.png b/core/res/res/drawable-hdpi/weather_17.png Binary files differdeleted file mode 100644 index f7948c1..0000000 --- a/core/res/res/drawable-hdpi/weather_17.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_18.png b/core/res/res/drawable-hdpi/weather_18.png Binary files differdeleted file mode 100644 index 802a80f..0000000 --- a/core/res/res/drawable-hdpi/weather_18.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_19.png b/core/res/res/drawable-hdpi/weather_19.png Binary files differdeleted file mode 100644 index b67ba5e..0000000 --- a/core/res/res/drawable-hdpi/weather_19.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_2.png b/core/res/res/drawable-hdpi/weather_2.png Binary files differdeleted file mode 100644 index 9e539b6..0000000 --- a/core/res/res/drawable-hdpi/weather_2.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_20.png b/core/res/res/drawable-hdpi/weather_20.png Binary files differdeleted file mode 100644 index fd40f33..0000000 --- a/core/res/res/drawable-hdpi/weather_20.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_21.png b/core/res/res/drawable-hdpi/weather_21.png Binary files differdeleted file mode 100644 index 8349b21..0000000 --- a/core/res/res/drawable-hdpi/weather_21.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_22.png b/core/res/res/drawable-hdpi/weather_22.png Binary files differdeleted file mode 100644 index b67ba5e..0000000 --- a/core/res/res/drawable-hdpi/weather_22.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_23.png b/core/res/res/drawable-hdpi/weather_23.png Binary files differdeleted file mode 100644 index ca015be..0000000 --- a/core/res/res/drawable-hdpi/weather_23.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_24.png b/core/res/res/drawable-hdpi/weather_24.png Binary files differdeleted file mode 100644 index ca015be..0000000 --- a/core/res/res/drawable-hdpi/weather_24.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_25.png b/core/res/res/drawable-hdpi/weather_25.png Binary files differdeleted file mode 100644 index 32cb0d8..0000000 --- a/core/res/res/drawable-hdpi/weather_25.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_26.png b/core/res/res/drawable-hdpi/weather_26.png Binary files differdeleted file mode 100644 index ce9761a..0000000 --- a/core/res/res/drawable-hdpi/weather_26.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_27.png b/core/res/res/drawable-hdpi/weather_27.png Binary files differdeleted file mode 100644 index 67433a7..0000000 --- a/core/res/res/drawable-hdpi/weather_27.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_28.png b/core/res/res/drawable-hdpi/weather_28.png Binary files differdeleted file mode 100644 index 43f3df8..0000000 --- a/core/res/res/drawable-hdpi/weather_28.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_29.png b/core/res/res/drawable-hdpi/weather_29.png Binary files differdeleted file mode 100644 index 67433a7..0000000 --- a/core/res/res/drawable-hdpi/weather_29.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_3.png b/core/res/res/drawable-hdpi/weather_3.png Binary files differdeleted file mode 100644 index 708a2e6..0000000 --- a/core/res/res/drawable-hdpi/weather_3.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_30.png b/core/res/res/drawable-hdpi/weather_30.png Binary files differdeleted file mode 100644 index 43f3df8..0000000 --- a/core/res/res/drawable-hdpi/weather_30.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_31.png b/core/res/res/drawable-hdpi/weather_31.png Binary files differdeleted file mode 100644 index d545d77..0000000 --- a/core/res/res/drawable-hdpi/weather_31.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_32.png b/core/res/res/drawable-hdpi/weather_32.png Binary files differdeleted file mode 100644 index c55e4b3..0000000 --- a/core/res/res/drawable-hdpi/weather_32.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_33.png b/core/res/res/drawable-hdpi/weather_33.png Binary files differdeleted file mode 100644 index d545d77..0000000 --- a/core/res/res/drawable-hdpi/weather_33.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_34.png b/core/res/res/drawable-hdpi/weather_34.png Binary files differdeleted file mode 100644 index c55e4b3..0000000 --- a/core/res/res/drawable-hdpi/weather_34.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_35.png b/core/res/res/drawable-hdpi/weather_35.png Binary files differdeleted file mode 100644 index 3cd1b81..0000000 --- a/core/res/res/drawable-hdpi/weather_35.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_36.png b/core/res/res/drawable-hdpi/weather_36.png Binary files differdeleted file mode 100644 index 06cb774..0000000 --- a/core/res/res/drawable-hdpi/weather_36.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_37.png b/core/res/res/drawable-hdpi/weather_37.png Binary files differdeleted file mode 100644 index 8b2c4d1..0000000 --- a/core/res/res/drawable-hdpi/weather_37.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_38.png b/core/res/res/drawable-hdpi/weather_38.png Binary files differdeleted file mode 100644 index f0509ef..0000000 --- a/core/res/res/drawable-hdpi/weather_38.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_39.png b/core/res/res/drawable-hdpi/weather_39.png Binary files differdeleted file mode 100644 index 8b2c4d1..0000000 --- a/core/res/res/drawable-hdpi/weather_39.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_4.png b/core/res/res/drawable-hdpi/weather_4.png Binary files differdeleted file mode 100644 index 708a2e6..0000000 --- a/core/res/res/drawable-hdpi/weather_4.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_40.png b/core/res/res/drawable-hdpi/weather_40.png Binary files differdeleted file mode 100644 index fb3c06d..0000000 --- a/core/res/res/drawable-hdpi/weather_40.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_41.png b/core/res/res/drawable-hdpi/weather_41.png Binary files differdeleted file mode 100644 index bf4564c..0000000 --- a/core/res/res/drawable-hdpi/weather_41.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_42.png b/core/res/res/drawable-hdpi/weather_42.png Binary files differdeleted file mode 100644 index 7b81366..0000000 --- a/core/res/res/drawable-hdpi/weather_42.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_43.png b/core/res/res/drawable-hdpi/weather_43.png Binary files differdeleted file mode 100644 index bf4564c..0000000 --- a/core/res/res/drawable-hdpi/weather_43.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_44.png b/core/res/res/drawable-hdpi/weather_44.png Binary files differdeleted file mode 100644 index 67433a7..0000000 --- a/core/res/res/drawable-hdpi/weather_44.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_45.png b/core/res/res/drawable-hdpi/weather_45.png Binary files differdeleted file mode 100644 index 708a2e6..0000000 --- a/core/res/res/drawable-hdpi/weather_45.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_46.png b/core/res/res/drawable-hdpi/weather_46.png Binary files differdeleted file mode 100644 index b2f41a5..0000000 --- a/core/res/res/drawable-hdpi/weather_46.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_47.png b/core/res/res/drawable-hdpi/weather_47.png Binary files differdeleted file mode 100644 index f0509ef..0000000 --- a/core/res/res/drawable-hdpi/weather_47.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_5.png b/core/res/res/drawable-hdpi/weather_5.png Binary files differdeleted file mode 100644 index 802a80f..0000000 --- a/core/res/res/drawable-hdpi/weather_5.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_6.png b/core/res/res/drawable-hdpi/weather_6.png Binary files differdeleted file mode 100644 index 802a80f..0000000 --- a/core/res/res/drawable-hdpi/weather_6.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_7.png b/core/res/res/drawable-hdpi/weather_7.png Binary files differdeleted file mode 100644 index 802a80f..0000000 --- a/core/res/res/drawable-hdpi/weather_7.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_8.png b/core/res/res/drawable-hdpi/weather_8.png Binary files differdeleted file mode 100644 index e36a680..0000000 --- a/core/res/res/drawable-hdpi/weather_8.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_9.png b/core/res/res/drawable-hdpi/weather_9.png Binary files differdeleted file mode 100644 index 7651b3e..0000000 --- a/core/res/res/drawable-hdpi/weather_9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/weather_na.png b/core/res/res/drawable-hdpi/weather_na.png Binary files differdeleted file mode 100644 index 4a43283..0000000 --- a/core/res/res/drawable-hdpi/weather_na.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_0.png b/core/res/res/drawable-mdpi/weather_0.png Binary files differdeleted file mode 100644 index 1553c55..0000000 --- a/core/res/res/drawable-mdpi/weather_0.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_1.png b/core/res/res/drawable-mdpi/weather_1.png Binary files differdeleted file mode 100644 index 1553c55..0000000 --- a/core/res/res/drawable-mdpi/weather_1.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_10.png b/core/res/res/drawable-mdpi/weather_10.png Binary files differdeleted file mode 100644 index c44b8f7..0000000 --- a/core/res/res/drawable-mdpi/weather_10.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_11.png b/core/res/res/drawable-mdpi/weather_11.png Binary files differdeleted file mode 100644 index ee01b1cf..0000000 --- a/core/res/res/drawable-mdpi/weather_11.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_12.png b/core/res/res/drawable-mdpi/weather_12.png Binary files differdeleted file mode 100644 index ee01b1cf..0000000 --- a/core/res/res/drawable-mdpi/weather_12.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_13.png b/core/res/res/drawable-mdpi/weather_13.png Binary files differdeleted file mode 100644 index c922139..0000000 --- a/core/res/res/drawable-mdpi/weather_13.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_14.png b/core/res/res/drawable-mdpi/weather_14.png Binary files differdeleted file mode 100644 index c922139..0000000 --- a/core/res/res/drawable-mdpi/weather_14.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_15.png b/core/res/res/drawable-mdpi/weather_15.png Binary files differdeleted file mode 100644 index 27dbc3f..0000000 --- a/core/res/res/drawable-mdpi/weather_15.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_16.png b/core/res/res/drawable-mdpi/weather_16.png Binary files differdeleted file mode 100644 index d575139..0000000 --- a/core/res/res/drawable-mdpi/weather_16.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_17.png b/core/res/res/drawable-mdpi/weather_17.png Binary files differdeleted file mode 100644 index 7ac7828..0000000 --- a/core/res/res/drawable-mdpi/weather_17.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_18.png b/core/res/res/drawable-mdpi/weather_18.png Binary files differdeleted file mode 100644 index a1ae654..0000000 --- a/core/res/res/drawable-mdpi/weather_18.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_19.png b/core/res/res/drawable-mdpi/weather_19.png Binary files differdeleted file mode 100644 index b750e26..0000000 --- a/core/res/res/drawable-mdpi/weather_19.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_2.png b/core/res/res/drawable-mdpi/weather_2.png Binary files differdeleted file mode 100644 index 1553c55..0000000 --- a/core/res/res/drawable-mdpi/weather_2.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_20.png b/core/res/res/drawable-mdpi/weather_20.png Binary files differdeleted file mode 100644 index 8790ddd..0000000 --- a/core/res/res/drawable-mdpi/weather_20.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_21.png b/core/res/res/drawable-mdpi/weather_21.png Binary files differdeleted file mode 100644 index 242ab7a..0000000 --- a/core/res/res/drawable-mdpi/weather_21.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_22.png b/core/res/res/drawable-mdpi/weather_22.png Binary files differdeleted file mode 100644 index b750e26..0000000 --- a/core/res/res/drawable-mdpi/weather_22.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_23.png b/core/res/res/drawable-mdpi/weather_23.png Binary files differdeleted file mode 100644 index ddefbf1..0000000 --- a/core/res/res/drawable-mdpi/weather_23.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_24.png b/core/res/res/drawable-mdpi/weather_24.png Binary files differdeleted file mode 100644 index ddefbf1..0000000 --- a/core/res/res/drawable-mdpi/weather_24.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_25.png b/core/res/res/drawable-mdpi/weather_25.png Binary files differdeleted file mode 100644 index 766d094..0000000 --- a/core/res/res/drawable-mdpi/weather_25.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_26.png b/core/res/res/drawable-mdpi/weather_26.png Binary files differdeleted file mode 100644 index 1445f9e..0000000 --- a/core/res/res/drawable-mdpi/weather_26.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_27.png b/core/res/res/drawable-mdpi/weather_27.png Binary files differdeleted file mode 100644 index 3835d5b..0000000 --- a/core/res/res/drawable-mdpi/weather_27.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_28.png b/core/res/res/drawable-mdpi/weather_28.png Binary files differdeleted file mode 100644 index a362aaf..0000000 --- a/core/res/res/drawable-mdpi/weather_28.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_29.png b/core/res/res/drawable-mdpi/weather_29.png Binary files differdeleted file mode 100644 index 3835d5b..0000000 --- a/core/res/res/drawable-mdpi/weather_29.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_3.png b/core/res/res/drawable-mdpi/weather_3.png Binary files differdeleted file mode 100644 index 0fd0158..0000000 --- a/core/res/res/drawable-mdpi/weather_3.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_30.png b/core/res/res/drawable-mdpi/weather_30.png Binary files differdeleted file mode 100644 index a362aaf..0000000 --- a/core/res/res/drawable-mdpi/weather_30.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_31.png b/core/res/res/drawable-mdpi/weather_31.png Binary files differdeleted file mode 100644 index 886b845..0000000 --- a/core/res/res/drawable-mdpi/weather_31.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_32.png b/core/res/res/drawable-mdpi/weather_32.png Binary files differdeleted file mode 100644 index 4e6827a..0000000 --- a/core/res/res/drawable-mdpi/weather_32.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_33.png b/core/res/res/drawable-mdpi/weather_33.png Binary files differdeleted file mode 100644 index 886b845..0000000 --- a/core/res/res/drawable-mdpi/weather_33.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_34.png b/core/res/res/drawable-mdpi/weather_34.png Binary files differdeleted file mode 100644 index 4e6827a..0000000 --- a/core/res/res/drawable-mdpi/weather_34.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_35.png b/core/res/res/drawable-mdpi/weather_35.png Binary files differdeleted file mode 100644 index b8ba7c4..0000000 --- a/core/res/res/drawable-mdpi/weather_35.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_36.png b/core/res/res/drawable-mdpi/weather_36.png Binary files differdeleted file mode 100644 index 005295a..0000000 --- a/core/res/res/drawable-mdpi/weather_36.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_37.png b/core/res/res/drawable-mdpi/weather_37.png Binary files differdeleted file mode 100644 index 290e2a2..0000000 --- a/core/res/res/drawable-mdpi/weather_37.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_38.png b/core/res/res/drawable-mdpi/weather_38.png Binary files differdeleted file mode 100644 index 92785f5..0000000 --- a/core/res/res/drawable-mdpi/weather_38.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_39.png b/core/res/res/drawable-mdpi/weather_39.png Binary files differdeleted file mode 100644 index 290e2a2..0000000 --- a/core/res/res/drawable-mdpi/weather_39.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_4.png b/core/res/res/drawable-mdpi/weather_4.png Binary files differdeleted file mode 100644 index 0fd0158..0000000 --- a/core/res/res/drawable-mdpi/weather_4.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_40.png b/core/res/res/drawable-mdpi/weather_40.png Binary files differdeleted file mode 100644 index 25fbd20..0000000 --- a/core/res/res/drawable-mdpi/weather_40.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_41.png b/core/res/res/drawable-mdpi/weather_41.png Binary files differdeleted file mode 100644 index d575139..0000000 --- a/core/res/res/drawable-mdpi/weather_41.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_42.png b/core/res/res/drawable-mdpi/weather_42.png Binary files differdeleted file mode 100644 index f259805..0000000 --- a/core/res/res/drawable-mdpi/weather_42.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_43.png b/core/res/res/drawable-mdpi/weather_43.png Binary files differdeleted file mode 100644 index d575139..0000000 --- a/core/res/res/drawable-mdpi/weather_43.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_44.png b/core/res/res/drawable-mdpi/weather_44.png Binary files differdeleted file mode 100644 index 3835d5b..0000000 --- a/core/res/res/drawable-mdpi/weather_44.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_45.png b/core/res/res/drawable-mdpi/weather_45.png Binary files differdeleted file mode 100644 index 0fd0158..0000000 --- a/core/res/res/drawable-mdpi/weather_45.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_46.png b/core/res/res/drawable-mdpi/weather_46.png Binary files differdeleted file mode 100644 index c922139..0000000 --- a/core/res/res/drawable-mdpi/weather_46.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_47.png b/core/res/res/drawable-mdpi/weather_47.png Binary files differdeleted file mode 100644 index 92785f5..0000000 --- a/core/res/res/drawable-mdpi/weather_47.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_5.png b/core/res/res/drawable-mdpi/weather_5.png Binary files differdeleted file mode 100644 index a1ae654..0000000 --- a/core/res/res/drawable-mdpi/weather_5.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_6.png b/core/res/res/drawable-mdpi/weather_6.png Binary files differdeleted file mode 100644 index a1ae654..0000000 --- a/core/res/res/drawable-mdpi/weather_6.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_7.png b/core/res/res/drawable-mdpi/weather_7.png Binary files differdeleted file mode 100644 index a1ae654..0000000 --- a/core/res/res/drawable-mdpi/weather_7.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_8.png b/core/res/res/drawable-mdpi/weather_8.png Binary files differdeleted file mode 100644 index 37a339e..0000000 --- a/core/res/res/drawable-mdpi/weather_8.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_9.png b/core/res/res/drawable-mdpi/weather_9.png Binary files differdeleted file mode 100644 index 0a9c8c3..0000000 --- a/core/res/res/drawable-mdpi/weather_9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/weather_na.png b/core/res/res/drawable-mdpi/weather_na.png Binary files differdeleted file mode 100644 index 48c2879..0000000 --- a/core/res/res/drawable-mdpi/weather_na.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_0.png b/core/res/res/drawable-xhdpi/weather_0.png Binary files differdeleted file mode 100644 index 335af4b..0000000 --- a/core/res/res/drawable-xhdpi/weather_0.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_1.png b/core/res/res/drawable-xhdpi/weather_1.png Binary files differdeleted file mode 100644 index 335af4b..0000000 --- a/core/res/res/drawable-xhdpi/weather_1.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_10.png b/core/res/res/drawable-xhdpi/weather_10.png Binary files differdeleted file mode 100644 index 9432a13..0000000 --- a/core/res/res/drawable-xhdpi/weather_10.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_11.png b/core/res/res/drawable-xhdpi/weather_11.png Binary files differdeleted file mode 100644 index 3f7c5ad..0000000 --- a/core/res/res/drawable-xhdpi/weather_11.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_12.png b/core/res/res/drawable-xhdpi/weather_12.png Binary files differdeleted file mode 100644 index 3f7c5ad..0000000 --- a/core/res/res/drawable-xhdpi/weather_12.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_13.png b/core/res/res/drawable-xhdpi/weather_13.png Binary files differdeleted file mode 100644 index 3f9e500..0000000 --- a/core/res/res/drawable-xhdpi/weather_13.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_14.png b/core/res/res/drawable-xhdpi/weather_14.png Binary files differdeleted file mode 100644 index 3f9e500..0000000 --- a/core/res/res/drawable-xhdpi/weather_14.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_15.png b/core/res/res/drawable-xhdpi/weather_15.png Binary files differdeleted file mode 100644 index 2ad1e46..0000000 --- a/core/res/res/drawable-xhdpi/weather_15.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_16.png b/core/res/res/drawable-xhdpi/weather_16.png Binary files differdeleted file mode 100644 index 4bad358..0000000 --- a/core/res/res/drawable-xhdpi/weather_16.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_17.png b/core/res/res/drawable-xhdpi/weather_17.png Binary files differdeleted file mode 100644 index 6fced6c..0000000 --- a/core/res/res/drawable-xhdpi/weather_17.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_18.png b/core/res/res/drawable-xhdpi/weather_18.png Binary files differdeleted file mode 100644 index aae6d11..0000000 --- a/core/res/res/drawable-xhdpi/weather_18.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_19.png b/core/res/res/drawable-xhdpi/weather_19.png Binary files differdeleted file mode 100644 index d8e5e82..0000000 --- a/core/res/res/drawable-xhdpi/weather_19.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_2.png b/core/res/res/drawable-xhdpi/weather_2.png Binary files differdeleted file mode 100644 index 335af4b..0000000 --- a/core/res/res/drawable-xhdpi/weather_2.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_20.png b/core/res/res/drawable-xhdpi/weather_20.png Binary files differdeleted file mode 100644 index 73cbc39..0000000 --- a/core/res/res/drawable-xhdpi/weather_20.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_21.png b/core/res/res/drawable-xhdpi/weather_21.png Binary files differdeleted file mode 100644 index 800f484..0000000 --- a/core/res/res/drawable-xhdpi/weather_21.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_22.png b/core/res/res/drawable-xhdpi/weather_22.png Binary files differdeleted file mode 100644 index d8e5e82..0000000 --- a/core/res/res/drawable-xhdpi/weather_22.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_23.png b/core/res/res/drawable-xhdpi/weather_23.png Binary files differdeleted file mode 100644 index be446c2..0000000 --- a/core/res/res/drawable-xhdpi/weather_23.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_24.png b/core/res/res/drawable-xhdpi/weather_24.png Binary files differdeleted file mode 100644 index be446c2..0000000 --- a/core/res/res/drawable-xhdpi/weather_24.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_25.png b/core/res/res/drawable-xhdpi/weather_25.png Binary files differdeleted file mode 100644 index 63f019a..0000000 --- a/core/res/res/drawable-xhdpi/weather_25.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_26.png b/core/res/res/drawable-xhdpi/weather_26.png Binary files differdeleted file mode 100644 index 3eb5734..0000000 --- a/core/res/res/drawable-xhdpi/weather_26.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_27.png b/core/res/res/drawable-xhdpi/weather_27.png Binary files differdeleted file mode 100644 index abf4096..0000000 --- a/core/res/res/drawable-xhdpi/weather_27.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_28.png b/core/res/res/drawable-xhdpi/weather_28.png Binary files differdeleted file mode 100644 index 0cbae30..0000000 --- a/core/res/res/drawable-xhdpi/weather_28.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_29.png b/core/res/res/drawable-xhdpi/weather_29.png Binary files differdeleted file mode 100644 index abf4096..0000000 --- a/core/res/res/drawable-xhdpi/weather_29.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_3.png b/core/res/res/drawable-xhdpi/weather_3.png Binary files differdeleted file mode 100644 index 7dda34c..0000000 --- a/core/res/res/drawable-xhdpi/weather_3.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_30.png b/core/res/res/drawable-xhdpi/weather_30.png Binary files differdeleted file mode 100644 index 0cbae30..0000000 --- a/core/res/res/drawable-xhdpi/weather_30.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_31.png b/core/res/res/drawable-xhdpi/weather_31.png Binary files differdeleted file mode 100644 index 16f2d9f..0000000 --- a/core/res/res/drawable-xhdpi/weather_31.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_32.png b/core/res/res/drawable-xhdpi/weather_32.png Binary files differdeleted file mode 100644 index 409373d..0000000 --- a/core/res/res/drawable-xhdpi/weather_32.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_33.png b/core/res/res/drawable-xhdpi/weather_33.png Binary files differdeleted file mode 100644 index 16f2d9f..0000000 --- a/core/res/res/drawable-xhdpi/weather_33.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_34.png b/core/res/res/drawable-xhdpi/weather_34.png Binary files differdeleted file mode 100644 index 409373d..0000000 --- a/core/res/res/drawable-xhdpi/weather_34.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_35.png b/core/res/res/drawable-xhdpi/weather_35.png Binary files differdeleted file mode 100644 index 445b884..0000000 --- a/core/res/res/drawable-xhdpi/weather_35.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_36.png b/core/res/res/drawable-xhdpi/weather_36.png Binary files differdeleted file mode 100644 index a424ad6..0000000 --- a/core/res/res/drawable-xhdpi/weather_36.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_37.png b/core/res/res/drawable-xhdpi/weather_37.png Binary files differdeleted file mode 100644 index e98c8b8..0000000 --- a/core/res/res/drawable-xhdpi/weather_37.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_38.png b/core/res/res/drawable-xhdpi/weather_38.png Binary files differdeleted file mode 100644 index b47249c..0000000 --- a/core/res/res/drawable-xhdpi/weather_38.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_39.png b/core/res/res/drawable-xhdpi/weather_39.png Binary files differdeleted file mode 100644 index e98c8b8..0000000 --- a/core/res/res/drawable-xhdpi/weather_39.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_4.png b/core/res/res/drawable-xhdpi/weather_4.png Binary files differdeleted file mode 100644 index 7dda34c..0000000 --- a/core/res/res/drawable-xhdpi/weather_4.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_40.png b/core/res/res/drawable-xhdpi/weather_40.png Binary files differdeleted file mode 100644 index 1505fea..0000000 --- a/core/res/res/drawable-xhdpi/weather_40.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_41.png b/core/res/res/drawable-xhdpi/weather_41.png Binary files differdeleted file mode 100644 index 4bad358..0000000 --- a/core/res/res/drawable-xhdpi/weather_41.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_42.png b/core/res/res/drawable-xhdpi/weather_42.png Binary files differdeleted file mode 100644 index 196026d..0000000 --- a/core/res/res/drawable-xhdpi/weather_42.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_43.png b/core/res/res/drawable-xhdpi/weather_43.png Binary files differdeleted file mode 100644 index 4bad358..0000000 --- a/core/res/res/drawable-xhdpi/weather_43.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_44.png b/core/res/res/drawable-xhdpi/weather_44.png Binary files differdeleted file mode 100644 index abf4096..0000000 --- a/core/res/res/drawable-xhdpi/weather_44.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_45.png b/core/res/res/drawable-xhdpi/weather_45.png Binary files differdeleted file mode 100644 index 7dda34c..0000000 --- a/core/res/res/drawable-xhdpi/weather_45.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_46.png b/core/res/res/drawable-xhdpi/weather_46.png Binary files differdeleted file mode 100644 index 3f9e500..0000000 --- a/core/res/res/drawable-xhdpi/weather_46.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_47.png b/core/res/res/drawable-xhdpi/weather_47.png Binary files differdeleted file mode 100644 index b47249c..0000000 --- a/core/res/res/drawable-xhdpi/weather_47.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_5.png b/core/res/res/drawable-xhdpi/weather_5.png Binary files differdeleted file mode 100644 index aae6d11..0000000 --- a/core/res/res/drawable-xhdpi/weather_5.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_6.png b/core/res/res/drawable-xhdpi/weather_6.png Binary files differdeleted file mode 100644 index aae6d11..0000000 --- a/core/res/res/drawable-xhdpi/weather_6.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_7.png b/core/res/res/drawable-xhdpi/weather_7.png Binary files differdeleted file mode 100644 index aae6d11..0000000 --- a/core/res/res/drawable-xhdpi/weather_7.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_8.png b/core/res/res/drawable-xhdpi/weather_8.png Binary files differdeleted file mode 100644 index 1a7e699..0000000 --- a/core/res/res/drawable-xhdpi/weather_8.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_9.png b/core/res/res/drawable-xhdpi/weather_9.png Binary files differdeleted file mode 100644 index 0da4419..0000000 --- a/core/res/res/drawable-xhdpi/weather_9.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/weather_na.png b/core/res/res/drawable-xhdpi/weather_na.png Binary files differdeleted file mode 100644 index 8125ce2..0000000 --- a/core/res/res/drawable-xhdpi/weather_na.png +++ /dev/null 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 c1ea69c..e6c3f96 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_status_land.xml @@ -39,104 +39,6 @@ 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:textSize="6sp" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/weather_temps_panel" - 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" @@ -218,68 +120,4 @@ android:visibility="invisible" /> - <!-- CyanogenMod Calendar Panel --> - <LinearLayout - android:id="@+id/calendar_panel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:minHeight="28dip" - android:layout_gravity="center_horizontal" - android:gravity="center_vertical" - android:layout_marginTop="10dip" - android:paddingLeft="12dip" - android:paddingRight="12dip" > - - <ImageView - android:layout_width="36dp" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:gravity="center" - android:src="@drawable/ic_lock_idle_calendar" /> - - <View - android:layout_width="1dip" - android:layout_height="match_parent" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:background="@android:drawable/divider_horizontal_dark" /> - - <RelativeLayout - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="1" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:paddingLeft="4dip" > - - <TextView - android:id="@+id/calendar_event_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:textSize="14sp" - android:textColor="?android:attr/textColorPrimary" - android:ellipsize="marquee" - android:fadingEdge="horizontal" /> - - <TextView - android:id="@+id/calendar_event_details" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/calendar_event_title" - android:layout_alignLeft="@id/calendar_event_title" - android:textSize="12sp" - android:singleLine="true" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:scrollHorizontally="true" - android:focusable="true" - android:focusableInTouchMode="true" - android:fadingEdge="horizontal" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - </LinearLayout> - </LinearLayout> 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 5929529..e022a9e 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_status_port.xml @@ -41,104 +41,6 @@ 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:textSize="6sp" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/weather_temps_panel" - 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" @@ -219,67 +121,4 @@ android:textColor="@color/lockscreen_owner_info" /> - <!-- CyanogenMod Calendar Panel --> - <LinearLayout - android:id="@+id/calendar_panel" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dip" - android:minHeight="28dip" - android:gravity="center_vertical" - android:paddingLeft="12dip" - android:paddingRight="12dip" > - - <ImageView - android:layout_width="36dp" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:gravity="center" - android:src="@drawable/ic_lock_idle_calendar" /> - - <View - android:layout_width="1dip" - android:layout_height="match_parent" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:background="@android:drawable/divider_horizontal_dark" /> - - <RelativeLayout - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="1" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:paddingLeft="4dip" > - - <TextView - android:id="@+id/calendar_event_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:textSize="14sp" - android:textColor="?android:attr/textColorPrimary" - android:ellipsize="marquee" - android:fadingEdge="horizontal" /> - - <TextView - android:id="@+id/calendar_event_details" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/calendar_event_title" - android:layout_alignLeft="@id/calendar_event_title" - android:textSize="12sp" - android:singleLine="true" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:scrollHorizontally="true" - android:focusable="true" - android:focusableInTouchMode="true" - android:fadingEdge="horizontal" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - </LinearLayout> - </LinearLayout> diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml index 143e24d..b897c3f 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml @@ -104,105 +104,6 @@ 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:layout_below="@id/weather_condition" - android:layout_alignParentRight="true" - android:textSize="6sp" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/weather_temps_panel" - 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 --> @@ -224,68 +125,6 @@ android:layout_width="match_parent" android:layout_height="302dip"> - <!-- CyanogenMod Calendar Panel --> - <LinearLayout - android:id="@+id/calendar_panel" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="28dip" - android:gravity="center_vertical" - android:paddingLeft="12dip" - android:paddingRight="12dip" > - - <ImageView - android:layout_width="36dp" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:gravity="center" - android:src="@drawable/ic_lock_idle_calendar" /> - - <View - android:layout_width="1dip" - android:layout_height="match_parent" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:background="@android:drawable/divider_horizontal_dark" /> - - <RelativeLayout - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="1" - android:paddingTop="6dip" - android:paddingBottom="6dip" - android:paddingLeft="4dip" > - - <TextView - android:id="@+id/calendar_event_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:textSize="14sp" - android:textColor="?android:attr/textColorPrimary" - android:ellipsize="marquee" - android:fadingEdge="horizontal" /> - - <TextView - android:id="@+id/calendar_event_details" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/calendar_event_title" - android:layout_alignLeft="@id/calendar_event_title" - android:textSize="12sp" - android:singleLine="true" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:scrollHorizontally="true" - android:focusable="true" - android:focusableInTouchMode="true" - android:fadingEdge="horizontal" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - </LinearLayout> - <com.android.internal.widget.multiwaveview.GlowPadView android:id="@+id/unlock_widget" android:orientation="horizontal" 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 b151239..e6a55b5 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml @@ -100,105 +100,6 @@ 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:singleLine="true" - android:ellipsize="marquee" - 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:gravity="right" - android:textSize="6sp" - android:textColor="?android:attr/textColorSecondary" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/weather_temps_panel" - 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 diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 25bcd9d..e9221d5 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2028,32 +2028,11 @@ <public type="style" name="Widget.DeviceDefault.CheckedTextView" id="0x010301db" /> <public type="style" name="Widget.DeviceDefault.Light.CheckedTextView" id="0x010301dc" /> - <java-symbol type="string" name="weather_E" /> - <java-symbol type="string" name="weather_N" /> - <java-symbol type="string" name="weather_NE" /> - <java-symbol type="string" name="weather_NW" /> - <java-symbol type="string" name="weather_S" /> - <java-symbol type="string" name="weather_SE" /> - <java-symbol type="string" name="weather_SW" /> - <java-symbol type="string" name="weather_W" /> - <java-symbol type="drawable" name="ic_lock_profile" /> <java-symbol type="drawable" name="ic_lock_reboot" /> <java-symbol type="drawable" name="ic_lock_screenshot" /> <java-symbol type="drawable" name="ic_lock_expanded_desktop" /> - <java-symbol type="drawable" name="weather_na" /> - <java-symbol type="id" name="calendar_event_details" /> - <java-symbol type="id" name="calendar_event_title" /> - <java-symbol type="id" name="calendar_panel" /> - <java-symbol type="id" name="update_time" /> - <java-symbol type="id" name="weather_city" /> - <java-symbol type="id" name="weather_condition" /> - <java-symbol type="id" name="weather_image" /> - <java-symbol type="id" name="weather_low_high" /> - <java-symbol type="id" name="weather_panel" /> - <java-symbol type="id" name="weather_temp" /> - <java-symbol type="id" name="weather_temps_panel" /> <java-symbol type="string" name="global_action_choose_profile" /> <java-symbol type="string" name="global_action_reboot" /> <java-symbol type="string" name="global_actions_toggle_expanded_desktop_mode" /> @@ -2061,9 +2040,6 @@ <java-symbol type="string" name="global_actions_expanded_desktop_mode_on_status" /> <java-symbol type="string" name="global_actions" /> <java-symbol type="string" name="global_action_screenshot" /> - <java-symbol type="string" name="weather_no_data" /> - <java-symbol type="string" name="weather_refreshing" /> - <java-symbol type="string" name="weather_tap_to_refresh" /> <java-symbol type="array" name="notification_light_package_mapping" /> <java-symbol type="array" name="shutdown_reboot_actions" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index dce1c3b..03054c3 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4046,71 +4046,4 @@ <!-- label for item that opens the profile choosing dialog --> <string name="global_action_choose_profile">Profile</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_no_data">No data</string> - <string name="weather_tap_to_refresh">Tap to refresh</string> - <string name="weather_refreshing">Refreshing</string> - </resources> diff --git a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java index d1651fc..a210fa7 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java @@ -17,25 +17,8 @@ package com.android.internal.policy.impl.keyguard_obsolete; -import com.android.internal.R; -import com.android.internal.telephony.IccCardConstants; -import com.android.internal.widget.DigitalClock; -import com.android.internal.widget.LockPatternUtils; -import com.android.internal.widget.TransportControlView; - -import java.util.ArrayList; -import java.util.Date; - -import libcore.util.MutableInt; - 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; @@ -43,22 +26,14 @@ import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.RelativeLayout; import android.widget.TextView; import com.android.internal.R; -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.telephony.IccCardConstants; +import com.android.internal.widget.DigitalClock; import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.TransportControlView; -import org.w3c.dom.Document; - -import java.io.IOException; import java.util.ArrayList; import java.util.Date; @@ -97,11 +72,6 @@ class KeyguardStatusViewManager implements OnClickListener { private TextView mOwnerInfoView; private TextView mAlarmStatusView; private TransportControlView mTransportView; - private RelativeLayout mWeatherPanel, mWeatherTempsPanel; - private TextView mWeatherCity, mWeatherCondition, mWeatherLowHigh, mWeatherTemp, mWeatherUpdateTime; - private ImageView mWeatherImage; - private LinearLayout mCalendarPanel; - private TextView mCalendarEventTitle, mCalendarEventDetails; // Top-level container view for above views private View mContainer; @@ -216,32 +186,6 @@ class KeyguardStatusViewManager implements OnClickListener { mEmergencyCallButtonEnabledInScreen = emergencyButtonEnabledInScreen; mDigitalClock = (DigitalClock) findViewById(R.id.time); - // 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); - mWeatherUpdateTime = (TextView) findViewById(R.id.update_time); - mWeatherTempsPanel = (RelativeLayout) findViewById(R.id.weather_temps_panel); - - // Hide Weather panel view until we know we need to show it. - if (mWeatherPanel != null) { - mWeatherPanel.setVisibility(View.GONE); - mWeatherPanel.setOnClickListener(this); - } - - // Calendar panel - mCalendarPanel = (LinearLayout) findViewById(R.id.calendar_panel); - mCalendarEventTitle = (TextView) findViewById(R.id.calendar_event_title); - mCalendarEventDetails = (TextView) findViewById(R.id.calendar_event_details); - - // Hide calendar panel view until we know we need to show it. - if (mCalendarPanel != null) { - mCalendarPanel.setVisibility(View.GONE); - } - // Hide transport control view until we know we need to show it. if (mTransportView != null) { mTransportView.setVisibility(View.GONE); @@ -261,12 +205,10 @@ class KeyguardStatusViewManager implements OnClickListener { resetStatusInfo(); refreshDate(); updateOwnerInfo(); - refreshWeather(); - refreshCalendar(); // Required to get Marquee to work. final View scrollableViews[] = { mCarrierView, mDateView, mStatus1View, mOwnerInfoView, - mAlarmStatusView, mCalendarEventDetails, mWeatherCity, mWeatherCondition }; + mAlarmStatusView }; for (View v : scrollableViews) { if (v != null) { v.setSelected(true); @@ -274,287 +216,6 @@ 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 - boolean manualSync = (interval == 0); - if (!manualSync && (((System.currentTimeMillis() - mWeatherInfo.last_sync) / 60000) >= interval)) { - mHandler.sendEmptyMessage(QUERY_WEATHER); - } else if (manualSync && mWeatherInfo.last_sync == 0) { - setNoWeatherData(); - } 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; - boolean invertLowhigh = Settings.System.getInt(resolver, - Settings.System.WEATHER_INVERT_LOWHIGH, 0) == 1; - - if (mWeatherPanel != null) { - 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); - } - } - if (mWeatherCity != null) { - mWeatherCity.setText(w.city); - mWeatherCity.setVisibility(showLocation ? View.VISIBLE : View.GONE); - } - if (mWeatherCondition != null) { - mWeatherCondition.setText(w.condition); - mWeatherCondition.setVisibility(View.VISIBLE); - } - if (mWeatherUpdateTime != null) { - Date lastTime = new Date(mWeatherInfo.last_sync); - String date = DateFormat.getDateFormat(getContext()).format(lastTime); - String time = DateFormat.getTimeFormat(getContext()).format(lastTime); - mWeatherUpdateTime.setText(date + " " + time); - mWeatherUpdateTime.setVisibility(showTimestamp ? View.VISIBLE : View.GONE); - } - if (mWeatherTempsPanel != null && mWeatherTemp != null && mWeatherLowHigh != null) { - mWeatherTemp.setText(w.temp); - mWeatherLowHigh.setText(invertLowhigh ? w.high + " | " + w.low : w.low + " | " + w.high); - mWeatherTempsPanel.setVisibility(View.VISIBLE); - } - - // 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() { - - if (mWeatherPanel != null) { - if (mWeatherImage != null) { - mWeatherImage.setImageResource(R.drawable.weather_na); - } - if (mWeatherCity != null) { - mWeatherCity.setText(R.string.weather_no_data); - mWeatherCity.setVisibility(View.VISIBLE); - } - if (mWeatherCondition != null) { - mWeatherCondition.setText(R.string.weather_tap_to_refresh); - } - if (mWeatherUpdateTime != null) { - mWeatherUpdateTime.setVisibility(View.GONE); - } - if (mWeatherTempsPanel != null ) { - mWeatherTempsPanel.setVisibility(View.GONE); - } - - // 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; - } - - /* - * CyanogenMod Lock screen Calendar related functionality - */ - - private void refreshCalendar() { - if (mCalendarPanel != null) { - final ContentResolver resolver = getContext().getContentResolver(); - String[] nextCalendar = null; - boolean visible = false; // Assume we are not showing the view - - // Load the settings - boolean lockCalendar = (Settings.System.getInt(resolver, - Settings.System.LOCKSCREEN_CALENDAR, 0) == 1); - String[] calendars = parseStoredValue(Settings.System.getString( - resolver, Settings.System.LOCKSCREEN_CALENDARS)); - boolean lockCalendarRemindersOnly = (Settings.System.getInt(resolver, - Settings.System.LOCKSCREEN_CALENDAR_REMINDERS_ONLY, 0) == 1); - long lockCalendarLookahead = Settings.System.getLong(resolver, - Settings.System.LOCKSCREEN_CALENDAR_LOOKAHEAD, 10800000); - - if (lockCalendar) { - nextCalendar = mLockPatternUtils.getNextCalendarAlarm(lockCalendarLookahead, - calendars, lockCalendarRemindersOnly); - if (nextCalendar[0] != null && mCalendarEventTitle != null) { - mCalendarEventTitle.setText(nextCalendar[0].toString()); - if (nextCalendar[1] != null && mCalendarEventDetails != null) { - mCalendarEventDetails.setText(nextCalendar[1]); - } - visible = true; - } - } - - mCalendarPanel.setVisibility(visible ? View.VISIBLE : View.GONE); - } - } - /** * Split the MultiSelectListPreference string based on a separator of ',' and * stripping off the start [ and the end ] @@ -1013,16 +674,6 @@ class KeyguardStatusViewManager implements OnClickListener { public void onClick(View v) { if (v == mEmergencyCallButton) { mCallback.takeEmergencyCallAction(); - } else if (v == mWeatherPanel) { - // Indicate we are refreshing - if (mWeatherCondition != null) { - mWeatherCondition.setText(R.string.weather_refreshing); - } - - mCallback.pokeWakelock(); - if (!mHandler.hasMessages(QUERY_WEATHER)) { - mHandler.sendEmptyMessage(QUERY_WEATHER); - } } } |