Downloading maps button redesign. Adding new string resources to strings.txt and editing old ones.

This commit is contained in:
Vladimir Byko-Ianko 2015-07-13 16:50:48 +03:00 committed by Alex Zolotarev
parent 24b0bfa805
commit 9958491649
5 changed files with 82 additions and 74 deletions

View file

@ -113,7 +113,7 @@ public class MWMApplication extends android.app.Application implements ActiveCou
nativeAddLocalization("country_status_added_to_queue", getString(R.string.country_status_added_to_queue));
nativeAddLocalization("country_status_downloading", getString(R.string.country_status_downloading));
nativeAddLocalization("country_status_download", getString(R.string.country_status_download));
nativeAddLocalization("country_status_download_routing", getString(R.string.country_status_download_routing));
nativeAddLocalization("country_status_download_without_routing", getString(R.string.country_status_download_without_routing));
nativeAddLocalization("country_status_download_failed", getString(R.string.country_status_download_failed));
nativeAddLocalization("try_again", getString(R.string.try_again));
nativeAddLocalization("not_enough_free_space_on_sdcard", getString(R.string.not_enough_free_space_on_sdcard));

View file

@ -51,8 +51,8 @@ void InitLocalizedStrings()
// Texts on the map screen when map is not downloaded or is downloading
f.AddString("country_status_added_to_queue", [L(@"country_status_added_to_queue") UTF8String]);
f.AddString("country_status_downloading", [L(@"country_status_downloading") UTF8String]);
f.AddString("country_status_download_routing", [L(@"country_status_download_routing") UTF8String]);
f.AddString("country_status_download", [L(@"country_status_download") UTF8String]);
f.AddString("country_status_download_without_routing", [L(@"country_status_download_without_routing") UTF8String]);
f.AddString("country_status_download_failed", [L(@"country_status_download_failed") UTF8String]);
f.AddString("try_again", [L(@"try_again") UTF8String]);
// Default texts for bookmarks added in C++ code (by URL Scheme API)

View file

