From dbb888bed7b3f109d886a626b234add5b7392261 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Wed, 14 Mar 2018 15:16:20 +0000 Subject: [PATCH 01/31] Added translation using Weblate (Slovak) --- app/src/main/res/values-sk/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-sk/strings.xml diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml new file mode 100644 index 000000000..a6b3daec9 --- /dev/null +++ b/app/src/main/res/values-sk/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From b3286bf30f9299de58da70c13696240c7f4a5441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristjan=20R=C3=A4ts?= Date: Wed, 14 Mar 2018 06:23:00 +0000 Subject: [PATCH 02/31] Translated using Weblate (Estonian) Currently translated at 20.3% (94 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/et/ --- app/src/main/res/values-et/strings.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 1120b9ff6..a72c1117f 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -35,7 +35,7 @@ Aktiveeri Deaktiveeri Aktiveeri HRM - Deaktiveeri HRM + Inaktiveeri HRM Aktiveeri süsteemi ilmarakendus Deaktiveeri süsteemi ilmarakendus Paigalda ilmateavituste rakendus @@ -113,4 +113,17 @@ Rakenduste must nimekiri Kalendrite must nimekiri + Olekuriba ikooni ja lukustusekraani märguandeid kuvatakse + Olekuriba ikoon ja lukustuserkaani märguanded on peidetud + + Tugi rakendustele, mis saadavad PebbleKit kaudu märguandeid Pebblele. + ...ka sisse lülitatud ekraaniga + Peata soovimatute märguannete saatmine \"Ära sega\" režiimis + Luba see, kui su seadmel puudub su keele fondi tugi + + Kõne privaatrežiim + Peida nimi, kuva ainult number + Talletatud sõnumid + Vastused + Ühine järelliide From 266d74f7825500e63597843381f81874039ac03e Mon Sep 17 00:00:00 2001 From: TaaviE Date: Wed, 14 Mar 2018 16:40:21 +0000 Subject: [PATCH 03/31] Translated using Weblate (Russian) Currently translated at 90.6% (419 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/ru/ --- app/src/main/res/values-ru/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ee9d19d28..207dc85fd 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -28,7 +28,7 @@ Удалить Удалить и очистить кеш Переустановка - Искать в Pebble Appstore + Искать в Pebble appstore Активировать Деактивировать Включить монитор сердечного ритма @@ -466,4 +466,5 @@ раз в полчаса раз в час + Погода From b433e8fd7634caac0747c3c0c55390c905720e60 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Wed, 14 Mar 2018 16:06:24 +0000 Subject: [PATCH 04/31] Translated using Weblate (Slovak) Currently translated at 98.9% (457 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/sk/ --- app/src/main/res/values-sk/strings.xml | 556 ++++++++++++++++++++++++- 1 file changed, 554 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index a6b3daec9..343644141 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -1,2 +1,554 @@ - - \ No newline at end of file + +Gadgetbridge + + Gadgetbridge + Nastavenia + Ladenie + Ukončiť + Podporiť + Načítať dáta + Nájsť zariadenie + Urobiť snímku obrazovky + Odpojiť + Odstrániť zariadenie + Odstrániť %1$s + Odstráni zariadenie a vymaže všetky dáta! + Otvoriť navigačnú lištu + Zavrieť navigačnú lištu + Podržte kartu dlhšie pre odpojenie + Odpájanie + Pripájanie + Vytvorenie snímky obrazovky zariadenia + + + Ladenie + + Manažér aplikácií + Aplikácie v cache + Nainštalované aplikácie + Nainštalované ciferníky + Odstrániť + Odstrániť z cache + Nainštalovať znovu + Hľadať v Pebble Appstore + Aktivovať + Deaktivovať + Zapnúť meranie tepu + Vypnúť meranie tepu + Aktivovať systémovú aplikáciu pre počasie + Deaktivovať systémovú aplikáciu pre počasie + Nainštalovať aplikáciu pre upozornenia na počasie + Nastaviť + Posunúť hore + + Zakázané upozornenia + + Zakázané upozornenia Kalendára + + Inštalátor FW/Apl + Nainštaluje firmware %s do Mi Band namiesto existujúceho. + Chystáte sa nainštalovať firmvér %s na vašom Amazfit Bip. +\n +\nProsím nezabudnite nainštalovať súbor .fw, potom súbor .res a nakoniec súbor .gps. Vaše hodinky sa po nainštalovaní súboru .fw reštartujú. +\n +\nPoznámka: Nemusíte inštalovať .res a .gps, ak sú tieto súbory presne rovnaké ako tie, ktoré boli nainštalované skôr. +\n +\nROBÍTE TO NA VLASTNÉ RIZIKO! + Chystáte sa nainštalovať firmvér %s do vášho Amazfit Cor. +\n +\nProsím, uistite sa, že ste nainštalovali súbor .fw a potom súbor .res. Vaše hodinky sa po inštalácii súboru .fw reštartujú. +\n +\nPoznámka: Nemusíte inštalovať súbor .res, ak je rovnaký ako nainštalovaný predtým. +\n +\nNETESTOVANÉ, MÔŽE UMŔTVIŤ VAŠE ZARIADENIE, ROBÍTE TO NA VLASTNÉ RIZIKO! + Nainštaluje firmware %1$s a %2$s do Mi Band miesto existujúceho. + Tento firmware bol testovaný a je kompatibilný s Gadgetbridge. + Tento firmware nebol testovaný a nemusí byť kompatibilný s Gadgetbridge. +\n +\nNedoporučujeme ho nahrávať do Mi Band! + Ak budete prokračovať a všetko bude dobre fungovať aj potom, upozornite vývojárov Gadgetbridge, aby označili tento firmvér: %s ako vyskúšaný + + Nastavenia + + Základné nastavenia + Pripojiť zariadenie ak je zapnutý BT + Spúšťať automaticky + Automatické opätovné pripojenie + Preferovaný prehrávač zvukov + Predvolené + Zapnúť možnosť potiahnutia vľavo/vpravo v grafoch aktivít + + Dátum a čas + Nastaviť čas + Nastaviť čas počas pripojenia a pri zmene času v Androide + + Téma + Svetlá + Tmavá + + Jazyk + + Skryť upozornenia Gadgetbridge + V stavovom riadku na obrazovke uzamknutia bude zobrazená ikona a upozornenie + V stavovom riadku na obrazovke uzamknutia nebude zobrazená ikona a upozornenie + + Upozornenia + Opakovanie + Hovory + SMS + Správy Pebble + Podpora pre aplikácie, ktoré posielajú upozornenia do Pebble cez PebbleKit. + Všeobecná podpora upozornení + ...aj keď je displej zapnutý + Nerušiť + Neposielať nechcené upozornenia v režime Nerušiť + Náhrada diakritiky + Toto zapnite, ak vaše zariadenie nepodporuje písma (znaky s diakritikou) pre vás jazyk + + Vždy + Pri vypnutej obrazovke + Nikdy + + Súkromie + Režim súkromého hovoru + Zobraziť meno a číslo + Skryť meno, ale zobraziť číslo + Skryť číslo, ale zobraziť meno + Skryť meno aj číslo + + Počasie + Poloha pre počasie (CM/LOS) + + Zakázané aplikácie + Zakázané kalendáre + + Potlačené správy + Odpovede + Bežná prípona + Zamietnuté hovory + Aktualizovať na Pebble + + Vývojárske nastavenia + Adresa Mi Band + + Nastavenia Pebble + + Sledovače aktivity + Preferovaný sledovač aktivity + Synchronizovať Pebble Health + Synchronizovať Misfit + Synchronizovať Morpheuz + + Podpora odchádzjúcich hovorov + Vypnutím tiež prestanú u Pebble 2/LE vibrácie u odchádzajúcich hovorov + + Povoliť prístup tretích strán k aplikácii Android + Povoliť experimentálnu podporu pre aplikácie Androidu cez PebbleKit + + Časová os Pebble + Východ a západ slnka + Posielať časy východu a západu slnka podľa umiestnenia do Pebble časovej osi + Synchronizácia kalendára + Odosielať udalosti kalendára na časovú os + + Automaticky odstraňovať skryté upozornenia + Upozornenia budú z Pebble odstránené automaticky, ak boli skryté na zariadení s Androidom + + Režim súkromia + Bežné upozornenia + Posunúť text upozornenia mimo obrazovku + Zobraziť iba ikonu notifikácia + + Poloha + Zistiť polohu + Z. šírka + Z. dĺžka + Aktualizovať polohu + Pri spustení zistiť aktuálnu polohu, uloženú polohu použiť ako záložnú + + Povoľte zisťovanie polohy podľa siete + Poloha zistená + + Vynútiť protokol upozornení + Táto voľba vynúti použitie najnovšieho protokolu upozornení podľa verzie firmware. ZAPNITE IBA AK VIETE, ČO ROBÍTE! + Povoliť netestované funkcie + Povolí funkcie, ktoré neboli testované. ZAPNITE IBA AK VIETE, ČO ROBÍTE! + Vždy preferovať BLE + "Použiť experimentálnu podporu Pebble LE pre všetky Pebble zariadenia namiesto klasického BT. Vyžaduje spárovanie Pebble LE \" po pripojení bez LE" + Pebble 2/LE GATT MTU limit + Ak vaše Pebble 2/Pebble LE nepracuje správne, skúste toto nastavenie pre omezenie MTU (povolený rozsah 20-512) + Zapnúť logovanie Watch App + Spôsobí, že logy z aplikácií v hodinkách budú zaznamenávané aplikáciou Gadgetbridge (vyžaduje opätovné pripojenie) + Predčasné potvrdenie (ACK) pre PebbleKit + Spôsobí, že správy odosielané externým aplikáciám tretích strán budú vždy a okamžite potvrdené + Zapnúť JS na pozadí + Ak je zapnuté, umožňuje hodinám zobrazovať počasie, údaje o batérii atď. + + Pokusov o znovupripojenie + + Jednotky + Formát času + Čas zapnutia obrazovky + Celodenné meranie tepu + Nastavenia HPlus/Makibes + + Automatický export + Zapnutý/Vypnutý + Priečinok pre uloženie + Časový interval + Exportovať každú %d hodinu + + Nepripojené + Pripájanie + Pripojené + Neznámy stav + (neznáme) + Test + Test upozornení + Toto je upozornenie z Gadgetbridge + BT nie je podporovaný. + BT je vypnutý. + Dotknite sa pripojeného zariadenia pre zobrazenie správcu aplikácií + Dotknite sa pripojeného zariadenia pre zobrazenie aktivít + Dotknite sa pripojeného zariadenia pre vibrácie + Dotknite sa pripojeného zariadenia pre pripojenie + Nie je možné pripojiť. Je BT adresa v poriadku? + Gadgetbridge je spustený + Instalujem binárny súbor %1$d/%2$d + Inštalácia zlyhala + Inštalácia bola úspešná + CHCETE INŠTALOVAŤ FIRMWARE, POKRAČUJTE NA VLASTNÉ RIZIKO. +\n +\n +\nTento firmware je pre revíziu HW: %s + Inštalujete aplikáciu: +\n +\n +\n%1$s Verzia %2$s od %3$s +\n + Nedostupné + Spustené + %1$s od %2$s + Vyhľadávanie zariadenia + + Zastaviť hľadanie + Spustiť hľadanie + Pripojiť nové zariadenia + %1$s (%2$s) + Párovať zariadenie + Použite párovanie BT Androidu pre spárovanie so zariadením. + Párovať Mi Band + Párujem s %s… + Vytváram väzbu s %1$s (%2$s) + Nie je možné spárovať s %1$s (%2$s) + Vytváram väzbu: %1$s (%2$s) + Väzba s %1$s (%2$s) už existuje, prepájam… + Adresa MAC neprišla, nemôžem spárovať. + Nastavenia zariadenia + Nastavenia Mi Band / Amazfit + Nastavenia Amazfit Bip + Muž + Žena + Iné + Ľavej + Pravej + Užívateľské dáta nie sú platné, teraz používam predvolené. + Keď Mi Band zavibruje a blikne, dotknite sa ho niekoľkokrát po sebe. + Nainštalovať + Nastavte svoje zariadenie pre vyhľadanie. Už pripojené zariadenia nebudú vyhľadané. Zapnite lokalizáciu (GPS) na mobiloch s Androidom 6 a vyšším. Vypnite stráženie súkromia pre Gadgetbridge, pretože môže spôsobiť nestabilitu mobilu. Ak nie je zariadenie vyhľadané v priebehu niekoľkých minút, skúste to znovu po reštarte mobilu. + Poznámka: + Obraz zariadenia + Názov/přezdívka + Počet vibrácií + + Sledovanie spánku + Zapísať logy + Spúšťanie + Načítavanie údajov o aktivite + Od %1$s do %2$s + Na ktorej ruke nosíte + Profil vibrácií + + Staccato + Krátké + Stredné + Dlhé + Kvapka + Zvonenie + Budík + Vibrácie + + Vyskúšať + Upozornenia na SMS + Nastavenia vibrácií + Bežné upozornenia + Upozornenia na emaily + Upozornenia na hovory + Rozhovory (chat) + Navigácia + Sociálne siete + + Celodenné meranie tepu + Raz za minútu + Každých 5 minút + Každých 10 minút + Každých 30 minút + Raz za hodinu + + Zóny rýchlosti + Minút celkovo + Krokov za minútu + + Nájsť stratené zariadenie + Zrušit pro zastavení vibrací. + Vaše aktivity + Nastaviť budíky + Nastavenie budíkov + Detaily budenia + Ne + Po + Ut + St + Št + Pi + So + Inteligentné buzdenie + Nepodarilo sa nastaviť budík, skúste to znova! + Budík bol odoslaný do zariadenia! + Chýbajú dáta, mám ich stiahnuť? + Stiahnuť dáta %1$s z %2$s + Cieľový počet krokov za deň + Chyba spustenia \'%1$s\' + Vaša aktivita (pokusná) + Nedá sa pripojiť k: %1$s + Nemôžem nájsť program na inštaláciu tohto súboru. + Nepodarilo sa nainštalovať súbor: %1$s + Nemožno nainštalovať vybraný firmware: nezhoduje sa HW revíziou vášho Pebble. + Vyčkajte na zistenie stavu inštalácie… + Nízka úroveň nabitia batérie v zariadení! + %1$s zostáva v batérii: %2$s%% + Posledné nabitie: %s +\n + Počet nabití: %s + Export databázy zlyhal! Skontrolujte svoje nastavenia. + Váš spánok + Spánok za týždeň + Spánok dnes, cieľ: %1$s + Kroky za týždeň + Vaša aktivita a spánok + Nahrávám firmvér… + Súbor sa nedá nainštalovať, zariadenie nie je pripravené. + %1$s: %2$s %3$s + Kompatibilná verzia + Netestovaná verzia! + Připojené k zariadeniu: %1$s + Pebble firmvér %1$s + Správná HW revízia + Revízía HW nie je správna! + %1$s (%2$s) + Pri prenose firmvéru nastali ťažkosti. Nereštartujte svoj Mi Band! + Problém pri prenose metadát firmvéru + Inštalácia firmvéru je kompletná + Inštalácia firmvéru je kompletná, reštartujem zariadenie… + Zápis firmvéru zlyhal + Krokov + Kalórií + Vzdialenosť + Meranie času + Tep srdca + Batéria + Súčasná aktivita + Krokov dnes, cieľ: %1$s + Nepotvrdzovať prenos dát o aktivite + Pokiaľ nie je prenos dát potvrdený náramkom, potom nebudú vymazané. To je užitečné, pokiaľ je GB používaný dohromady s inou aplikáciou. + Zachová dáta o aktivite v Mi Band aj po synchronizácii. To je užitečné, ak je GB používaný dohromady s inou aplikáciou. + Použiť režim z nízkym oneskorením pri aktualizácii firmvéru + Môže to pomôcť u zariadenia, kde aktualizácia firmvéru zlyhala + + História krokov + Dnes krokov/min + Celkom krokov + História krokov za minútu + Začať aktivitu + Aktivita + Ľahký spánok + Hlboký spánok + Nenosené + Nepripojené. + Všetky alarmy vypnuté + Zachovať dáta o aktivite v zariadení + Nekompatibilný firmvér + Tento firmware nie je kompatibilný s týmto zariadením + Alarmy pre nadchádzajúce udalosti + Použiť sledovanie tepu pre zlepšenie detekcie spánku + Časový posun zariadenia v hodinách (pre zisťovanie spánku v pracujúcich na smeny) + Mi2: formát datumu + Čas + Time & date + Akcie tlačidla + Nastavenie akcií po stlačení tlačidla Mi Band 2 + Počet stlačení tlačidla + Počet stlačení tlačidla na spustenie vysielania správ + Vysielanie správ + Vysielanie správy po definovanom počte stlačenia tlačidla + Zapnúť akciu tlačidla + Zapnúť akciu na zadaný počet stlačenia tlačidla + Zapnúť vibrovanie náramku + Zapnúť vibrácie náramku pri stlačení tlačidla + Maximálne oneskorenie medzi stlačeniami + Maximálne oneskorenie medzi stlačením tlačidla v milisekundách + Oneskorenie po vykonaní akcie tlačidla + Oneskorenie po vykonaní akcie tlačidla (číslo je v button_id) alebo 0 pre okamžite + Upozornenie na cieľ + Náramok zavibruje pri dosiahnutí cieľa denného počtu krokov + Zobrazenie položiek + Vyberte položky zobrazené na obrazovke náramku + Zapnúť obrazovku pri zdvihnutí + Otočením zápästia prepnúť typ informácie + Nerušiť + Náramok nebude prijímať upozornenia, pokiaľ je aktívny režim Nerušiť + Upozornenia na nečinnosť + Náramok zavibruje, keď budete zadaný čas bez pohybu + Limit času bez pohybu (v minútach) + Vypnutie upozornení na nečinnosť počas zadaného časového intervalu + Od + Do + + Automaticky + Zjednodušená Čínština + Tradičná Čísština + Angličtina + Španielčina + + Prenášam dáta od %1$s + + Čakanie na opätovné pripojenie + + O vás + Rok narodenia + Pohlavie + Výška v cm + Váha v kg + + Overovanie + Vyžiadané overenie + + Spí... + Pridať miniaplikáciu + Preferovaná doba spánku v hodinách + Budík nastavený na %1$02d:%2$02d + Revízia HW: %1$s + Verzia FW: %1$s + Chyba pri vytváraní adresára pre logy: %1$s + "Tep: " + Prebieha aktualizácia firmvéru + Firmvér neodoslaný + Tep srdca + Tep srdca + + Uložiť hrubý záznam do databázy + Ak je zaškrtnuté, tak sú dáta uložené v pôvodnej podobe pre neskoršie vyhodnotenie. Databáza bude v tom prípade väčšia! + Správa databázy + Správa databázy + Pre operácie s databázou sa použije nasledujúca cesta v zariadení. +\nTáto cesta je dostupná aj pre ostatné aplikácie Androidu a aj váš počítač. +\nExportovanú databázu (alebo miesto pre importovanú databázu) nájdete tu: + Vymazať pôvodnú databázu + Nemožno pristúpiť na zadanú cestu. Kontaktujte vývojárov. + Exportované do: %1$s + Chyba pri exporte DB: %1$s + Chyba pri exporte preferencií: %1$s + Importovať dáta? + Naozaj chcete prepísať aktuálnu databázu? Všetky uložené dáta o aktivite sa stratia. + Import bol úspešný. + Chyba pri importe DB: %1$s + Chyba pri importe preferencií: %1$s + Vymazať dáta o aktivitách? + Naozaj chcete vymazať celú databázu? Všetky dáta o aktivitách a informácie o zariadeniach sa stratia. + Dáta boli úspešne vymazané. + Mazanie dát zlyhalo. + Vymazať pôvodnú databázu? + Naozaj chcete vyzmazať pôvodnú databázu? Dáta o aktivitách, ktorá neboli importované sa stratia. + Pôvodná databáza bola vymazaná. + Mazanie pôvodnej databázy zlyhalo. + Pprepísať + Zrušiť + Odstrániť + + Vibrácie + + Párovánie Pebble + Dialóg párovania by sa mal objaviť na vašom zariadení s Androidom. Ak sa tak nestane, skontrolujte panel upozornení a potvrďte párovanie. Potom potvrďte párovanie na Pebble + + Uistite sa, že tento skin je povolený v aplikácii pre upozornenia stavu počasia pre získavanie informácií z vášho Pebble. +\n +\nNie je potrebné nič nastavovať. +\n +\nAplikáciu pre počasie Pebble je možné povoliť v správe aplikácií. +\n +\nPodporované ciferníky ukážu počasie automaticky. + Zapnúť BT párovanie + Toto vypnite v prípade problémov s pripojením + + Metrické + Imperiálne + + 24h + dop./odp. + + Budík + + Aktivity Webový pohľad + + (%1$s) + Nájdené! + Formát času Mi2 + Pred inštaláciou tohto firmvéru musíte nainštalovať verziu %1$s! + Textové upozornenia + Needs firmware >= 1.0.1.28 and Mili_pro.ft* installed. + Vyp. + Vyp. + Automaticky (detekcia spánku) + Naplánované (časový interval) + Pokus o spárovanie s %1$s + Spojenie s %1$s okamžite zlyhalo. + Pokušam sa spojiť s: %1$s + Ak chcete nájsť zariadenia, povoľte funkciu Bluetooth. + Spojené s %1$s. + Párovať s %1$s? + Ak chcete spárovať svoje zariadenia, kliknite na Párovať. Ak to zlyhá, skúste to znovu bez párovania. + Párovať + Nepárovať + + Otvoriť na telefóne + Stlmiť + Znovu + + Firmvér + Neplatné dáta + Písmo + GPS Firmvér + Almanach GPS + Korekcia chýb GPS + Zdroje + Ciferník + + Neznáme zariadenie + Testovacie zariadenie + Pebble + Mi Band + Mi Band 2 + Amazfit Bip + Amazfit Cor + Vibratissimo + LiveView + HPlus + Makibes F68 + Exrizu K8 + No.1 F1 + Teclast H30 + XWatch + + Vyberte umiestnenie exportu + Gadgetbridge upozornenia + From ecf5fea77969625e1d301f847091a25333fd3f29 Mon Sep 17 00:00:00 2001 From: Robert Barat Date: Wed, 14 Mar 2018 17:38:56 +0000 Subject: [PATCH 05/31] Translated using Weblate (Slovak) Currently translated at 100.0% (462 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/sk/ --- app/src/main/res/values-sk/strings.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 343644141..6fccb2496 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -175,7 +175,7 @@ Povolí funkcie, ktoré neboli testované. ZAPNITE IBA AK VIETE, ČO ROBÍTE! Vždy preferovať BLE "Použiť experimentálnu podporu Pebble LE pre všetky Pebble zariadenia namiesto klasického BT. Vyžaduje spárovanie Pebble LE \" po pripojení bez LE" - Pebble 2/LE GATT MTU limit + Pebble 2/LE GATT MTU ohraničenie Ak vaše Pebble 2/Pebble LE nepracuje správne, skúste toto nastavenie pre omezenie MTU (povolený rozsah 20-512) Zapnúť logovanie Watch App Spôsobí, že logy z aplikácií v hodinkách budú zaznamenávané aplikáciou Gadgetbridge (vyžaduje opätovné pripojenie) @@ -266,7 +266,7 @@ Spúšťanie Načítavanie údajov o aktivite Od %1$s do %2$s - Na ktorej ruke nosíte + Na ktorej ruke nosíte? Profil vibrácií Staccato @@ -384,7 +384,7 @@ Časový posun zariadenia v hodinách (pre zisťovanie spánku v pracujúcich na smeny) Mi2: formát datumu Čas - Time & date + Čas a dátum Akcie tlačidla Nastavenie akcií po stlačení tlačidla Mi Band 2 Počet stlačení tlačidla @@ -505,7 +505,7 @@ Formát času Mi2 Pred inštaláciou tohto firmvéru musíte nainštalovať verziu %1$s! Textové upozornenia - Needs firmware >= 1.0.1.28 and Mili_pro.ft* installed. + Vyžaduje firmvér >= 1.0.1.28 and Mili_pro.ft* installed. Vyp. Vyp. Automaticky (detekcia spánku) @@ -551,4 +551,5 @@ Vyberte umiestnenie exportu Gadgetbridge upozornenia - +Pripojiť + From 56d8b14cf388f085adc8834fe6c0b76824207465 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Wed, 14 Mar 2018 16:14:34 +0000 Subject: [PATCH 06/31] Translated using Weblate (Czech) Currently translated at 98.2% (454 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/cs/ --- app/src/main/res/values-cs/strings.xml | 248 ++++++++++++++++--------- 1 file changed, 160 insertions(+), 88 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index c1d111a3f..504a3925b 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -27,8 +27,8 @@ Instalované ciferníky Odstranit Odstranit z cache - Naintalovat znovu - Hledat v Pebble Appstore + Nainstalovat znovu + Hledat v Pebble appstore Aktivovat Deaktivovat Zapnout měření pulzu @@ -70,17 +70,17 @@ Opakování Volání SMS - Zpráva Pebble - Podpora pro aplikace, které posílají notifikace do Pebble via PebbleKit. + Zprávy Pebble + Podpora pro aplikace, které posílají notifikace do Pebble přes PebbleKit. Obecná podpora notifikací - ... také pokud je displej zapnutý + ...také pokud je displej zapnutý Nerušit - Neposílat nechtěné notifikace podle režimu Nerušit. - Přepsání - Toto zapněte, pokud vaše zařízení nepodporuje písma pro vás jazyk. - vždy - pokud je vypnutý displej - nikdy + Neposílat nechtěné notifikace v režimu Nerušit + Přepsání diakritiky + Toto zapněte, pokud vaše zařízení nepodporuje písma pro vás jazyk + Vždy + Pokud je vypnutý displej + Nikdy Soukromí Režim soukromého volání Zobrazit jméno a číslo @@ -102,10 +102,10 @@ Synchronizovat Morpheuz Podpora odchozích volání Vypnutím také přestane Pebble 2/LE vibrovat při odchozích voláních - Povolit přístup aplikacím 3. stran z Androidu - Povolot experimentální podporu pro aplikace Androidu přes PebbleKit + Povolit přístup třetích stran k aplikaci Android + Povolit experimentální podporu pro aplikace Androidu přes PebbleKit Východ a západ slunce - Zasílat časy východu a západu slunce podle umístění do Pebble timeline + Zasílat časy východu a západu slunce podle umístění do Pebble časové osi Odstraňovat skryté notifikace automaticky Notifikace budou z Pebble odstraněny automaticky, pokud byly skryty na zařízení s Androidem Soukromý režim @@ -131,14 +131,14 @@ Zapnout logování Watch App Logy od watch app budou logovány v Gadgetbridge (vyžaduje znovupřipojení) Předčasné potvrzení (ACK) pro PebbleKit - Způsobí, že zprávy zaslané externím aplikacím 3. stran budou potvrzeny vždy a okamžitě. + Způsobí, že zprávy zaslané externím aplikacím 3. stran budou potvrzeny vždy a okamžitě Pokusů o znovupřipojení Jednotky Formát času Doba zapnutí displeje Celodenní měření tepu Nastavení HPlus/Makibes - nepřipojeno + Nepřipojeno Připojování Připojeno Neznámý stav @@ -159,9 +159,12 @@ Instaluji binární %1$d/%2$d Instalace selhala Instalace úspěšná - CHCETE INSTALOVAT FIRMWARE, POKRAČUJTE NA SVÉ RIZIKO. \n\n\n Tento firmware je pro revizi HW: %s + CHCETE INSTALOVAT FIRMWARE, POKRAČUJTE NA SVÉ RIZIKO. +\n +\n +\nTento firmware je pro revizi HW: %s Instalujete aplikaci:\n\n\n%1$s Verze %2$s od %3$s\n - nedostupné + Nedostupné Spuštěno %1$s od %2$s Hledání zařízení @@ -179,12 +182,12 @@ Vazba s %1$s (%2$s) již existuje, propojuji… Adresa MAC nepřišla, nemohu párovat. Nastavení zařízení - Nastavení Mi Band / Bip - muž - žena - jiný - vlevo - vpravo + Nastavení Mi Band / Amazfit + Muž + Žena + Jiný + Vlevo + Vpravo Data uživatele nejsou platná, nyní používám vzorová. Když Mi Band zavibruje a blikne, dotkněte se jej několikrát po sobě. Instalovat @@ -195,9 +198,9 @@ Počet vibrací Sledování spánku Zapsat logy - spouštím + Spouštím Stahuji data o aktivitě - Z %1$s do %2$s + Od %1$s do %2$s Nosíte vlevo nebo vpravo? Profil vibrací Staccato @@ -234,7 +237,7 @@ Nepodařilo se nastavit budík, zkuste to znovu! Budík zaslán do zařízení! Chybí data, provést stažení? - Stahnout data %1$s od %2$s + Stahnout data %1$s z %2$s Cílový počet kroků na den Chyba spouštění \'%1$s\' Vaše aktivita (zkušební) @@ -267,13 +270,13 @@ Instalace firmware je kompletní Instalace firmware je kompletní, restartuji zařízení… Zápis firmware selhal - Kroky + Kroků Současná aktivita - Kroky dnes, cíl: %1$s + Kroků dnes, cíl: %1$s Nepotvrzovat přenos dat o aktivitě Pokud není přenos dat potvrzen náramku, potom nebudou smazána. Užitečné pokud je GB používán dohromady s jinou aplikací. Zachová data o aktivitě v Mi Band i po synchronizaci. Užitečné pokud je GB používán dohromady s jinou aplikací. - Použít režim z nízkým zpožděním pro aktualizace firmwaru. + Použít režim z nízkým zpožděním pro aktualizace firmwaru Může to pomoci u zařízení, kde aktualizace firmwaru selhala Historie kroků Aktuálně kroků/min @@ -294,7 +297,7 @@ Časový posun zařízení v hodinách (pro zjišťování spánku směnařů) Mi2: formát data Čas - Datum a čas + Time & date Zapnout displej při zvednutí Přenáším data od %1$s Čekání na znovupřipojení @@ -303,7 +306,7 @@ Pohlaví Výška v cm Váha v kg - ověřování + Ověřování Ověřování vyžadováno Spí... Přidat widget @@ -345,7 +348,7 @@ Vibrace Párování Pebble - Dialog párování by se měl objevit na vašem zařízení s Androidem. Pokud se to nestane, zkontrolujte panel notifikací a potvrďte párování. Potom potvrďte párování na Pebble. + Dialog párování by se měl objevit na vašem zařízení s Androidem. Pokud se to nestane, zkontrolujte panel notifikací a potvrďte párování. Potom potvrďte párování na Pebble Ujistěte se, že tento skin je povolen v aplikaci pro oznámení počasí pro získávání informací v Pebble.\n\nNení třeba nic nastavovat.\n\nAplikaci pro počasí Pebble je možné povolit ve správě aplikací.\n\nPodporované ciferníky ukáží počasí automaticky. Zapnout párování BT Toto vypněte v případě problémů s připojením @@ -357,77 +360,146 @@ (%1$s) Nalezeno! Formát času Mi2 -Přispět - Zakázané kalendáře +Podpořit + Zakázané notifikace Kalendáře - Skryj číslo a zobraz jméno + Skrýť číslo, ale zobrazit jméno Zakázané kalendáře - Časová osa Pebble + Časová os Pebble Synchronizace kalendáře - Odeslat události do časové osy + Odesílat události kalendáře na časovou osu Zóny rychlosti - Celkem minut + Minut celkovo Kroků za minutu Kalorií Vzdálenost - Hodiny - Srdeční tep - Baterie - Oznámení splnění cíle - Náramek bude vibrovat při splnění denního cíle kroků - Zobrazit položky - Vybrat zobrazované položky na displeji náramku - Otáčením zápěstí změnit stav + Měření času + Tep srdca + Batéria + Upozornění na cíl + Náramek zavibruje při dosažení cíle denního počtu kroků + Zobrazení položek + Vyberte položky zobrazené na obrazovce náramku + Otočením zápěstí přepnout typ informace Nerušit - Při zapnutí nebude náramek přijímat notifikace - Varování při neaktivitě - Náramek bude vibrovat pokud budete určitou dobu neaktivní - Doba neaktivity (v minutách) - Vypnout varování na neaktivitu v určené době - Začátek - Konec - Chyba při exportu nastavení: %1$s - Chyba při importu nastavení: %1$s - Je třeba instalovat verzi %1$s před instalací FW! - Textové notifikace - Je nutné mít FW >= 1.0.1.28 a nainstalováno Mili_pro.ft*. - Vypnuto - Vypnuto - Automaticky (podle spánku) - Časováno (časový úsek) - Zouším párovat s %1$s - Spojení s %1$s selhalo ihned. - Zkouším spojení s: %1$s - Zapnout BT pro hledání zařízení. - Spojeno úspěšně s %1$s. + Náramek nebude přijímat upozornění, pokud je aktivní režim Nerušit + Upozornění na nečinnost + Náramek zavibruje, když budete zadaný čas bez pohybu + Limit času bez pohybu (v minutách) + Vypnutí upozornění na nečinnost během zadaného časového intervalu + Od + Do + Chyba při exportu preferencí: %1$s + Chyba při importu preferencí: %1$s + Před instalací tohoto firmwaru musíte nainstalovat verzi %1$s! + Textové upozornění + Needs firmware >= 1.0.1.28 and Mili_pro.ft* installed. + Vyp. + Vyp. + Automaticky (detekce spánku) + Naplánovano (časový interval) + Pokus o spárování %1$s + Spojení s %1$s ihned selhalo. + Pokouším sa spojit s: %1$s + Chcete-li najít zařízení, povolte funkci Bluetooth. + Spojeno s %1$s. Párovat s %1$s? - Vyberte Párování pro spárování s vaším zaříením. Pokud to selže, tak to zkuste bez párování. - Párování + Chcete-li spárovat svá zařízení, klepněte na Párovat. Pokud to selže, zkuste to znovu bez párování. + Párovat Nepárovat Akce tlačítka - Definujte akce při stisku tlačítka na Mi Band 2 - Počet stisků tlačítka - Definujte počet stisknutí tlačítka k vyslání broadcast zprávy - Zpráva k vyslání (broadcast) - Zpráva k vyslání do systému pokud počtu stisknutí tlačítka (viz výše) - Povolit akci tlačítka - Povolit akci tlačítka na definovaný počet stisknutí - Povolit vibrace náramku - Povolit vibrace náramku při vyslání broadcast zprávy - Maximální prodleva mezi stisky - Maximální prodleva mezi stisky tlačítka v milisekundách - Prodleva před akcí - Prodleva před akcí tlačítka. Umožňuje více průchodů (v extra button_id u Intent) nebo 0 pro okamžitou akci -Chystáte se nainstalovat firmware %s namísto toho, který je aktuálně na vašem Amazfit Bipu. + Nastavení akcí po stisknutí tlačítka Mi Band 2 + Počet stisknutí tlačítka + Počet stisknutí tlačítka na spuštění vysílání zpráv + Vysílání zpráv + Vysílání zprávy po definovaném počtu stisknutí tlačítka + Zapnout akci tlačítka + Zapnout akci na zadaný počet stisknutí tlačítka + Zapnout vibrování náramku + Zapnout vibrace náramku při stisknutí tlačítka + Maximální zpoždění mezi stisky + Maximální zpoždění mezi stisknutím tlačítka v milisekundách + Zpoždění po provedení akce tlačítka + Zpoždění po provedení akce tlačítka (číslo je v button_id) nebo 0 pro okamžitě +Chystáte se nainstalovat firmware %s na vašem Amazfit Bip. \n -\nUjistěte se, že jste nainstalovali firmware .gps, pak soubor .res a nakonec soubor .fw. Hodiny se po instalaci souboru .fw restartují. +\nProsím nezapomeňte nainstalovat soubor .fw, potom soubor .res a nakonec soubor .gps. Vaše hodinky se po instalaci souboru .fw restartují. \n -\nPoznámka: Nemusíte instalovat soubory .res a .gps, pokud jsou tyto soubory přesně stejné jako ty, které byly dříve nainstalovány. +\nPoznámka: Nemusíte instalovat .res a .gps, pokud jsou tyto soubory přesně stejné jako ty, které byly nainstalovány dříve. \n -\nEXPERIMENTÁLNÍ PROCES, DĚLÁTE NA VAŠE VLASTNÍ RIZIKO +\nDĚLÁTE TO NA VLASTNÍ NEBEZPEČÍ! "Firmware Amazfit Bipu %1$s" Připojit - + Chystáte se nainstalovat firmware %s do vašeho Amazfit Cor. +\n +\nProsím, ujistěte se, že jste nainstalovali soubor .fw a potom soubor .res. Vaše hodinky se po instalaci souboru .fw restartují. +\n +\nPoznámka: Nemusíte instalovat soubor .res, pokud je stejný jako nainstalován dříve. +\n +\n NETESTOVÁNO, MŮŽE UMRTVIT VAŠE ZAŘÍZENÍ, DĚLÁTE TO NA VLASTNÍ NEBEZPEČÍ! + Zapnout možnost potažení vlevo/vpravo v grafech aktivit + + Počasí + Poloha pro počasí (CM/LOS) + + Zapnout JS na pozadí + Pokud je zapnuto, umožňuje hodinám zobrazovat počasí, údaje o baterii atd. + + Automatický export + Zapnutý/Vypnutý + Složka pro uložení + Časový interval + Exportovat každou %d hodinu + + Nastavení Amazfit Bip + Celodenní měření tepu + Jednou za minutu + Každých 5 minut + Každých 10 minut + Každých 30 minut + Jednou za hodinu + + Export databáze selhal! Zkontrolujte svá nastavení. + Automaticky + Zjednodušená Čínština + Tradiční Čísština + Angličtina + Španělština + + Aktivity Webový pohled + + Otevřít na telefonu + Ztlumit + Znova + + Firmvér + Neplatná data + Písmo + GPS Firmvér + Almanach GPS + Korekce chyb GPS + Zdroje + Ciferník + + Neznámé zařízení + Testovací zařízení + Pebble + Mi Band + Mi Band 2 + Amazfit Bip + Amazfit Cor + Vibratissimo + LiveView + HPlus + Makibes F68 + Exrizu K8 + No.1 F1 + Teclast H30 + XWatch + + Vyberte umístění exportu + Gadgetbridge notifikace + From 6689f744568dee0d438d9466db27dfb9c2240ab5 Mon Sep 17 00:00:00 2001 From: Robert Barat Date: Wed, 14 Mar 2018 17:47:41 +0000 Subject: [PATCH 07/31] Translated using Weblate (Czech) Currently translated at 100.0% (462 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/cs/ --- app/src/main/res/values-cs/strings.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 504a3925b..54d38e89b 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -126,7 +126,7 @@ Povolí funkce, které nebyl testovány. POVOLTE, JEN POKUD VÍTE, CO DĚLÁTE! Vždy preferovat BLE Použít experimentální podporu Pebble LE pro všechny Pebble místo BT classic, vyžaduje spárování \"Pebble LE\" po připojení bez LE - Pebble 2/LE GATT MTU limit + Pebble 2/LE GATT MTU ohraničení Pokud vaše Pebble 2/Pebble LE nepracuje jak má, zkuste toto nastavení pro omezení MTU (povolený rozsah 20-512) Zapnout logování Watch App Logy od watch app budou logovány v Gadgetbridge (vyžaduje znovupřipojení) @@ -261,7 +261,7 @@ Kompatibilní verze Netestovaná verze! Připojení k zařízení: %1$s - Pebble Firmware %1$s + Pebble Firmvér %1$s Správná revize HW Revize HW není správná! %1$s (%2$s) @@ -269,7 +269,7 @@ Problém při přenosu matadat firmware Instalace firmware je kompletní Instalace firmware je kompletní, restartuji zařízení… - Zápis firmware selhal + Zápis firmvéru selhal Kroků Současná aktivita Kroků dnes, cíl: %1$s @@ -297,7 +297,7 @@ Časový posun zařízení v hodinách (pro zjišťování spánku směnařů) Mi2: formát data Čas - Time & date + Čas a dátum Zapnout displej při zvednutí Přenáším data od %1$s Čekání na znovupřipojení @@ -316,7 +316,7 @@ Verze FW: %1$s Chyba při vytváření adresáře pro logy: %1$s "Tep: " - Probíhá aktualizace firmware + Aktualizace firmware Firmware neodeslán Srdeční tep Srdeční tep @@ -331,11 +331,11 @@ Chyba při exportu DB: %1$s Importovat data? Opravdu chcete přepsat aktuální databázi? Všechna uložená data o aktivitě se ztratí. - Import byl úspěšný. + Importováno. Chyba při importu DB: %1$s Smazat data o aktivitách? Opravdu chcete smazat celou databázi? Všechna data o aktivitách a informace o zařízeních se ztratí. - Data úspěšně smazána. + Data smazána. Mazání dat se nezdařilo. Smazat původní databázi? Opravdu chcete smazat původní databázi? Data o aktivitách, která nebyla importována budou ztracena. @@ -396,7 +396,7 @@ Chyba při importu preferencí: %1$s Před instalací tohoto firmwaru musíte nainstalovat verzi %1$s! Textové upozornění - Needs firmware >= 1.0.1.28 and Mili_pro.ft* installed. + Vyžaduje aby byl nainstalován font >= 1.0.1.28 and Mili_pro.ft*. Vyp. Vyp. Automaticky (detekce spánku) From 69740654c005606595805a5a7add3a0a7e3129d7 Mon Sep 17 00:00:00 2001 From: Taavi Date: Wed, 14 Mar 2018 19:30:39 +0200 Subject: [PATCH 08/31] Update arrays.xml Added both Czech and Slovak as requested here: https://github.com/Freeyourgadget/Gadgetbridge/issues/1022 --- app/src/main/res/values/arrays.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index dc290da03..3da9a3ff2 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -13,6 +13,7 @@ System Default + Čeština Deutsch English Español @@ -25,10 +26,12 @@ 한국어 日本語 Magyar + Slovenčina default + cz de en es @@ -41,6 +44,7 @@ ko ja hu + sk @@ -235,5 +239,4 @@ 1800 3600 - - \ No newline at end of file + From 3e903362e687d11ae9d1f3cea108747eb94b2a92 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 17 Mar 2018 15:58:44 +0100 Subject: [PATCH 09/31] Explicitly ask for RECEIVE_SMS permission at startup. Should fix #1025 --- .../freeyourgadget/gadgetbridge/activities/ControlCenterv2.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenterv2.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenterv2.java index 533c51f1f..fca25155a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenterv2.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenterv2.java @@ -309,6 +309,8 @@ public class ControlCenterv2 extends AppCompatActivity wantedPermissions.add(Manifest.permission.READ_PHONE_STATE); if (ContextCompat.checkSelfPermission(this, Manifest.permission.PROCESS_OUTGOING_CALLS) == PackageManager.PERMISSION_DENIED) wantedPermissions.add(Manifest.permission.PROCESS_OUTGOING_CALLS); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) == PackageManager.PERMISSION_DENIED) + wantedPermissions.add(Manifest.permission.RECEIVE_SMS); if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_SMS) == PackageManager.PERMISSION_DENIED) wantedPermissions.add(Manifest.permission.READ_SMS); if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS) == PackageManager.PERMISSION_DENIED) From d286f497f08afcb93015ef08c0e047b5fff9cc79 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 17 Mar 2018 16:12:40 +0100 Subject: [PATCH 10/31] Pebble: Iterate over knownKeys only if they are present. Fixes #1027 --- .../gadgetbridge/util/PebbleUtils.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java index 9e0c71a00..c0bbceee8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/PebbleUtils.java @@ -135,16 +135,19 @@ public class PebbleUtils { JSONObject knownKeys = PebbleUtils.getAppConfigurationKeys(uuid); SparseArray appKeysMap = new SparseArray<>(); + String inKey, outKey; +// TODO: The fact that knownKeys is null for the passed UUID means that the +// watchapp was installed by some other app, hence we cannot communicate with it. +// The user could be warned somehow. if (knownKeys == null || msg == null) { msg = "[]"; - } - - String inKey, outKey; - //knownKeys contains "name"->"index", we need to reverse that - for (Iterator key = knownKeys.keys(); key.hasNext(); ) { - inKey = key.next(); - appKeysMap.put(knownKeys.optInt(inKey), inKey); + } else { + //knownKeys contains "name"->"index", we need to reverse that + for (Iterator key = knownKeys.keys(); key.hasNext(); ) { + inKey = key.next(); + appKeysMap.put(knownKeys.optInt(inKey), inKey); + } } try { From 8e67f3130935fbe7a6b6485b6fd1e85ac79bb733 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 17 Mar 2018 16:57:02 +0100 Subject: [PATCH 11/31] Pebble Webview: check the availability of Internet Helper packages before binding the service to it. Could help with #643, but it's a blind attempt. --- .../gadgetbridge/util/WebViewSingleton.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java index dbf32bc4c..75c01f220 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.MutableContextWrapper; import android.content.ServiceConnection; +import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -63,7 +64,8 @@ public class WebViewSingleton { public static boolean internetHelperBound; public static CountDownLatch latch; public static WebResourceResponse internetResponse; - public final static Messenger internetHelperListener = new Messenger(new IncomingHandler()); + public static Messenger internetHelperListener; + private static boolean internetHelperInstalled; private WebViewSingleton() { } @@ -71,7 +73,7 @@ public class WebViewSingleton { public static synchronized void ensureCreated(Activity context) { if (webViewSingleton.instance == null) { webViewSingleton.contextWrapper = new MutableContextWrapper(context); - webViewSingleton.mainLooper = context.getMainLooper(); + webViewSingleton.mainLooper = webViewSingleton.contextWrapper.getMainLooper(); webViewSingleton.instance = new WebView(webViewSingleton.contextWrapper); WebView.setWebContentsDebuggingEnabled(true); webViewSingleton.instance.setWillNotDraw(true); @@ -170,10 +172,21 @@ public class WebViewSingleton { webView.loadUrl("file:///android_asset/app_config/configure.html?rand=" + Math.random() * 500); } }); - if (!internetHelperBound) { - Intent intent = new Intent(); - intent.setComponent(new ComponentName("nodomain.freeyourgadget.internethelper", "nodomain.freeyourgadget.internethelper.MyService")); - webViewSingleton.contextWrapper.getApplicationContext().bindService(intent, internetHelperConnection, Context.BIND_AUTO_CREATE); + if (!internetHelperBound && !internetHelperInstalled) { + String internetHelperPkg = "nodomain.freeyourgadget.internethelper"; + String internetHelperCls = internetHelperPkg + ".MyService"; + try { + webViewSingleton.contextWrapper.getPackageManager().getApplicationInfo(internetHelperPkg, 0); + Intent intent = new Intent(); + intent.setComponent(new ComponentName(internetHelperPkg, internetHelperCls)); + webViewSingleton.contextWrapper.getApplicationContext().bindService(intent, internetHelperConnection, Context.BIND_AUTO_CREATE); + internetHelperListener = new Messenger(new IncomingHandler()); + internetHelperInstalled = true; + } + catch (PackageManager.NameNotFoundException e) { + internetHelperInstalled = false; + LOG.info("WEBVIEW: Internet helper not installed, only mimicked HTTP requests will work."); + } } } From ec1f4505bdcad6a8de405b0e446769878632a728 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 17 Mar 2018 18:50:53 +0100 Subject: [PATCH 12/31] Pebble: prevent crashing when the ExternalPebbleJS Activity was not running when receiving configuration data from the external browser. Parse the passed data to load the correct watchface javascript, and ensure the currently connected device is a Pebble (and try to reconnect if there is no device connected, as a bonus) --- .../activities/ExternalPebbleJSActivity.java | 75 ++++++++++++++++--- .../gadgetbridge/util/WebViewSingleton.java | 7 ++ 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java index 7da2f0c38..fe3914d1a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java @@ -34,19 +34,26 @@ import android.widget.Toast; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; import java.util.Objects; import java.util.UUID; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.model.DeviceService; +import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; +import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService; import nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.GBChromeClient; import nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.GBWebClient; import nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.JSInterface; +import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper; import nodomain.freeyourgadget.gadgetbridge.util.GB; import nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton; +import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_CONNECT; + public class ExternalPebbleJSActivity extends AbstractGBActivity { private static final Logger LOG = LoggerFactory.getLogger(ExternalPebbleJSActivity.class); @@ -64,24 +71,69 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); + + boolean showConfig = false; + + UUID currentUUID = null; + GBDevice currentDevice = null; + if (extras == null) { - throw new IllegalArgumentException("Must provide device and uuid in extras when invoking this activity"); - } + confUri = getIntent().getData(); + if(confUri.getScheme().equals("gadgetbridge")) { + try { + currentUUID = UUID.fromString(confUri.getHost()); + } catch (IllegalArgumentException e) { + LOG.error("UUID in incoming configuration is not a valid UUID: " +confUri.toString()); + } - if (extras.getBoolean(START_BG_WEBVIEW, false)) { - startBackgroundWebViewAndFinish(); - return; - } + //first check if we are still connected to a pebble + DeviceManager deviceManager = ((GBApplication) getApplication()).getDeviceManager(); + List deviceList = deviceManager.getDevices(); + for (GBDevice device : deviceList) { + if (device.getState() == GBDevice.State.INITIALIZED) { + if (device.getType().equals(DeviceType.PEBBLE)) { + currentDevice = device; + break; + } else { + LOG.error("attempting to load pebble configuration but a different device type is connected!!!"); + finish(); + return; + } + } + } + if (currentDevice == null) { + //then try to reconnect to last connected device + String btDeviceAddress = GBApplication.getPrefs().getPreferences().getString("last_device_address", null); + if (btDeviceAddress != null) { + GBDevice candidate = DeviceHelper.getInstance().findAvailableDevice(btDeviceAddress, this); + if(!candidate.isConnected() && candidate.getType() == DeviceType.PEBBLE){ + Intent intent = new Intent(this, DeviceCommunicationService.class) + .setAction(ACTION_CONNECT) + .putExtra(GBDevice.EXTRA_DEVICE, currentDevice); + this.startService(intent); + currentDevice = candidate; + } + } + } - GBDevice currentDevice = extras.getParcelable(GBDevice.EXTRA_DEVICE); - UUID currentUUID = (UUID) extras.getSerializable(DeviceService.EXTRA_APP_UUID); + showConfig = true; //we are getting incoming configuration data + } + } else { + currentDevice = extras.getParcelable(GBDevice.EXTRA_DEVICE); + currentUUID = (UUID) extras.getSerializable(DeviceService.EXTRA_APP_UUID); + + if (extras.getBoolean(START_BG_WEBVIEW, false)) { + startBackgroundWebViewAndFinish(); + return; + } + showConfig = extras.getBoolean(SHOW_CONFIG, false); + } if (GBApplication.getGBPrefs().isBackgroundJsEnabled()) { - if (extras.getBoolean(SHOW_CONFIG, false)) { + if (showConfig) { Objects.requireNonNull(currentDevice, "Must provide a device when invoking this activity"); Objects.requireNonNull(currentUUID, "Must provide a uuid when invoking this activity"); - - WebViewSingleton.runJavascriptInterface(currentDevice, currentUUID); + WebViewSingleton.runJavascriptInterface(this, currentDevice, currentUUID); } // FIXME: is this really supposed to be outside the check for SHOW_CONFIG? @@ -161,6 +213,7 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity { } catch (IllegalArgumentException e) { GB.toast("returned uri: " + confUri.toString(), Toast.LENGTH_LONG, GB.ERROR); } + myWebView.stopLoading(); myWebView.loadUrl("file:///android_asset/app_config/configure.html?" + queryString); } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java index 75c01f220..261cddddb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java @@ -156,6 +156,13 @@ public class WebViewSingleton { } } + public static void runJavascriptInterface(@NonNull Activity context, @NonNull GBDevice device, @NonNull UUID uuid) { + if (webViewSingleton.instance == null || webViewSingleton.contextWrapper == null) { + ensureCreated(context); + } + runJavascriptInterface(device, uuid); + } + public static void runJavascriptInterface(@NonNull GBDevice device, @NonNull UUID uuid) { if (uuid.equals(currentRunningUUID)) { LOG.debug("WEBVIEW uuid not changed keeping the old context"); From 8bae9573cfe00c9135acc22f63792638f433468d Mon Sep 17 00:00:00 2001 From: youzhiran <2668760098@qq.com> Date: Thu, 15 Mar 2018 04:46:36 +0000 Subject: [PATCH 13/31] Translated using Weblate (Chinese (Simplified)) Currently translated at 97.4% (450 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/zh_Hans/ --- app/src/main/res/values-zh-rCN/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index fb500d5bd..5ae026d22 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -532,7 +532,7 @@ 数据库导出失败! 请检查您的设置。 预警未来事件 在指定按键次数后发送消息 - "设备版本: " + "心率: " AM/PM Vibratissimo From 32769c6dc0cee2aaa839883233d2c503e56bf5ae Mon Sep 17 00:00:00 2001 From: Robert Barat Date: Wed, 14 Mar 2018 20:24:30 +0000 Subject: [PATCH 14/31] Translated using Weblate (Czech) Currently translated at 100.0% (462 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/cs/ --- app/src/main/res/values-cs/strings.xml | 48 ++++++++++++++------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 54d38e89b..35d79c1e3 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -43,11 +43,13 @@ Instalátor FW/App - Instaluje firmware %s do Mi Band místo stávajícího. - Instaluje firmwary %1$s a %2$s do Mi Band místo stávajícího. - Tento firmware byl testován a je kompatibilní s Gadgetbridge. - Tento firmware nebyl testován a nemusí být kompatibilní s Gadgetbridge.\n\nNedoporučujeme jej nahrávat do Mi Band! - Pokud budete prokračovat a vše bude fungovat běžně i potom, upozorněte vývojáře Gadgetbridge, aby označili tento firmware: %s jako vyzkoušený + Instaluje firmvér %s do Mi Band místo stávajícího. + Instaluje firmvér %1$s a %2$s do Mi Band místo stávajícího. + Tento firmvér byl testován a je kompatibilní s Gadgetbridge. + Tento firmvér nebyl testován a nemusí být kompatibilní s Gadgetbridge. +\n +\nNedoporučujeme jej nahrávat do Mi Band! + Pokud budete prokračovat a vše bude fungovat běžně i potom, upozorněte vývojáře Gadgetbridge, aby označili tento firmvér: %s jako vyzkoušený Nastavení Základní nastavení @@ -72,8 +74,8 @@ SMS Zprávy Pebble Podpora pro aplikace, které posílají notifikace do Pebble přes PebbleKit. - Obecná podpora notifikací - ...také pokud je displej zapnutý + Přístup k notifikacím + Upozornění i při zapnuté obrazovce Nerušit Neposílat nechtěné notifikace v režimu Nerušit Přepsání diakritiky @@ -86,7 +88,7 @@ Zobrazit jméno a číslo Skrýt jméno, ale zobrazit číslo Skrýt jméno i číslo - Zakázané aplikace + Zakázané aplikace (bez notifikací) Potlačené zprávy Odpovědi Běžná přípona @@ -121,7 +123,7 @@ Povolte zjištění polohy v síti poloha zjištěna Vnutit protokol notifikací - Tato volba vnutí použití posledního protokolu notifikací podle verze firmware. POVOLTE, JEN POKUD VÍTE, CO DĚLÁTE! + Tato volba vnutí použití posledního protokolu notifikací podle verze firmvéru. POVOLTE, JEN POKUD VÍTE, CO DĚLÁTE! Povolit netestované funkce Povolí funkce, které nebyl testovány. POVOLTE, JEN POKUD VÍTE, CO DĚLÁTE! Vždy preferovat BLE @@ -159,10 +161,10 @@ Instaluji binární %1$d/%2$d Instalace selhala Instalace úspěšná - CHCETE INSTALOVAT FIRMWARE, POKRAČUJTE NA SVÉ RIZIKO. + CHCETE INSTALOVAT FIRMVÉR, POKRAČUJTE NA SVÉ RIZIKO. \n \n -\nTento firmware je pro revizi HW: %s +\nTento firmvér je pro revizi HW: %s Instalujete aplikaci:\n\n\n%1$s Verze %2$s od %3$s\n Nedostupné Spuštěno @@ -244,7 +246,7 @@ Nelze se připojit k: %1$s Nemohu najít program k instalaci tohoto souboru. Nelze nainstalovat vybraný soubor: %1$s - Nelze nainstalovat vybraný firmware: neshoduje s HW revizí vašeho Pebble. + Nelze nainstalovat vybraný firmvér: neshoduje se s HW revizi vašeho Pebble. Vyčkejte na zjištění stavu instalace… Nízká úroveň nabití baterie v zařízení! %1$s zbývá v baterii: %2$s%% @@ -255,7 +257,7 @@ Spánek dnes, cíl: %1$s Kroky za týden Vaše aktivita a spánek - Nahrávám firmware… + Nahrávám firmvér… Soubor nelze nainstalovat, zařízení není připraveno. %1$s: %2$s %3$s Kompatibilní verze @@ -266,9 +268,9 @@ Revize HW není správná! %1$s (%2$s) Při přenosu firmwaru nastaly potíže. Nerestartujte svůj Mi Band! - Problém při přenosu matadat firmware - Instalace firmware je kompletní - Instalace firmware je kompletní, restartuji zařízení… + Problém při přenosu matadat firmvéru + Instalace firmvéru je kompletní + Instalace firmvéru je kompletní, restartuji zařízení… Zápis firmvéru selhal Kroků Současná aktivita @@ -290,8 +292,8 @@ Nepřipojeno. Všechny budíky vypnuty Zachovat data o aktivitě v zařízení - Nekompatibilní firmware - Tento firmware není kompatibilní s tímto zařízením + Nekompatibilní firmvér + Tento firmvér není kompatibilní s tímto zařízením Budíky pro nadcházející události Použít sledování tepu pro zlepšení detekce spánku Časový posun zařízení v hodinách (pro zjišťování spánku směnařů) @@ -301,7 +303,7 @@ Zapnout displej při zvednutí Přenáším data od %1$s Čekání na znovupřipojení - O vás + Vaše údaje Rok narození Pohlaví Výška v cm @@ -316,8 +318,8 @@ Verze FW: %1$s Chyba při vytváření adresáře pro logy: %1$s "Tep: " - Aktualizace firmware - Firmware neodeslán + Aktualizace firmvéru + Firmvér nebyl odeslán Srdeční tep Srdeční tep Uložit hrubý záznam do databáze @@ -424,7 +426,7 @@ Maximální zpoždění mezi stisknutím tlačítka v milisekundách Zpoždění po provedení akce tlačítka Zpoždění po provedení akce tlačítka (číslo je v button_id) nebo 0 pro okamžitě -Chystáte se nainstalovat firmware %s na vašem Amazfit Bip. +Chystáte se nainstalovat firmvér %s na vašem Amazfit Bip. \n \nProsím nezapomeňte nainstalovat soubor .fw, potom soubor .res a nakonec soubor .gps. Vaše hodinky se po instalaci souboru .fw restartují. \n @@ -433,7 +435,7 @@ \nDĚLÁTE TO NA VLASTNÍ NEBEZPEČÍ! "Firmware Amazfit Bipu %1$s" Připojit - Chystáte se nainstalovat firmware %s do vašeho Amazfit Cor. + Chystáte se nainstalovat firmvér %s do vašeho Amazfit Cor. \n \nProsím, ujistěte se, že jste nainstalovali soubor .fw a potom soubor .res. Vaše hodinky se po instalaci souboru .fw restartují. \n From caca45b864496267e3cbecaac73c03bd643be52c Mon Sep 17 00:00:00 2001 From: TaaviE Date: Wed, 14 Mar 2018 16:15:22 +0000 Subject: [PATCH 15/31] Translated using Weblate (Estonian) Currently translated at 20.7% (96 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/et/ --- app/src/main/res/values-et/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index a72c1117f..f60f83a24 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -126,4 +126,7 @@ Talletatud sõnumid Vastused Ühine järelliide + Arendajate seaded + Mi Band\'i aadress + From 368a54d9245f432a51ae894144ccd927d575c400 Mon Sep 17 00:00:00 2001 From: anonymous <> Date: Wed, 14 Mar 2018 16:41:04 +0000 Subject: [PATCH 16/31] Translated using Weblate (Russian) Currently translated at 90.6% (419 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/ru/ --- app/src/main/res/values-ru/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 207dc85fd..6cfbd985e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -28,7 +28,7 @@ Удалить Удалить и очистить кеш Переустановка - Искать в Pebble appstore + Искать в магазине Pebble Активировать Деактивировать Включить монитор сердечного ритма From df573f67aae2ec226fead711ea2c5628dd345c44 Mon Sep 17 00:00:00 2001 From: Robert Barat Date: Wed, 14 Mar 2018 20:22:59 +0000 Subject: [PATCH 17/31] Translated using Weblate (Slovak) Currently translated at 100.0% (462 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/sk/ --- app/src/main/res/values-sk/strings.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 6fccb2496..de1fbd5ff 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -61,17 +61,17 @@ \nPoznámka: Nemusíte inštalovať súbor .res, ak je rovnaký ako nainštalovaný predtým. \n \nNETESTOVANÉ, MÔŽE UMŔTVIŤ VAŠE ZARIADENIE, ROBÍTE TO NA VLASTNÉ RIZIKO! - Nainštaluje firmware %1$s a %2$s do Mi Band miesto existujúceho. + Nainštaluje firmvér %1$s a %2$s do Mi Band miesto existujúceho. Tento firmware bol testovaný a je kompatibilný s Gadgetbridge. Tento firmware nebol testovaný a nemusí byť kompatibilný s Gadgetbridge. \n \nNedoporučujeme ho nahrávať do Mi Band! - Ak budete prokračovať a všetko bude dobre fungovať aj potom, upozornite vývojárov Gadgetbridge, aby označili tento firmvér: %s ako vyskúšaný + Ak budete pokračovať a všetko bude dobre fungovať aj potom, upozornite vývojárov Gadgetbridge, aby označili tento firmvér: %s ako vyskúšaný Nastavenia Základné nastavenia - Pripojiť zariadenie ak je zapnutý BT + Pripojiť zariadenie ak je BT zapnutý Spúšťať automaticky Automatické opätovné pripojenie Preferovaný prehrávač zvukov @@ -82,7 +82,7 @@ Nastaviť čas Nastaviť čas počas pripojenia a pri zmene času v Androide - Téma + Téma aplikácie Svetlá Tmavá @@ -98,8 +98,8 @@ SMS Správy Pebble Podpora pre aplikácie, ktoré posielajú upozornenia do Pebble cez PebbleKit. - Všeobecná podpora upozornení - ...aj keď je displej zapnutý + Prístup k upozorneniam + Upozornenia aj pri zapnutej obrazovke Nerušiť Neposielať nechcené upozornenia v režime Nerušiť Náhrada diakritiky @@ -110,7 +110,7 @@ Nikdy Súkromie - Režim súkromého hovoru + Ochrana súkromia pri hovore Zobraziť meno a číslo Skryť meno, ale zobraziť číslo Skryť číslo, ale zobraziť meno @@ -119,7 +119,7 @@ Počasie Poloha pre počasie (CM/LOS) - Zakázané aplikácie + Zakázané aplikácie (bez upozornení) Zakázané kalendáre Potlačené správy @@ -186,7 +186,7 @@ Pokusov o znovupripojenie - Jednotky + Merné jednotky Formát času Čas zapnutia obrazovky Celodenné meranie tepu @@ -336,7 +336,7 @@ Spánok dnes, cieľ: %1$s Kroky za týždeň Vaša aktivita a spánok - Nahrávám firmvér… + Nahrávam firmvér… Súbor sa nedá nainštalovať, zariadenie nie je pripravené. %1$s: %2$s %3$s Kompatibilná verzia @@ -424,7 +424,7 @@ Čakanie na opätovné pripojenie - O vás + Vaše údaje Rok narodenia Pohlavie Výška v cm @@ -442,7 +442,7 @@ Chyba pri vytváraní adresára pre logy: %1$s "Tep: " Prebieha aktualizácia firmvéru - Firmvér neodoslaný + Firmvér nebol odoslaný Tep srdca Tep srdca @@ -505,7 +505,7 @@ Formát času Mi2 Pred inštaláciou tohto firmvéru musíte nainštalovať verziu %1$s! Textové upozornenia - Vyžaduje firmvér >= 1.0.1.28 and Mili_pro.ft* installed. + Vyžaduje nainštalovaný súbor fontu >= 1.0.1.28 and Mili_pro.ft*. Vyp. Vyp. Automaticky (detekcia spánku) From f39b11974dc301793ee34d5e1f6d05a7f888bbbb Mon Sep 17 00:00:00 2001 From: TaaviE Date: Fri, 16 Mar 2018 23:35:22 +0000 Subject: [PATCH 18/31] Translated using Weblate (Estonian) Currently translated at 22.0% (102 of 462 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/et/ --- app/src/main/res/values-et/strings.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index f60f83a24..f2deae893 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -33,11 +33,11 @@ Taasinstalli Otsi Pebble\'i poest Aktiveeri - Deaktiveeri + Inaktiveeri Aktiveeri HRM Inaktiveeri HRM Aktiveeri süsteemi ilmarakendus - Deaktiveeri süsteemi ilmarakendus + Inaktiveeri süsteemi ilmarakendus Paigalda ilmateavituste rakendus Seadista Liiguta kõige üles @@ -129,4 +129,12 @@ Arendajate seaded Mi Band\'i aadress + Uuenda Pebble\'l + + Pebble\'i seaded + + Aktiivsusmonitorid + Eelistatud aktiivsusmonitor + Sünkrooni Pebble\'i terviseandmeid + Sünkrooni Misfit\'i From d2c952ffa5e3858e70f6722c87352299a63d47e3 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sun, 18 Mar 2018 00:39:36 +0100 Subject: [PATCH 19/31] Improvements to the singleton pattern, better encapsulate fields --- .../activities/ExternalPebbleJSActivity.java | 4 +- .../devices/pebble/PebbleIoThread.java | 10 +- .../devices/pebble/webview/GBWebClient.java | 17 +-- .../gadgetbridge/util/WebViewSingleton.java | 100 ++++++++++-------- 4 files changed, 65 insertions(+), 66 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java index fe3914d1a..e26e54c36 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java @@ -133,7 +133,7 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity { if (showConfig) { Objects.requireNonNull(currentDevice, "Must provide a device when invoking this activity"); Objects.requireNonNull(currentUUID, "Must provide a uuid when invoking this activity"); - WebViewSingleton.runJavascriptInterface(this, currentDevice, currentUUID); + WebViewSingleton.getInstance().runJavascriptInterface(this, currentDevice, currentUUID); } // FIXME: is this really supposed to be outside the check for SHOW_CONFIG? @@ -156,7 +156,7 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity { private void setupBGWebView() { setContentView(R.layout.activity_external_pebble_js); - myWebView = WebViewSingleton.getWebView(this); + myWebView = WebViewSingleton.getInstance().getWebView(this); if (myWebView.getParent() != null) { ((ViewGroup) myWebView.getParent()).removeView(myWebView); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index d7afa5043..89fb011e8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -110,7 +110,7 @@ class PebbleIoThread extends GBDeviceIoThread { public static void sendAppMessage(GBDeviceEventAppMessage message) { final String jsEvent; try { - WebViewSingleton.checkAppRunning(message.appUUID); + WebViewSingleton.getInstance().checkAppRunning(message.appUUID); } catch (IllegalStateException ex) { LOG.warn("Unable to send app message: " + message, ex); return; @@ -126,7 +126,7 @@ class PebbleIoThread extends GBDeviceIoThread { final String appMessage = PebbleUtils.parseIncomingAppMessage(message.message, message.appUUID, message.id); LOG.debug("to WEBVIEW: event: " + jsEvent + " message: " + appMessage); - WebViewSingleton.invokeWebview(new WebViewSingleton.WebViewRunnable() { + WebViewSingleton.getInstance().invokeWebview(new WebViewSingleton.WebViewRunnable() { @Override public void invoke(WebView webView) { webView.evaluateJavascript("if (typeof Pebble == 'object') Pebble.evaluate('" + jsEvent + "',[" + appMessage + "]);", new ValueCallback() { @@ -424,7 +424,7 @@ class PebbleIoThread extends GBDeviceIoThread { } if (GBApplication.getGBPrefs().isBackgroundJsEnabled()) { - WebViewSingleton.disposeWebView(); + WebViewSingleton.getInstance().disposeWebView(); } gbDevice.sendDeviceUpdateIntent(getContext()); @@ -553,9 +553,9 @@ class PebbleIoThread extends GBDeviceIoThread { LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid); if (GBApplication.getGBPrefs().isBackgroundJsEnabled()) { if (mPebbleProtocol.hasAppMessageHandler(appMgmt.uuid)) { - WebViewSingleton.stopJavascriptInterface(); + WebViewSingleton.getInstance().stopJavascriptInterface(); } else { - WebViewSingleton.runJavascriptInterface(gbDevice, appMgmt.uuid); + WebViewSingleton.getInstance().runJavascriptInterface(gbDevice, appMgmt.uuid); } } break; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/webview/GBWebClient.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/webview/GBWebClient.java index a41dee6a7..e8e49b4d6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/webview/GBWebClient.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/webview/GBWebClient.java @@ -41,16 +41,10 @@ import java.io.ByteArrayInputStream; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.CountDownLatch; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.model.Weather; - -import static nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton.internetHelper; -import static nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton.internetHelperBound; -import static nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton.internetHelperListener; -import static nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton.internetResponse; -import static nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton.latch; +import nodomain.freeyourgadget.gadgetbridge.util.WebViewSingleton; public class GBWebClient extends WebViewClient { @@ -85,19 +79,14 @@ public class GBWebClient extends WebViewClient { private WebResourceResponse mimicReply(Uri requestedUri) { if (requestedUri.getHost() != null && (StringUtils.indexOfAny(requestedUri.getHost(), AllowedDomains) != -1)) { - if (GBApplication.getGBPrefs().isBackgroundJsEnabled() && internetHelperBound) { + if (GBApplication.getGBPrefs().isBackgroundJsEnabled() && WebViewSingleton.getInstance().internetHelperBound) { LOG.debug("WEBVIEW forwarding request to the internet helper"); Bundle bundle = new Bundle(); bundle.putString("URL", requestedUri.toString()); Message webRequest = Message.obtain(); - webRequest.replyTo = internetHelperListener; webRequest.setData(bundle); try { - latch = new CountDownLatch(1); //the messenger should run on a single thread, hence we don't need to be worried about concurrency. This approach however is certainly not ideal. - internetHelper.send(webRequest); - latch.await(); - return internetResponse; - + return WebViewSingleton.getInstance().send(webRequest); } catch (RemoteException | InterruptedException e) { LOG.warn("Error downloading data from " + requestedUri, e); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java index 261cddddb..a661614cd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/WebViewSingleton.java @@ -31,6 +31,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.Messenger; +import android.os.RemoteException; import android.support.annotation.NonNull; import android.webkit.WebResourceResponse; import android.webkit.WebSettings; @@ -54,33 +55,33 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.JSInt public class WebViewSingleton { private static final Logger LOG = LoggerFactory.getLogger(WebViewSingleton.class); + private static WebViewSingleton instance = new WebViewSingleton(); - private WebView instance = null; + private WebView webView = null; private MutableContextWrapper contextWrapper; private Looper mainLooper; - private static WebViewSingleton webViewSingleton = new WebViewSingleton(); - private static UUID currentRunningUUID; - public static Messenger internetHelper = null; - public static boolean internetHelperBound; - public static CountDownLatch latch; - public static WebResourceResponse internetResponse; - public static Messenger internetHelperListener; - private static boolean internetHelperInstalled; + private UUID currentRunningUUID; + private Messenger internetHelper = null; + public boolean internetHelperBound; + private boolean internetHelperInstalled; + private CountDownLatch latch; + private WebResourceResponse internetResponse; + private Messenger internetHelperListener; private WebViewSingleton() { } public static synchronized void ensureCreated(Activity context) { - if (webViewSingleton.instance == null) { - webViewSingleton.contextWrapper = new MutableContextWrapper(context); - webViewSingleton.mainLooper = webViewSingleton.contextWrapper.getMainLooper(); - webViewSingleton.instance = new WebView(webViewSingleton.contextWrapper); + if (instance.webView == null) { + instance.contextWrapper = new MutableContextWrapper(context); + instance.mainLooper = context.getMainLooper(); + instance.webView = new WebView(instance.contextWrapper); WebView.setWebContentsDebuggingEnabled(true); - webViewSingleton.instance.setWillNotDraw(true); - webViewSingleton.instance.clearCache(true); - webViewSingleton.instance.setWebViewClient(new GBWebClient()); - webViewSingleton.instance.setWebChromeClient(new GBChromeClient()); - WebSettings webSettings = webViewSingleton.instance.getSettings(); + instance.webView.setWillNotDraw(true); + instance.webView.clearCache(true); + instance.webView.setWebViewClient(new GBWebClient()); + instance.webView.setWebChromeClient(new GBChromeClient()); + WebSettings webSettings = instance.webView.getSettings(); webSettings.setJavaScriptEnabled(true); //needed to access the DOM webSettings.setDomStorageEnabled(true); @@ -90,7 +91,7 @@ public class WebViewSingleton { } //Internet helper outgoing connection - private static ServiceConnection internetHelperConnection = new ServiceConnection() { + private ServiceConnection internetHelperConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { LOG.info("internet helper service bound"); internetHelperBound = true; @@ -104,8 +105,20 @@ public class WebViewSingleton { } }; + public static WebViewSingleton getInstance() { + return instance; + } + + public WebResourceResponse send(Message webRequest) throws RemoteException, InterruptedException { + webRequest.replyTo = internetHelperListener; + latch = new CountDownLatch(1); //the messenger should run on a single thread, hence we don't need to be worried about concurrency. This approach however is certainly not ideal. + internetHelper.send(webRequest); + latch.await(); + return internetResponse; + } + //Internet helper inbound (responses) handler - private static class IncomingHandler extends Handler { + private class IncomingHandler extends Handler { private String getCharsetFromHeaders(String contentType) { if (contentType != null && contentType.toLowerCase().trim().contains("charset=")) { @@ -137,9 +150,9 @@ public class WebViewSingleton { } @NonNull - public static WebView getWebView(Context context) { - webViewSingleton.contextWrapper.setBaseContext(context); - return webViewSingleton.instance; + public WebView getWebView(Context context) { + contextWrapper.setBaseContext(context); + return webView; } /** @@ -147,23 +160,21 @@ public class WebViewSingleton { * @param uuid the uuid of the application expected to be running * @throws IllegalStateException when the webview is not active or the app is not running */ - public static void checkAppRunning(@NonNull UUID uuid) { - if (webViewSingleton.instance == null) { - throw new IllegalStateException("webViewSingleton.instance is null!"); + public void checkAppRunning(@NonNull UUID uuid) { + if (webView == null) { + throw new IllegalStateException("instance.webView is null!"); } if (!uuid.equals(currentRunningUUID)) { throw new IllegalStateException("Expected app " + uuid + " is not running, but " + currentRunningUUID + " is."); } } - public static void runJavascriptInterface(@NonNull Activity context, @NonNull GBDevice device, @NonNull UUID uuid) { - if (webViewSingleton.instance == null || webViewSingleton.contextWrapper == null) { - ensureCreated(context); - } + public void runJavascriptInterface(@NonNull Activity context, @NonNull GBDevice device, @NonNull UUID uuid) { + ensureCreated(context); runJavascriptInterface(device, uuid); } - public static void runJavascriptInterface(@NonNull GBDevice device, @NonNull UUID uuid) { + public void runJavascriptInterface(@NonNull GBDevice device, @NonNull UUID uuid) { if (uuid.equals(currentRunningUUID)) { LOG.debug("WEBVIEW uuid not changed keeping the old context"); } else { @@ -183,10 +194,10 @@ public class WebViewSingleton { String internetHelperPkg = "nodomain.freeyourgadget.internethelper"; String internetHelperCls = internetHelperPkg + ".MyService"; try { - webViewSingleton.contextWrapper.getPackageManager().getApplicationInfo(internetHelperPkg, 0); + contextWrapper.getPackageManager().getApplicationInfo(internetHelperPkg, 0); Intent intent = new Intent(); intent.setComponent(new ComponentName(internetHelperPkg, internetHelperCls)); - webViewSingleton.contextWrapper.getApplicationContext().bindService(intent, internetHelperConnection, Context.BIND_AUTO_CREATE); + contextWrapper.getApplicationContext().bindService(intent, internetHelperConnection, Context.BIND_AUTO_CREATE); internetHelperListener = new Messenger(new IncomingHandler()); internetHelperInstalled = true; } @@ -196,10 +207,9 @@ public class WebViewSingleton { } } } - } - public static void stopJavascriptInterface() { + public void stopJavascriptInterface() { invokeWebview(new WebViewRunnable() { @Override public void invoke(WebView webView) { @@ -209,10 +219,10 @@ public class WebViewSingleton { }); } - public static void disposeWebView() { + public void disposeWebView() { if (internetHelperBound) { LOG.debug("WEBVIEW: will unbind the internet helper"); - webViewSingleton.contextWrapper.getApplicationContext().unbindService(internetHelperConnection); + contextWrapper.getApplicationContext().unbindService(internetHelperConnection); internetHelperBound = false; } currentRunningUUID = null; @@ -227,34 +237,34 @@ public class WebViewSingleton { webView.loadUrl("about:blank"); // webView.freeMemory(); webView.pauseTimers(); -// instance.destroy(); -// instance = null; +// webView.destroy(); +// webView = null; // contextWrapper = null; // jsInterface = null; } }); } - public static void invokeWebview(final WebViewRunnable runnable) { - if (webViewSingleton.instance == null || webViewSingleton.mainLooper == null) { + public void invokeWebview(final WebViewRunnable runnable) { + if (webView == null || mainLooper == null) { LOG.warn("Webview already disposed, ignoring runnable"); return; } - new Handler(webViewSingleton.mainLooper).post(new Runnable() { + new Handler(mainLooper).post(new Runnable() { @Override public void run() { - if (webViewSingleton.instance == null) { + if (webView == null) { LOG.warn("Webview already disposed, cannot invoke runnable"); return; } - runnable.invoke(webViewSingleton.instance); + runnable.invoke(webView); } }); } public interface WebViewRunnable { /** - * Called in the main thread with a non-null webView instance + * Called in the main thread with a non-null webView webView * @param webView the webview, never null */ void invoke(WebView webView); From f8f248ec4ea9fbe0f3f3578ae43fd26f67296c99 Mon Sep 17 00:00:00 2001 From: Taavi Date: Tue, 20 Mar 2018 19:44:23 +0200 Subject: [PATCH 20/31] Update build.gradle First step towards migrating to Gradle 3.0, changed all `compile`'s to `implementation`. Tests show only marginally faster compilation and no ill effects. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html Changed all `'` to `"` for consistency. Also made a few whitespace changes and removed an unnecessary `;` --- app/build.gradle | 125 +++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 117282921..fcfb72621 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,13 @@ +apply plugin: "com.android.application" +apply plugin: "findbugs" +apply plugin: "pmd" -apply plugin: 'com.android.application' -apply plugin: 'findbugs' -apply plugin: 'pmd' - -def ABORT_ON_CHECK_FAILURE=false +def ABORT_ON_CHECK_FAILURE = false tasks.withType(Test) { - systemProperty 'MiFirmwareDir', System.getProperty('MiFirmwareDir', null) - systemProperty 'logback.configurationFile', System.getProperty('user.dir', null) + '/app/src/main/assets/logback.xml' - systemProperty 'GB_LOGFILES_DIR', java.nio.file.Files.createTempDirectory('gblog').toString(); + systemProperty "MiFirmwareDir", System.getProperty("MiFirmwareDir", null) + systemProperty "logback.configurationFile", System.getProperty("user.dir", null) + "/app/src/main/assets/logback.xml" + systemProperty "GB_LOGFILES_DIR", java.nio.file.Files.createTempDirectory("gblog").toString() } android { @@ -18,14 +17,14 @@ android { targetCompatibility JavaVersion.VERSION_1_7 } compileSdkVersion 27 - buildToolsVersion '27.0.3' + buildToolsVersion "27.0.3" defaultConfig { applicationId "nodomain.freeyourgadget.gadgetbridge" minSdkVersion 19 targetSdkVersion 27 - // note: always bump BOTH versionCode and versionName! + // Note: always bump BOTH versionCode and versionName! versionName "0.25.0" versionCode 124 vectorDrawables.useSupportLibrary = true @@ -33,17 +32,16 @@ android { buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } lintOptions { abortOnError ABORT_ON_CHECK_FAILURE lintConfig file("${project.rootDir}/config/lint/lint.xml") - -// if true, generate an HTML report (with issue explanations, sourcecode, etc) +// If true, generate an HTML report (with issue explanations, sourcecode, etc) htmlReport true -// optional path to report (default will be lint-results.html in the builddir) +// Optional path to report (default will be lint-results.html in the builddir) htmlOutput file("$project.buildDir/reports/lint/lint.html") } @@ -53,76 +51,77 @@ android { } pmd { - toolVersion = '5.5.5' + toolVersion = "5.5.5" } dependencies { -// testCompile 'ch.qos.logback:logback-classic:1.1.3' -// testCompile 'ch.qos.logback:logback-core:1.1.3' - testCompile 'junit:junit:4.12' - testCompile "org.mockito:mockito-core:1.10.19" - testCompile "org.robolectric:robolectric:3.5.1" +// testImplementation "ch.qos.logback:logback-classic:1.1.3" +// testImplementation "ch.qos.logback:logback-core:1.1.3" + testImplementation "junit:junit:4.12" + testImplementation "org.mockito:mockito-core:1.10.19" + testImplementation "org.robolectric:robolectric:3.5.1" - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:27.0.2' - compile 'com.android.support:cardview-v7:27.0.2' - compile 'com.android.support:recyclerview-v7:27.0.2' - compile 'com.android.support:support-v4:27.0.2' - compile 'com.android.support:gridlayout-v7:27.0.2' - compile 'com.android.support:design:27.0.2' - compile 'com.android.support:palette-v7:27.0.2' - compile('com.github.tony19:logback-android-classic:1.1.1-6') { - exclude group: 'com.google.android', module: 'android' + implementation fileTree(dir: "libs", include: ["*.jar"]) + implementation "com.android.support:appcompat-v7:27.0.2" + implementation "com.android.support:cardview-v7:27.0.2" + implementation "com.android.support:recyclerview-v7:27.0.2" + implementation "com.android.support:support-v4:27.0.2" + implementation "com.android.support:gridlayout-v7:27.0.2" + implementation "com.android.support:design:27.0.2" + implementation "com.android.support:palette-v7:27.0.2" + implementation("com.github.tony19:logback-android-classic:1.1.1-6") { + exclude group: "com.google.android", module: "android" } - compile 'org.slf4j:slf4j-api:1.7.12' - compile 'com.github.Freeyourgadget:MPAndroidChart:5e5bd6c1d3e95c515d4853647ae554e48ee1d593' - compile 'com.github.pfichtner:durationformatter:0.1.1' - compile 'de.cketti.library.changelog:ckchangelog:1.2.2' - compile 'net.e175.klaus:solarpositioning:0.0.9' + implementation "org.slf4j:slf4j-api:1.7.12" + implementation "com.github.Freeyourgadget:MPAndroidChart:5e5bd6c1d3e95c515d4853647ae554e48ee1d593" + implementation "com.github.pfichtner:durationformatter:0.1.1" + implementation "de.cketti.library.changelog:ckchangelog:1.2.2" + implementation "net.e175.klaus:solarpositioning:0.0.9" // use pristine greendao instead of our custom version, since our custom jitpack-packaged // version contains way too much and our custom patches are in the generator only. - compile 'org.greenrobot:greendao:2.2.1' - compile 'org.apache.commons:commons-lang3:3.5' - compile 'org.cyanogenmod:platform.sdk:6.0' + implementation "org.greenrobot:greendao:2.2.1" + implementation "org.apache.commons:commons-lang3:3.5" + implementation "org.cyanogenmod:platform.sdk:6.0" -// compile project(":DaoCore") +// implementation project(":DaoCore") } preBuild.dependsOn(":GBDaoGenerator:genSources") + gradle.beforeProject { preBuild.dependsOn(":GBDaoGenerator:genSources") } -check.dependsOn 'findbugs', 'pmd', 'lint' +check.dependsOn "findbugs", "pmd", "lint" task pmd(type: Pmd) { ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml") ignoreFailures = !ABORT_ON_CHECK_FAILURE ruleSets = [ - 'java-android', - 'java-basic', - 'java-braces', - 'java-clone', - 'java-codesize', - 'java-controversial', - 'java-coupling', - 'java-design', - 'java-empty', - 'java-finalizers', - 'java-imports', - 'java-junit', - 'java-optimizations', - 'java-strictexception', - 'java-strings', - 'java-sunsecure', - 'java-typeresolution', - 'java-unnecessary', - 'java-unusedcode' + "java-android", + "java-basic", + "java-braces", + "java-clone", + "java-codesize", + "java-controversial", + "java-coupling", + "java-design", + "java-empty", + "java-finalizers", + "java-imports", + "java-junit", + "java-optimizations", + "java-strictexception", + "java-strings", + "java-sunsecure", + "java-typeresolution", + "java-unnecessary", + "java-unusedcode" ] - source 'src' - include '**/*.java' - exclude '**/gen/**' + source "src" + include "**/*.java" + exclude "**/gen/**" reports { xml.enabled = false @@ -142,7 +141,7 @@ task findbugs(type: FindBugs) { reportLevel = "medium" excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml") classes = files("${project.rootDir}/app/build/intermediates/classes") - source = fileTree('src/main/java/') + source = fileTree("src/main/java/") classpath = files() reports { xml.enabled = false From 551bf92908c4f9d2ff4abe681695cf2a3e92c275 Mon Sep 17 00:00:00 2001 From: Taavi Date: Tue, 20 Mar 2018 22:00:28 +0200 Subject: [PATCH 21/31] Update build.gradle (#3) Changed `'` to `"` in the root build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7c5917d4e..1318787a7 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath "com.android.tools.build:gradle:3.0.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From cf0a799d7c321f57628820c98b1d7615e4f51703 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Thu, 22 Mar 2018 22:01:59 +0200 Subject: [PATCH 22/31] Re-enabled AAPT2. --- app/build.gradle | 7 +++++-- gradle.properties | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fcfb72621..beffac80b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,10 @@ android { } testOptions { - unitTests.returnDefaultValues = true + unitTests { + returnDefaultValues = true + includeAndroidResources = true + } } } @@ -59,7 +62,7 @@ dependencies { // testImplementation "ch.qos.logback:logback-core:1.1.3" testImplementation "junit:junit:4.12" testImplementation "org.mockito:mockito-core:1.10.19" - testImplementation "org.robolectric:robolectric:3.5.1" + testImplementation "org.robolectric:robolectric:3.6.1" implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:27.0.2" diff --git a/gradle.properties b/gradle.properties index 0b19e8f87..e68841626 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,4 +17,4 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -android.enableAapt2=false +android.enableAapt2=true From 6be7ee4a96c1452bb153bbc70d80d68579237c03 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Thu, 22 Mar 2018 23:47:40 +0200 Subject: [PATCH 23/31] Fixed a few misspells and extended my name. --- .../freeyourgadget/gadgetbridge/LockHandler.java | 2 +- .../externalevents/NotificationListener.java | 2 +- .../gadgetbridge/impl/GBDevice.java | 4 ++-- .../service/AbstractDeviceSupport.java | 16 ++++++++-------- .../freeyourgadget/gadgetbridge/util/GB.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/LockHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/LockHandler.java index a308ca968..488d67486 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/LockHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/LockHandler.java @@ -24,7 +24,7 @@ import nodomain.freeyourgadget.gadgetbridge.entities.DaoMaster; import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; /** - * Provides lowlevel access to the database. + * Provides low-level access to the database. */ public class LockHandler implements DBHandler { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index 4112c9151..06ff5886e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -1,6 +1,6 @@ /* Copyright (C) 2015-2018 Andreas Shimokawa, Carsten Pfeiffer, Daniele Gobbetti, Frank Slezak, Hasan Ammar, Julien Pivotto, Kevin Richter, Normano64, - Steffen Liebergeld, TaaviE, Zhong Jianxin + Steffen Liebergeld, Taavi Eomäe, Zhong Jianxin This file is part of Gadgetbridge. diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java index ad57f0ca2..7f3dbbbfc 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java @@ -326,7 +326,7 @@ public class GBDevice implements Parcelable { public void setRssi(short rssi) { if (rssi < 0) { - LOG.warn("illegal rssi value " + rssi + ", setting to RSSI_UNKNOWN"); + LOG.warn("Illegal RSSI value " + rssi + ", setting to RSSI_UNKNOWN"); mRssi = RSSI_UNKNOWN; } else { mRssi = rssi; @@ -450,7 +450,7 @@ public class GBDevice implements Parcelable { result.add(new GenericItem(DEVINFO_FW_VER, mFirmwareVersion)); } if (mFirmwareVersion2 != null) { - // FIXME: thats ugly + // FIXME: This is ugly if (mDeviceType == DeviceType.AMAZFITBIP) { result.add(new GenericItem(DEVINFO_GPS_VER, mFirmwareVersion2)); } else { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java index 615154d03..6307555bf 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java @@ -227,13 +227,13 @@ public abstract class AbstractDeviceSupport implements DeviceSupport { private void handleGBDeviceEvent(GBDeviceEventSleepMonitorResult sleepMonitorResult) { Context context = getContext(); LOG.info("Got event for SLEEP_MONIOR_RES"); - Intent sleepMontiorIntent = new Intent(ChartsHost.REFRESH); - sleepMontiorIntent.putExtra("smartalarm_from", sleepMonitorResult.smartalarm_from); - sleepMontiorIntent.putExtra("smartalarm_to", sleepMonitorResult.smartalarm_to); - sleepMontiorIntent.putExtra("recording_base_timestamp", sleepMonitorResult.recording_base_timestamp); - sleepMontiorIntent.putExtra("alarm_gone_off", sleepMonitorResult.alarm_gone_off); + Intent sleepMonitorIntent = new Intent(ChartsHost.REFRESH); + sleepMonitorIntent.putExtra("smartalarm_from", sleepMonitorResult.smartalarm_from); + sleepMonitorIntent.putExtra("smartalarm_to", sleepMonitorResult.smartalarm_to); + sleepMonitorIntent.putExtra("recording_base_timestamp", sleepMonitorResult.recording_base_timestamp); + sleepMonitorIntent.putExtra("alarm_gone_off", sleepMonitorResult.alarm_gone_off); - LocalBroadcastManager.getInstance(context).sendBroadcast(sleepMontiorIntent); + LocalBroadcastManager.getInstance(context).sendBroadcast(sleepMonitorIntent); } private void handleGBDeviceEvent(GBDeviceEventScreenshot screenshot) { @@ -300,10 +300,10 @@ public abstract class AbstractDeviceSupport implements DeviceSupport { deviceEvent.phoneNumber = (String) GBApplication.getIDSenderLookup().lookup(deviceEvent.handle); } if (deviceEvent.phoneNumber != null) { - LOG.info("got notfication reply for SMS from " + deviceEvent.phoneNumber + " : " + deviceEvent.reply); + LOG.info("Got notification reply for SMS from " + deviceEvent.phoneNumber + " : " + deviceEvent.reply); SmsManager.getDefault().sendTextMessage(deviceEvent.phoneNumber, null, deviceEvent.reply, null, null); } else { - LOG.info("got notfication reply for notification id " + deviceEvent.handle + " : " + deviceEvent.reply); + LOG.info("Got notification reply for notification id " + deviceEvent.handle + " : " + deviceEvent.reply); action = NotificationListener.ACTION_REPLY; } break; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java index 6a46277b4..2c4c8fd6a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java @@ -1,5 +1,5 @@ /* Copyright (C) 2015-2018 Andreas Shimokawa, Carsten Pfeiffer, Daniele - Gobbetti, Felix Konstantin Maurer, TaaviE, Uwe Hermann, Yar + Gobbetti, Felix Konstantin Maurer, Taavi Eomäe, Uwe Hermann, Yar This file is part of Gadgetbridge. From e26dbc6812d6dfcbfe9c52e5d78db7286088cd2e Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Fri, 23 Mar 2018 23:27:03 +0100 Subject: [PATCH 24/31] Mi Band 2/Bip/Cor: allow to set a period when the display/background light gets enabled when lifting the wrist Closes #1013 --- .../devices/huami/ActivateDisplayOnLift.java | 23 +++++++ .../devices/huami/HuamiCoordinator.java | 26 +++++++- .../devices/miband/MiBand2Service.java | 4 +- .../devices/miband/MiBandConst.java | 4 +- .../miband/MiBandPreferencesActivity.java | 62 ++++++++++++++++++- .../devices/miband2/MiBand2Support.java | 37 ++++++++--- app/src/main/res/values/arrays.xml | 11 ++++ app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/values.xml | 1 + app/src/main/res/xml/miband_preferences.xml | 33 ++++++++-- 10 files changed, 181 insertions(+), 21 deletions(-) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/ActivateDisplayOnLift.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/ActivateDisplayOnLift.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/ActivateDisplayOnLift.java new file mode 100644 index 000000000..3a660e6a4 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/ActivateDisplayOnLift.java @@ -0,0 +1,23 @@ +/* Copyright (C) 2017-2018 José Rebelo + + This file is part of Gadgetbridge. + + Gadgetbridge is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gadgetbridge is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami; + +public enum ActivateDisplayOnLift { + ON, + OFF, + SCHEDULED +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiCoordinator.java index 3a85e229a..51eac0345 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiCoordinator.java @@ -52,7 +52,6 @@ import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.util.Prefs; public abstract class HuamiCoordinator extends AbstractDeviceCoordinator { @@ -133,9 +132,30 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator { return DateTimeDisplay.DATE_TIME; } - public static boolean getActivateDisplayOnLiftWrist() { + public static ActivateDisplayOnLift getActivateDisplayOnLiftWrist(Context context) { Prefs prefs = GBApplication.getPrefs(); - return prefs.getBoolean(MiBandConst.PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT, true); + + String liftOff = context.getString(R.string.p_off); + String liftOn = context.getString(R.string.p_on); + String liftScheduled = context.getString(R.string.p_scheduled); + + String pref = prefs.getString(MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT, liftOff); + + if (liftOn.equals(pref)) { + return ActivateDisplayOnLift.ON; + } else if (liftScheduled.equals(pref)) { + return ActivateDisplayOnLift.SCHEDULED; + } + + return ActivateDisplayOnLift.OFF; + } + + public static Date getDisplayOnLiftStart() { + return getTimePreference( MiBandConst.PREF_DISPLAY_ON_LIFT_START, "00:00"); + } + + public static Date getDisplayOnLiftEnd() { + return getTimePreference( MiBandConst.PREF_DISPLAY_ON_LIFT_END, "00:00"); } public static Set getDisplayItems() { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java index 1c945cdf7..6275db7a1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java @@ -134,8 +134,8 @@ public class MiBand2Service { public static final byte[] DATEFORMAT_TIME = new byte[] {ENDPOINT_DISPLAY, 0x0a, 0x0, 0x0 }; public static final byte[] DATEFORMAT_TIME_12_HOURS = new byte[] {ENDPOINT_DISPLAY, 0x02, 0x0, 0x0 }; public static final byte[] DATEFORMAT_TIME_24_HOURS = new byte[] {ENDPOINT_DISPLAY, 0x02, 0x0, 0x1 }; - public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01}; - public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00}; + public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; + public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; public static final byte[] COMMAND_ENABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x01}; public static final byte[] COMMAND_DISABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x00}; public static final byte[] COMMAND_ENABLE_ROTATE_WRIST_TO_SWITCH_INFO = new byte[]{ENDPOINT_DISPLAY, 0x0d, 0x00, 0x01}; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandConst.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandConst.java index 7ddee301f..e1247d91c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandConst.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandConst.java @@ -49,7 +49,9 @@ public final class MiBandConst { public static final String PREF_MI2_DISPLAY_ITEM_CALORIES = "calories"; public static final String PREF_MI2_DISPLAY_ITEM_HEART_RATE = "heart_rate"; public static final String PREF_MI2_DISPLAY_ITEM_BATTERY = "battery"; - public static final String PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT = "mi2_activate_display_on_lift_wrist"; + public static final String PREF_ACTIVATE_DISPLAY_ON_LIFT = "activate_display_on_lift_wrist"; + public static final String PREF_DISPLAY_ON_LIFT_START = "display_on_lift_start"; + public static final String PREF_DISPLAY_ON_LIFT_END = "display_on_lift_end"; public static final String PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO = "mi2_rotate_wrist_to_switch_info"; public static final String PREF_MI2_ENABLE_TEXT_NOTIFICATIONS = "mi2_enable_text_notifications"; public static final String PREF_MI2_DO_NOT_DISTURB = "mi2_do_not_disturb"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java index 923aa7314..b557dedf1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java @@ -38,7 +38,9 @@ import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_ALARM_CLOCK; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_INCOMING_CALL; -import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT; +import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT; +import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_DISPLAY_ON_LIFT_END; +import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_DISPLAY_ON_LIFT_START; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DATEFORMAT; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DISPLAY_ITEMS; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DO_NOT_DISTURB; @@ -135,14 +137,14 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity { } }); - final Preference activateDisplayOnLift = findPreference(PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT); + final Preference activateDisplayOnLift = findPreference(PREF_ACTIVATE_DISPLAY_ON_LIFT); activateDisplayOnLift.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newVal) { invokeLater(new Runnable() { @Override public void run() { - GBApplication.deviceService().onSendConfiguration(PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT); + GBApplication.deviceService().onSendConfiguration(PREF_ACTIVATE_DISPLAY_ON_LIFT); } }); return true; @@ -313,6 +315,60 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity { } }); + String displayOnLiftState = prefs.getString(MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT, PREF_MI2_DO_NOT_DISTURB_OFF); + boolean displayOnLiftScheduled = displayOnLiftState.equals(PREF_MI2_DO_NOT_DISTURB_SCHEDULED); + + final Preference displayOnLiftStart = findPreference(PREF_DISPLAY_ON_LIFT_START); + displayOnLiftStart.setEnabled(displayOnLiftScheduled); + displayOnLiftStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newVal) { + invokeLater(new Runnable() { + @Override + public void run() { + GBApplication.deviceService().onSendConfiguration(PREF_DISPLAY_ON_LIFT_START); + } + }); + return true; + } + }); + + + final Preference displayOnLiftEnd = findPreference(PREF_DISPLAY_ON_LIFT_END); + displayOnLiftEnd.setEnabled(displayOnLiftScheduled); + displayOnLiftEnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newVal) { + invokeLater(new Runnable() { + @Override + public void run() { + GBApplication.deviceService().onSendConfiguration(PREF_DISPLAY_ON_LIFT_END); + } + }); + return true; + } + }); + + + final Preference displayOnLift = findPreference(PREF_ACTIVATE_DISPLAY_ON_LIFT); + displayOnLift.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newVal) { + final boolean scheduled = PREF_MI2_DO_NOT_DISTURB_SCHEDULED.equals(newVal.toString()); + + displayOnLiftStart.setEnabled(scheduled); + displayOnLiftEnd.setEnabled(scheduled); + + invokeLater(new Runnable() { + @Override + public void run() { + GBApplication.deviceService().onSendConfiguration(PREF_ACTIVATE_DISPLAY_ON_LIFT); + } + }); + return true; + } + }); + final Preference fitnessGoal = findPreference(ActivityUser.PREF_USER_STEPS_GOAL); fitnessGoal.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java index 1525894e9..0d095a714 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java @@ -56,6 +56,7 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallContro import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventFindPhone; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo; import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.ActivateDisplayOnLift; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipService; @@ -1330,7 +1331,9 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport { case MiBandConst.PREF_MI2_GOAL_NOTIFICATION: setGoalNotification(builder); break; - case MiBandConst.PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT: + case MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT: + case MiBandConst.PREF_DISPLAY_ON_LIFT_START: + case MiBandConst.PREF_DISPLAY_ON_LIFT_END: setActivateDisplayOnLiftWrist(builder); break; case MiBandConst.PREF_MI2_DISPLAY_ITEMS: @@ -1418,12 +1421,32 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport { } private MiBand2Support setActivateDisplayOnLiftWrist(TransactionBuilder builder) { - boolean enable = HuamiCoordinator.getActivateDisplayOnLiftWrist(); - LOG.info("Setting activate display on lift wrist to " + enable); - if (enable) { - builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST); - } else { - builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST); + ActivateDisplayOnLift displayOnLift = HuamiCoordinator.getActivateDisplayOnLiftWrist(getContext()); + LOG.info("Setting activate display on lift wrist to " + displayOnLift); + + switch (displayOnLift) { + case ON: + builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST); + break; + case OFF: + builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST); + break; + case SCHEDULED: + byte[] cmd = MiBand2Service.COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST.clone(); + + Calendar calendar = GregorianCalendar.getInstance(); + + Date start = HuamiCoordinator.getDisplayOnLiftStart(); + calendar.setTime(start); + cmd[4] = (byte) calendar.get(Calendar.HOUR_OF_DAY); + cmd[5] = (byte) calendar.get(Calendar.MINUTE); + + Date end = HuamiCoordinator.getDisplayOnLiftEnd(); + calendar.setTime(end); + cmd[6] = (byte) calendar.get(Calendar.HOUR_OF_DAY); + cmd[7] = (byte) calendar.get(Calendar.MINUTE); + + builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), cmd); } return this; } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 3da9a3ff2..1e3f963a5 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -150,6 +150,17 @@ @string/p_scheduled + + @string/off + @string/on + @string/mi2_dnd_scheduled + + + @string/p_off + @string/p_automatic + @string/p_scheduled + + @string/chart_steps @string/distance diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f42a5015f..97b54bcc9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -488,6 +488,7 @@ You need to install version %1$s before installing this firmware! Text notifications = 1.0.1.28 and Mili_pro.ft* installed.]]> + On Off Off Automatic (sleep detection) diff --git a/app/src/main/res/values/values.xml b/app/src/main/res/values/values.xml index a6f7361e8..3de882530 100644 --- a/app/src/main/res/values/values.xml +++ b/app/src/main/res/values/values.xml @@ -20,6 +20,7 @@ battery off + on automatic scheduled diff --git a/app/src/main/res/xml/miband_preferences.xml b/app/src/main/res/xml/miband_preferences.xml index 56418ed23..1ce4aec98 100644 --- a/app/src/main/res/xml/miband_preferences.xml +++ b/app/src/main/res/xml/miband_preferences.xml @@ -122,14 +122,37 @@ android:summary="@string/mi2_prefs_display_items_summary" android:title="@string/mi2_prefs_display_items"/> - + + + + + + + + + + + From 73cfeb8a7e692009e9e875dfcd9c837e01072dda Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 24 Mar 2018 00:00:25 +0100 Subject: [PATCH 25/31] Mi Band 2: scheduling diplay on lift wrist does not work (only on Bip), make the on and off settings at least work again... --- .../gadgetbridge/devices/miband/MiBand2Service.java | 5 +++-- .../gadgetbridge/service/devices/miband2/MiBand2Support.java | 2 +- app/src/main/res/values/arrays.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java index 6275db7a1..71ffacf1b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Service.java @@ -134,8 +134,9 @@ public class MiBand2Service { public static final byte[] DATEFORMAT_TIME = new byte[] {ENDPOINT_DISPLAY, 0x0a, 0x0, 0x0 }; public static final byte[] DATEFORMAT_TIME_12_HOURS = new byte[] {ENDPOINT_DISPLAY, 0x02, 0x0, 0x0 }; public static final byte[] DATEFORMAT_TIME_24_HOURS = new byte[] {ENDPOINT_DISPLAY, 0x02, 0x0, 0x1 }; - public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; - public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01}; + public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00}; + public static final byte[] COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; public static final byte[] COMMAND_ENABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x01}; public static final byte[] COMMAND_DISABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x00}; public static final byte[] COMMAND_ENABLE_ROTATE_WRIST_TO_SWITCH_INFO = new byte[]{ENDPOINT_DISPLAY, 0x0d, 0x00, 0x01}; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java index 0d095a714..fefeba9e4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java @@ -1432,7 +1432,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport { builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST); break; case SCHEDULED: - byte[] cmd = MiBand2Service.COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST.clone(); + byte[] cmd = MiBand2Service.COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST.clone(); Calendar calendar = GregorianCalendar.getInstance(); diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 1e3f963a5..4a6bd3794 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -157,7 +157,7 @@ @string/p_off - @string/p_automatic + @string/p_on @string/p_scheduled From 74f9798071a029e21a64f3ced159fe56a5a2d731 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 24 Mar 2018 19:22:49 +0100 Subject: [PATCH 26/31] Amazfit Cor: try to send location This could help #1033 --- .../devices/amazfitbip/AmazfitBipSupport.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java index 4c425b20d..2a888c5ac 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java @@ -37,6 +37,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiWeatherConditions import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipService; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBand2Service; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.model.CallSpec; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; @@ -258,6 +259,25 @@ public class AmazfitBipSupport extends MiBand2Support { } catch (Exception ex) { LOG.error("Error sending weather forecast", ex); } + + if (gbDevice.getType() == DeviceType.AMAZFITCOR) { + try { + TransactionBuilder builder; + builder = performInitialized("Sending forecast location"); + + int length = 2 + weatherSpec.location.getBytes().length; + ByteBuffer buf = ByteBuffer.allocate(length); + buf.order(ByteOrder.LITTLE_ENDIAN); + buf.put((byte) 8); + buf.put(weatherSpec.location.getBytes()); + buf.put((byte) 0); + + builder.write(getCharacteristic(AmazfitBipService.UUID_CHARACTERISTIC_WEATHER), buf.array()); + builder.queue(getQueue()); + } catch (Exception ex) { + LOG.error("Error sending current forecast location", ex); + } + } } @Override From 5ef5ccc6f6ce78455c2af944f729b9ccc8bd31f4 Mon Sep 17 00:00:00 2001 From: Edoardo Rosa Date: Fri, 23 Mar 2018 23:16:18 +0000 Subject: [PATCH 27/31] Translated using Weblate (Italian) Currently translated at 100.0% (463 of 463 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/it/ --- app/src/main/res/values-it/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 4273cae57..ca99685e0 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -500,4 +500,5 @@ Notifiche Gadgetbridge XWatch + Acceso From cce53400f0c83d8bacb5cff628b4a45ab493e07d Mon Sep 17 00:00:00 2001 From: Edoardo Rosa Date: Fri, 23 Mar 2018 23:17:05 +0000 Subject: [PATCH 28/31] Translated using Weblate (Italian) Currently translated at 100.0% (463 of 463 strings) Translation: Freeyourgadget/Gadgetbridge Translate-URL: https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/it/ --- app/src/main/res/values-it/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index ca99685e0..2ed84904f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -306,7 +306,7 @@ Sveglie da riservare per i prossimi eventi del calendario Utilizza il sensore del battito cardiaco per migliorare il riconoscimento del sonno Sfasamento dell\'orario per il device (per consentire il rilevamento del sonno per chi lavora a turni) - Mi2: formato della data + Mi Band 2: Formato Data Ora Ora e data Notifica raggiungimento obbiettivi From 41632b8eb3d76c46a1dcb5494be304228f85cefe Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 24 Mar 2018 19:28:06 +0100 Subject: [PATCH 29/31] Only send dummy AQI to Bip, not to Cor See #1033 --- .../devices/amazfitbip/AmazfitBipSupport.java | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java index 2a888c5ac..189ffdd4d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java @@ -182,28 +182,30 @@ public class AmazfitBipSupport extends MiBand2Support { LOG.error("Error sending current weather", ex); } - try { - TransactionBuilder builder; - builder = performInitialized("Sending air quality index"); - int length = 8; - String aqiString = "(n/a)"; - if (supportsConditionString) { - length += aqiString.getBytes().length + 1; + if (gbDevice.getType() == DeviceType.AMAZFITBIP) { + try { + TransactionBuilder builder; + builder = performInitialized("Sending air quality index"); + int length = 8; + String aqiString = "(n/a)"; + if (supportsConditionString) { + length += aqiString.getBytes().length + 1; + } + ByteBuffer buf = ByteBuffer.allocate(length); + buf.order(ByteOrder.LITTLE_ENDIAN); + buf.put((byte) 4); + buf.putInt(weatherSpec.timestamp); + buf.put((byte) (tz_offset_hours * 4)); + buf.putShort((short) 0); + if (supportsConditionString) { + buf.put(aqiString.getBytes()); + buf.put((byte) 0); + } + builder.write(getCharacteristic(AmazfitBipService.UUID_CHARACTERISTIC_WEATHER), buf.array()); + builder.queue(getQueue()); + } catch (IOException ex) { + LOG.error("Error sending air quality"); } - ByteBuffer buf = ByteBuffer.allocate(length); - buf.order(ByteOrder.LITTLE_ENDIAN); - buf.put((byte) 4); - buf.putInt(weatherSpec.timestamp); - buf.put((byte) (tz_offset_hours * 4)); - buf.putShort((short) 0); - if (supportsConditionString) { - buf.put(aqiString.getBytes()); - buf.put((byte) 0); - } - builder.write(getCharacteristic(AmazfitBipService.UUID_CHARACTERISTIC_WEATHER), buf.array()); - builder.queue(getQueue()); - } catch (IOException ex) { - LOG.error("Error sending air quality"); } try { From 77b13a1048d86e59515e9b39ee2df605a82974af Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 25 Mar 2018 10:49:38 +0200 Subject: [PATCH 30/31] bump version, add changelogs --- CHANGELOG.md | 6 ++++++ app/build.gradle | 4 ++-- app/src/main/res/xml/changelog_master.xml | 6 ++++++ fastlane/metadata/android/en-US/changelogs/125.txt | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/125.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bf3b81ed..53852960b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ### Changelog +#### Version 0.25.1 +* Amazfit Cor: Try to send weather location instead of AQI +* Amazfit Bip: Support setting start end end time for background light when lifting the arm +* Pebble: various fixes and improvemnets for background javascript +* Explicity ask for RECEIVE_SMS permission to fix problems with Android 8 + #### Version 0.25.0 * Inital suport for Xwatch * Move the connected device to top in control center diff --git a/app/build.gradle b/app/build.gradle index beffac80b..9994ad695 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,8 +25,8 @@ android { targetSdkVersion 27 // Note: always bump BOTH versionCode and versionName! - versionName "0.25.0" - versionCode 124 + versionName "0.25.1" + versionCode 125 vectorDrawables.useSupportLibrary = true } buildTypes { diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index c74d8d1b3..c27ccc1a7 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,5 +1,11 @@ + + Amazfit Cor: Try to send weather location instead of AQI + Amazfit Bip: Support setting start end end time for background light when lifting the arm + Pebble: various fixes and improvemnets for background javascript + Explicity ask for RECEIVE_SMS permission to fix problems with Android 8 + Inital suport for Xwatch Move the connected device to top in control center diff --git a/fastlane/metadata/android/en-US/changelogs/125.txt b/fastlane/metadata/android/en-US/changelogs/125.txt new file mode 100644 index 000000000..a5a1059d1 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/125.txt @@ -0,0 +1,4 @@ +* Amazfit Cor: Try to send weather location instead of AQI +* Amazfit Bip: Support setting start end end time for background light when lifting the arm +* Pebble: various fixes and improvemnets for background javascript +* Explicity ask for RECEIVE_SMS permission to fix problems with Android 8 From 49b06537ee04e57fce656d714bf73c1d761559cd Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 27 Mar 2018 11:09:33 +0200 Subject: [PATCH 31/31] update gradle plugin to 3.1.0 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1318787a7..d9688d9a9 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath "com.android.tools.build:gradle:3.0.1" + classpath 'com.android.tools.build:gradle:3.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files