Skip to content

Commit

Permalink
Changed date format, changed widgets preview, changed logo, added rus…
Browse files Browse the repository at this point in the history
…sian localization, small fixes.
  • Loading branch information
bubal93 committed Apr 4, 2016
1 parent 7a2fbb6 commit 6a45728
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 27 deletions.
15 changes: 4 additions & 11 deletions app/src/main/java/bubal/tweather/Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import android.preference.PreferenceManager;
import android.text.format.Time;

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

import bubal.tweather.sync.TweatherSyncAdapter;
Expand Down Expand Up @@ -66,11 +64,6 @@ public static String formatTemperature(Context context, double temperature) {
return String.format(context.getString(R.string.format_temperature), temperature);
}

static String formatDate(long dateInMilliseconds) {
Date date = new Date(dateInMilliseconds);
return DateFormat.getDateInstance().format(date);
}

// Format used for storing dates in the database. ALso used for converting those strings
// back into date objects for comparison/processing.
public static final String DATE_FORMAT = "yyyyMMdd";
Expand All @@ -85,10 +78,10 @@ static String formatDate(long dateInMilliseconds) {
*/
public static String getFriendlyDayString(Context context, long dateInMillis, boolean displayLongToday) {
// The day string for forecast uses the following logic:
// For today: "Today, June 8"
// For today: "Today, 8 June"
// For tomorrow: "Tomorrow"
// For the next 5 days: "Wednesday" (just the day name)
// For all days after that: "Mon Jun 8"
// For all days after that: "Mon 8 Jun"

Time time = new Time();
time.setToNow();
Expand All @@ -112,7 +105,7 @@ public static String getFriendlyDayString(Context context, long dateInMillis, bo

} else {
// Otherwise, use the form "Mon Jun 3"
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("EEE MMM dd");
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("EEE dd MMM");
return shortenedDateFormat.format(dateInMillis);
}
}
Expand Down Expand Up @@ -177,7 +170,7 @@ public static String getFormattedMonthDay(Context context, long dateInMillis) {
Time time = new Time();
time.setToNow();
SimpleDateFormat dbDateFormat = new SimpleDateFormat(Utility.DATE_FORMAT);
SimpleDateFormat monthDayFormat = new SimpleDateFormat("MMMM dd");
SimpleDateFormat monthDayFormat = new SimpleDateFormat("dd MMMM");
String monthDayString = monthDayFormat.format(dateInMillis);
return monthDayString;
}
Expand Down
Binary file modified app/src/main/res/drawable-nodpi/widget_preview_detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-nodpi/widget_preview_today.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 105 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="http://schemas.android.com/apk/res-auto">
<string name="app_name">TWeather</string>
<string name="action_credist">О приложении</string>
<string name="action_map">На карте</string>
<string name="action_settings">Настройки</string>
<string name="action_share">Поделиться</string>
<string name="attribution_text"></string>
<string name="condition_2xx">Гроза</string>
<string name="condition_3xx">Изморось</string>
<string name="condition_500">Легкий дождь</string>
<string name="condition_501">Дождь</string>
<string name="condition_502">Сильный дождь</string>
<string name="condition_503">Проливной дождь</string>
<string name="condition_504">Сильный ливень</string>
<string name="condition_511">Холодный дождь</string>
<string name="condition_520">Легкий дождь</string>
<string name="condition_521">Дождь</string>
<string name="condition_522">Сильный дождь</string>
<string name="condition_531">Ливень</string>
<string name="condition_600">Легкий снегопад</string>
<string name="condition_601">Снегопад</string>
<string name="condition_602">Сильный снегопад</string>
<string name="condition_611">Дождь со снегом</string>
<string name="condition_612">Ливень со снегом</string>
<string name="condition_615">Дождь со снегом</string>
<string name="condition_616">Дождь со снегом</string>
<string name="condition_620">Снегопад</string>
<string name="condition_621">Снегопад</string>
<string name="condition_622">Снагопад</string>
<string name="condition_701">Туман</string>
<string name="condition_711">Туманно</string>
<string name="condition_721">Туманно</string>
<string name="condition_731">Песчаная буря</string>
<string name="condition_741">Туманно</string>
<string name="condition_751">Песчаная буря</string>
<string name="condition_761">Буря</string>
<string name="condition_762">Вулканический пепел</string>
<string name="condition_771">Шквал</string>
<string name="condition_781">Торнадо</string>
<string name="condition_800">Ясно</string>
<string name="condition_801">Слегка облачно</string>
<string name="condition_802">Облачно</string>
<string name="condition_803">Пасмурно</string>
<string name="condition_804">Пасмурно</string>
<string name="condition_900">Торнадо</string>
<string name="condition_901">Тропическая буря</string>
<string name="condition_902">Ураган</string>
<string name="condition_903">Холодно</string>
<string name="condition_904">Жара</string>
<string name="condition_905">Ветренно</string>
<string name="condition_906">Град</string>
<string name="condition_951">Спокойно</string>
<string name="condition_952">Слабый ветер</string>
<string name="condition_953">Легкий ветер</string>
<string name="condition_954">Ветер</string>
<string name="condition_955">Свежий ветер</string>
<string name="condition_956">Сильный ветер</string>
<string name="condition_957">Очень сильный ветер</string>
<string name="condition_958">Шторм</string>
<string name="condition_959">Сильный шторм</string>
<string name="condition_960">Гроза</string>
<string name="condition_961">Сильная гроза</string>
<string name="condition_962">Ураган</string>
<string name="empty_forecast_list">Информация о погоде недоступна.</string>
<string name="empty_forecast_list_invalid_location">Информация о погоде недоступна, некорректное местоположение.</string>
<string name="empty_forecast_list_no_network">Информация о погоде недоступна, проверьте подключение к Интернету.</string>
<string name="empty_forecast_list_server_down">Информация о погоде недоступна, проблемы с сервером.</string>
<string name="empty_forecast_list_server_error">Информация о погоде недоступна, проблемы с сервером, проверьте наличие обновлений.</string>
<string name="gcm_weather_alert">Внимание: %1$s в %2$s!</string>
<string name="humidity">Влажность</string>
<string name="muzei_description">Сегодняшняя погода</string>
<string name="pref_current_location_desc">Мое местоположение</string>
<string name="pref_enable_notifications_false">Выключены</string>
<string name="pref_enable_notifications_label">Уведомления о погоде</string>
<string name="pref_enable_notifications_true">Включены</string>
<string name="pref_location_default">Прага</string>
<string name="pref_location_error_description">Некорректное местоположение (<xliff:g id="location_setting">%1$s</xliff:g>)"</string>
<string name="pref_location_label">Местоположение</string>
<string name="pref_location_unknown_description">Проверяем местоположение… (<xliff:g id="location_setting">%1$s</xliff:g>)"</string>
<string name="pref_units_label">Система мер</string>
<string name="pref_units_label_imperial">Британская</string>
<string name="pref_units_label_metric">Метрическая</string>
<string name="pressure">Давление</string>
<string name="title_activity_detail">Подробности</string>
<string name="title_activity_settings">Настройки</string>
<string name="title_widget_detail">TWeather подробно</string>
<string name="title_widget_today">TWeather сегодня</string>
<string name="today">сегодня</string>
<string name="tomorrow">завтра</string>
<string name="wind">Скорость ветра</string>
<string name="a11y_forecast">Прогноз: <xliff:g id="condition">%1$s</xliff:g></string>
<string name="a11y_forecast_icon">Значок прогноза: <xliff:g id="condition">%1$s</xliff:g></string>
<string name="a11y_high_temp">Днем <xliff:g id="high">%1$s</xliff:g></string>
<string name="a11y_humidity">Влажность <xliff:g id="humidity">%1$s</xliff:g></string>
<string name="a11y_low_temp">Ночью <xliff:g id="low">%1$s</xliff:g></string>
<string name="a11y_pressure">Атмосферное давление <xliff:g id="pressure">%1$s</xliff:g></string>
<string name="a11y_wind">Скорость и направление ветра <xliff:g id="wind">%1$s</xliff:g></string>
<string name="format_notification">Прогноз: <xliff:g id="condition">%1$s</xliff:g> Днем: <xliff:g id="high">%2$s</xliff:g> Ночью: <xliff:g id="low">%3$s</xliff:g></string>
<string name="format_pressure"><xliff:g id="pressure">%1.0f</xliff:g> гПа</string>
<string name="format_wind_kmh"><xliff:g id="speed">%1$1.0f</xliff:g> км/ч <xliff:g id="direction">%2$s</xliff:g></string>
<string name="format_wind_mph"><xliff:g id="speed">%1$1.0f</xliff:g> миль/ч <xliff:g id="direction">%2$s</xliff:g></string>
<string name="pref_location_status_key" translatable="false"></string>
<string name="pref_art_pack_label">Наборы иконок</string>
</resources>
31 changes: 15 additions & 16 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
<string name="action_share">Share</string>
<string name="action_credist">Credits</string>

<string name="credits_description">Version 1.0. \n \u00A9 Alexander Bublik, 2016</string>
<string name="credits_description" translatable="false">Version 1.0. \n \u00A9 Alexander Bublik, 2016</string>

<!-- Menu label to fetch updated weather info from the server -->
<string name="action_refresh" translatable="false">Refresh</string>
<string name="title_activity_detail">Details</string>
<string name="title_activity_settings">Settings</string>

Expand All @@ -30,7 +29,7 @@
<string name="pref_location_longitude" translatable="false">loc-longitude</string>

<!-- Default city for location preference [CHAR LIMIT=NONE] -->
<string name="pref_location_default" translatable="false">Prague</string>
<string name="pref_location_default">Prague</string>

<!-- Content description for the get current location button in the location preference -->
<string name="pref_current_location_desc">Use my location</string>
Expand Down Expand Up @@ -71,19 +70,19 @@
<string name="pref_art_pack_label">Icon Pack</string>

<!-- Label for TWeather option in art pack preference [CHAR LIMIT=25] -->
<string name="pref_art_pack_label_tweather">TWeather</string>
<string name="pref_art_pack_label_tweather" translatable="false">TWeather</string>

<!-- Label for Sunny option in art pack preference [CHAR LIMIT=25] -->
<string name="pref_art_pack_label_sunny">Sunny</string>
<string name="pref_art_pack_label_sunny" translatable="false">Sunny</string>

<!-- Label for Plain option in art pack preference [CHAR LIMIT=25] -->
<string name="pref_art_pack_label_plain">Plain</string>
<string name="pref_art_pack_label_plain" translatable="false">Plain</string>

<!-- Label for DarkFlat option in art pack preference [CHAR LIMIT=25] -->
<string name="pref_art_pack_label_dark_flat">DarkFlat</string>
<string name="pref_art_pack_label_dark_flat" translatable="false">DarkFlat</string>

<!-- Label for Beautiful Icons option in art pack preference [CHAR LIMIT=25] -->
<string name="pref_art_pack_label_beautiful_icons">Beautiful Icons</string>
<string name="pref_art_pack_label_beautiful_icons" translatable="false">Beautiful Icons</string>

<!-- Key name for art pack unit preference in SharedPreferences [CHAR LIMIT=NONE] -->
<string name="pref_art_pack_key" translatable="false">art_pack</string>
Expand All @@ -110,11 +109,11 @@
<string name="tomorrow">Tomorrow</string>

<!-- Date format [CHAR LIMIT=NONE] -->
<string name="format_full_friendly_date"><xliff:g id="month">%1$s</xliff:g>, <xliff:g id="day">%2$s</xliff:g></string>
<string name="format_full_friendly_date" translatable="false"><xliff:g id="month">%1$s</xliff:g>, <xliff:g id="day">%2$s</xliff:g></string>

<!-- Strings for formatting weather-related data -->
<!-- Temperature format [CHAR LIMIT=5 -->
<string name="format_temperature"><xliff:g id="temp">%1.0f</xliff:g>\u00B0</string>
<string name="format_temperature" translatable="false"><xliff:g id="temp">%1.0f</xliff:g>\u00B0</string>

<string name="wind">Wind</string>
<!-- Windspeed formats -->
Expand All @@ -129,17 +128,17 @@

<string name="humidity">Humidity</string>
<!-- Humidity format CHAR LIMIT=25]-->
<string name="format_humidity"><xliff:g id="humidity">%1.0f</xliff:g> %%</string>
<string name="format_humidity" translatable="false"><xliff:g id="humidity">%1.0f</xliff:g> %%</string>

<!-- SyncAdapter related -->
<string name="sync_account_type">bubal.tweather</string>
<string name="content_authority">bubal.tweather</string>
<string name="sync_account_type" translatable="false">bubal.tweather</string>
<string name="content_authority" translatable="false">bubal.tweather</string>

<!-- Notification Format -->
<string name="format_notification">Forecast: <xliff:g id="condition">%1$s</xliff:g> High: <xliff:g id="high">%2$s</xliff:g> Low: <xliff:g id="low">%3$s</xliff:g></string>

<!-- Strings related to Notification preference -->
<string name="pref_last_notification">last_notification</string>
<string name="pref_last_notification" translatable="false">last_notification</string>

<!-- Strings related to Widgets -->
<string name="title_widget_today">TWeather Today</string>
Expand Down Expand Up @@ -226,7 +225,7 @@
<string name="condition_961">Violent Storm</string>
<string name="condition_962">Hurricane</string>

<string name="condition_unknown">Unknown (<xliff:g id="low">%1$s</xliff:g>)</string>
<string name="condition_unknown" translatable="false">Unknown (<xliff:g id="low">%1$s</xliff:g>)</string>

<!-- For Shared Element Transitions -->
<string name="detail_icon_transition_name" translatable="false">TN_DetailIcon</string>
Expand All @@ -235,6 +234,6 @@
<string name="gcm_weather_alert">Heads up: %1$s in %2$s!</string>

<!-- For Google Places API Attributions -->
<string name="attribution_text">Powered by Google</string>
<string name="attribution_text" translatable="false">Powered by Google</string>

</resources>

0 comments on commit 6a45728

Please sign in to comment.