@ -27,27 +27,32 @@ CountryStatusDisplay::CountryStatusDisplay(Params const & p)
gui::Button::Params bp;
bp.m_depth = depth();
bp.m_minWidth = 200;
bp.m_minHeight = 40;
bp.m_minWidth = 260;
bp.m_minHeight = 56;
bp.m_position = graphics::EPosCenter;
auto createButtonFn = [this] (gui::Button::Params const & params)
auto createButtonFn = [this] (gui::Button::Params const & params,
graphics::Color const & activeButtonColor, graphics::Color const & pressedButtonColor)
{
gui::Button * result = new gui::Button(params);
result->setIsVisible(false);
result->setOnClickListener(bind(&CountryStatusDisplay::OnButtonClicked, this, _1));
result->setFont(EActive, graphics::FontDesc(16, graphics::Color(255, 255, 255, 255)));
result->setFont(EPressed, graphics::FontDesc(16, graphics::Color(255, 255, 255, 255)));
result->setFont(EActive, graphics::FontDesc(15, graphics::Color(255, 255, 255, 255)));
result->setFont(EPressed, graphics::FontDesc(15, graphics::Color(255, 255, 255, 255)));
result->setColor(EActive, graphics::Color(0, 0, 0, 0.6 * 255));
result->setColor(EPressed, graphics::Color(0, 0, 0, 0.4 * 255));
result->setColor(EActive, activeButtonColor);
result->setColor(EPressed, pressedButtonColor);
return result;
};
m_primaryButton.reset(createButtonFn(bp));
m_secondaryButton.reset(createButtonFn(bp));
m_primaryButton.reset(createButtonFn(bp, graphics::Color(32, 152, 82, 255),
graphics::Color(24, 128, 68, 255)));
uint8_t constexpr activeAlpha = static_cast<uint8_t>(0.44 * 255);
uint8_t constexpr pressedAlpha = static_cast<uint8_t>(0.72 * 255);
m_secondaryButton.reset(createButtonFn(bp, graphics::Color(0, 0, 0, activeAlpha),
graphics::Color(0, 0, 0, pressedAlpha)));
gui::TextView::Params tp;
tp.m_depth = depth();
@ -355,10 +360,11 @@ void CountryStatusDisplay::SetContentForDownloadPropose()
uint64_t sizeToDownload;
string units;
FormatMapSize(mapAndRoutingSize.first + mapAndRoutingSize.second, units, sizeToDownload);
m_primaryButton->setText(FormatStatusMessage("country_status_download_routing", &sizeToDownload, &units));
m_primaryButton->setText(FormatStatusMessage("country_status_download", &sizeToDownload, &units));
FormatMapSize(mapAndRoutingSize.first, units, sizeToDownload);
m_secondaryButton->setText(FormatStatusMessage("country_status_download", &sizeToDownload, &units));
m_secondaryButton->setText(FormatStatusMessage("country_status_download_without_routing",
&sizeToDownload, &units));
}
void CountryStatusDisplay::SetContentForProgress()
@ -406,13 +412,15 @@ void CountryStatusDisplay::ComposeElementsForState()
ASSERT(visibleCount > 0, ());
m2::PointD const & pv = pivot();
size_t const emptySpace = 16 * visualScale();
if (visibleCount == 1)
m_label->setPivot(pv);
else if (visibleCount == 2)
{
size_t const labelHeight = m_label->GetBoundRect().SizeY();
size_t const buttonHeight = m_primaryButton->GetBoundRect().SizeY();
size_t const commonHeight = buttonHeight + labelHeight + 10 * visualScale();
size_t const commonHeight = buttonHeight + labelHeight + emptySpace;
m_label->setPivot(m2::PointD(pv.x, pv.y - commonHeight / 2 + labelHeight / 2));
m_primaryButton->setPivot(m2::PointD(pv.x, pv.y + commonHeight / 2 - buttonHeight / 2));
@ -422,7 +430,6 @@ void CountryStatusDisplay::ComposeElementsForState()
size_t const labelHeight = m_label->GetBoundRect().SizeY();
size_t const primButtonHeight = m_primaryButton->GetBoundRect().SizeY();
size_t const secButtonHeight = m_secondaryButton->GetBoundRect().SizeY();
size_t const emptySpace = 10 * visualScale();
double const offsetFromCenter = (primButtonHeight / 2 + emptySpace);

View file

@ -211,8 +211,8 @@ Framework::Framework()
m_stringsBundle.SetDefaultString("country_status_added_to_queue", "^\nis added to the downloading queue");
m_stringsBundle.SetDefaultString("country_status_downloading", "Downloading\n^\n^%");
m_stringsBundle.SetDefaultString("country_status_download", "Download map\n^ ^");
m_stringsBundle.SetDefaultString("country_status_download_routing", "Download Map + Routing\n^ ^");
m_stringsBundle.SetDefaultString("country_status_download_failed", "Downloading\n^\nhas failed");
m_stringsBundle.SetDefaultString("country_status_download_without_routing", "Download map\nwithout routing (^ ^)");
m_stringsBundle.SetDefaultString("try_again", "Try Again");
m_stringsBundle.SetDefaultString("not_enough_free_space_on_sdcard", "Not enough space for downloading");

View file

@ -1403,66 +1403,67 @@
nb = Laster ned\n^\n^%
fi = Ladataan\n^\n^%
[country_status_download_routing]
en = Download Map + Routing\n^ ^
tr = Harita + Rota İndir\n^ ^
es = Descargar mapa + itinerario\n^ ^
sv = Ladda ner karta + anvisningar\n^ ^
th = ดาวน์โหลดแผนที่ + การเลือกเส้นทาง\n^ ^
ko = 지도 + 라우팅 다운로드\n^ ^
pl = Pobierz mapę + wyznaczanie tras\n^ ^
pt = Descarregar Mapa + Roteamento\n^ ^
sk = Na stiahnutie Mapa + Trasa\n^ ^
he = הורד מפה + מסלול\n^ ^
hu = Térkép + útvonal letöltése\n^ ^
it = Scarica mappa e percorso\n^ ^
ja = 地図とルートをダウンロード\n^ ^
da = Hent kort + ruteangivelse\n^ ^
nl = Download kaart + routering\n^ ^
fr = Télécharger Carte + Itinéraire\n^ ^
de = Karte + Streckenführung herunterladen\n^ ^
zh-Hans = 下载地图 + 路线\n^ ^
zh-Hant = 下載地圖 + 佈置路線\n^ ^
cs = Stáhnout mapu + trasy\n^ ^
ar = تنزيل الخريطة + تحديد المسار\n^ ^
ru = Скачать карту + маршруты\n^ ^
uk = Завантажити карту + маршрути\n^ ^
id = Unduh Peta + Rute\n^ ^
vi = Tải xuống Bản đồ + Lộ trình\n^ ^
ro = Descărcare hartă + trasee\n^ ^
nb = Last ned kart + rutetilordning\n^ ^
fi = Lataa kartta + reititys\n^ ^
[country_status_download]
comment = Button text for the button at the center of the screen when the country is not downloaded
en = Download Map\n^ ^
th = ดาวน์โหลดแผนที่\n^ ^
uk = Завантажити мапу\n^ ^
tr = Haritayı İndir\n^ ^
es = Descargar mapa\n^ ^
sv = Ladda ner karta\n^ ^
pl = Pobierz mapę\n^ ^
pt = Descarregar Mapa\n^ ^
sk = Stiahnite si Mapu\n^ ^
ja = 地図をダウンロード\n^ ^
ko = 지도 다운로드\n^ ^
he = הורידו מפה\n^ ^
it = Scarica Map\n^ ^
de = Karte herunterladen\n^ ^
da = Download kort\n^ ^
nl = Kaart downloaden\n^ ^
zh-Hans = 下载地图\n^ ^
zh-Hant = 下載地圖\n^ ^
cs = Stáhnout mapu\n^ ^
ar = تحميل الخريطة\n^ ^
hu = Térkép letöltése\n^ ^
ru = Скачать карту\n^ ^
fr = Téléchargez la carte\n^ ^
id = Unduh Peta\n^ ^
vi = Tải xuống Bản đồ\n^ ^
ro = Descărcare hartă\n^ ^
nb = Last ned kart\n^ ^
fi = Lataa kartta\n^ ^
en = Download Map\n(^ ^)
th = ดาวน์โหลดแผนที่\n(^ ^)
uk = Завантажити мапу\n(^ ^)
tr = Haritayı İndir\n(^ ^)
es = Descargar mapa\n(^ ^)
sv = Ladda ner karta\n(^ ^)
pl = Pobierz mapę\n(^ ^)
pt = Descarregar Mapa\n(^ ^)
sk = Stiahnite si Mapu\n(^ ^)
ja = 地図をダウンロード\n(^ ^)
ko = 지도 다운로드\n(^ ^)
he = (^ ^)\nהורידו מפה
it = Scarica Map\n(^ ^)
de = Karte herunterladen\n(^ ^)
da = Download kort\n(^ ^)
nl = Kaart downloaden\n(^ ^)
zh-Hans = 下载地图\n(^ ^)
zh-Hant = 下載地圖\n(^ ^)
cs = Stáhnout mapu\n(^ ^)
ar = (^ ^)\nتحميل الخريطة
hu = Térkép letöltése\n(^ ^)
ru = Скачать карту\n(^ ^)
fr = Téléchargez la carte\n(^ ^)
id = Unduh Peta\n(^ ^)
vi = Tải xuống Bản đồ\n(^ ^)
ro = Descărcare hartă\n(^ ^)
nb = Last ned kart\n(^ ^)
fi = Lataa kartta\n(^ ^)
[country_status_download_without_routing]
comment = Button text for the button at the center of the screen when the country is not downloaded
en = Download map\nwithout routing (^ ^)
th = ดาวน์โหลดแผนที่โดยไม่กำหนดเส้นทาง\n(^ ^)
uk = Завантажити карту\nбез маршрутів (^ ^)
tr = Haritayı rota\nolmadan indirin (^ ^)
es = Descargar mapa\nsin ruta (^ ^)
sv = Hämta karta\nutan rutter (^ ^)
pl = Pobierz mapę bez\noznaczania tras (^ ^)
pt = Baixar mapa\nsem roteamento (^ ^)
sk = Stiahnite si mapu\nbez smerovania (^ ^)
ja = ルートなしで地図をダウンロード\n(^ ^)
ko = 라우팅없이 지도 다운로드\n(^ ^)
he = (^ ^)\nהורד מפה בלי לקבוע מסלול
it = Scarica mappa\nsenza percorsi (^ ^)
de = Karte ohne Routenplanung\nherunterladen (^ ^)
da = Download kort uden\nruteplanlægning (^ ^)
nl = Download kaart\nzonder routeplanning (^ ^)
zh-Hans = 下载不带路线的地图\n(^ ^)
zh-Hant = 下載不帶路線的地圖\n(^ ^)
cs = Stáhnout mapy\nbez směrování (^ ^)
ar = (^ ^)\nتنزيل خريطة بدون تحديد خط السير
hu = Térkép letöltése\nútvonal nélkül (^ ^)
ru = Скачать карту\nбез маршрутов (^ ^)
fr = Télécharger la carte\nsans itinéraire (^ ^)
id = Unduh peta tanpa\nperutean (^ ^)
vi = Tải về bản đồ không\ncó chỉ đường (^ ^)
ro = Descărcare hartă\nfără rutare (^ ^)
nb = Last ned kart\nuten veiviserfunksjon (^ ^)
fi = Lataa kartta\nilman reititystä (^ ^)
[country_status_download_failed]
en = Downloading\n^\nhas failed