Pouze tento týden sleva až 80 % na e-learning týkající se Swift
Využij akce až 80 % zdarma při nákupu e-learningu. Více informací.

Diskuze: Programování ciferníku pro Samsung a převod kodu z WatchMakeru do jiného engine

Aktivity
Avatar
Daniel Semerák:23. srpna 19:26

Zdravím.
Obracím se na vás zdatné s prosbou, jež se možná netýká přímo tohoto vlákna.
V mobilní APliKaci WatchMaker jsem si vytvořil ciferník, který žel neumí počítat schody a u kterého se mi nedaří spárovat načtené kroky z hodinek se SamsungHealthem v mobilu.
Navíc mám pocit, že tento ciferník mi žere více baterii než jakýkoli přímo stažený z GooglePlay.

Zkusil jsem:

<Watch name="Digi" description="" tags="24h,battery,date,digital,heart,moon,steps,tap,weather" features="24h Time,Battery Level,Charging Status,Date,Digital,Heart Rate,Location,Moon Phase,Steps,Tap Actions,Weather" shape="R" author="Danny" web_link="" bg_color="000000" ucolor_default="ffffff" ind_loc="tc" ind_bg="N" hotword_loc="tc" hotword_bg="Y">
    <Layer type="text" x="0" y="-190" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cc" text="{ddww}
{dd}. {dnnnn} {dyy}" text_size="25" anim_scale_x="100" anim_scale_y="100" font="Roboto-Bold" transform="n" color_dim="808080" color="ffffff" display="bd"/>
    <Layer type="text" x="40" y="150" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cl" text="{shr}" text_size="25" anim_scale_x="100" anim_scale_y="100" font="Aldrich-Regular" transform="n" color_dim="ff0000" color="ff0000" display="bd" tap_action="w_heart_rate" protected="y"/>
    <Layer type="image_cond" x="-200" y="0" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cc" path="moon_set_1.png" width="50" height="50" color="ffffff" cond_value="{wmp}" cond_grid="3x3" display="b"/>
    <Layer type="text" x="-40" y="150" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cr" text="{ssc}" text_size="30" anim_scale_x="100" anim_scale_y="100" font="Aldrich-Regular" transform="n" color_dim="00ff00" color="00ff00" display="bd" tap_action="widget_health"/>
    <Layer type="text" x="0" y="90" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cc" text="{alatdd} {alondd}
{wl}" text_size="23" anim_scale_x="100" anim_scale_y="100" font="Aldrich-Regular" transform="n" color_dim="00a8ff" color="00a8ff" display="b" tap_action="w_compass"/>
    <Layer type="image_cond" x="165" y="-125" gyro="0" rotation="90" skew_x="0" skew_y="0" opacity="100" alignment="cc" path="battery_set_1.png" width="50" height="100" color="{bl} == 100 and &apos;00ff00&apos; or {bl} &gt; 81 and &apos;ff00ff&apos; or {bl} &gt; 61 and &apos;0000ff&apos; or {bl} &gt;41 and &apos;007fff&apos; or {bl} &gt; 21 and &apos;808000&apos; or {bl} &gt;6 and &apos;ffa500&apos; or  &apos;ff0000&apos;" cond_value="&apos;{bc}&apos; == &apos;Charging&apos; and 7 or {bl} &gt;= 80 and 1 or {bl} &gt;= 70 and 2 or {bl} &gt;= 60 and 3 or {bl} &gt;= 40 and 4 or {bl} &gt;= 20 and 5 or 6" cond_grid="3x3" display="bd"/>
    <Layer type="text" x="0" y="-70" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cc" text="var_getSvatek()" text_size="23" anim_scale_x="100" anim_scale_y="100" font="Roboto-Bold" transform="n" color_dim="ffffff" color="ffffff" display="b"/>
    <Layer type="text" x="-170" y="-115" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="br" text="{dw}" text_size="25" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="ffffff" color="ffffff" display="b"/>
    <Layer type="text" x="115" y="-115" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="br" text="{blp}" text_size="20" anim_scale_x="100" anim_scale_y="100" font="Gotham-Bold" transform="n" color_dim="{bl} == 100 and &apos;00ff00&apos; or {bl} &gt; 81 and &apos;ff00ff&apos; or {bl} &gt; 61 and &apos;0000ff&apos; or {bl} &gt;41 and &apos;007fff&apos; or {bl} &gt; 21 and &apos;808000&apos; or {bl} &gt;6 and &apos;ffa500&apos; or  &apos;ff0000&apos;" color="{bl} == 100 and &apos;00ff00&apos; or {bl} &gt; 81 and &apos;ff00ff&apos; or {bl} &gt; 61 and &apos;0000ff&apos; or {bl} &gt;41 and &apos;007fff&apos; or {bl} &gt; 21 and &apos;808000&apos; or {bl} &gt;6 and &apos;ffa500&apos; or  &apos;ff0000&apos;" display="bd"/>
    <Layer type="text" x="-170" y="-115" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="bl" text=". týden" text_size="20" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="808080" color="808080" display="b"/>
    <Layer type="text" x="-20" y="-115" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="bl" text=". den" text_size="20" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="808080" color="808080" display="b"/>
    <Layer type="text" x="-20" y="-115" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="br" text="{ddy}" text_size="25" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="ffffff" color="ffffff" display="b"/>
    <Layer type="text" x="120" y="0" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cr" text="{dh23}:{dmz}" text_size="90" anim_scale_x="100" anim_scale_y="100" font="lcd_b" transform="n" color_dim="fff907" color="fff907" display="bd"/>
    <Layer type="text" x="205" y="10" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cr" text="{dsz}" text_size="50" anim_scale_x="100" anim_scale_y="100" font="DS-Digital" transform="n" color_dim="fff907" color="fff907" display="b"/>
    <Layer type="text" x="-40" y="185" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cr" text="{sdst}" text_size="30" anim_scale_x="100" anim_scale_y="100" font="Aldrich-Regular" transform="n" color_dim="00ff00" color="00ff00" display="bd"/>
    <Layer type="text" x="-35" y="185" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cl" text="km" text_size="20" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="008000" color="008000" display="bd"/>
    <Layer type="text" x="-35" y="150" gyro="0" rotation="0" skew_x="0" skew_y="0" opacity="100" alignment="cl" text="kr" text_size="20" anim_scale_x="100" anim_scale_y="100" font="Roboto-Regular" transform="n" color_dim="008000" color="008000" display="bd"/>
</Watch>

function var_getSvatek()
md={31,28,31,30,31,30,31,31,30,31,30,31}
m1 = {"Nový rok","Karina","Radmila","Diana","Dalimil","Tři Králové","Vilma","Čestmír","Vladan","Břetislav","Bohdana","Pravoslav","Edita","Radovan","Alice","Ctirad","Drahoslav","Vladislav","Doubravka","Ilona","Běla","Slavomír","Zdeněk","Milena","Miloš","Zora","Ingrid","Otýlie","Zdislava","Robin","Marika",}
m2 = {"Hynek","Nela","Blažej","Jarmila","Dobromila","Vanda","Veronika","Milada","Apolena","Mojmír","Božena","Slavěna","Věnceslav","Valentýn","Jiřina","Ljuba","Miloslava","Gizela","Patrik","Oldřich","Lenka","Petr","Svatopluk","Matěj","Liliana","Dorota","Alexandr","Lumír","Horymír"}
m3 = {"Bedřich","Anežka","Kamil","Stela","Kazimír","Miroslav","Tomáš","Gabriela","Františka","Viktorie","Anděla","Řehoř","Růžena","Rút","Ida","Elena","Vlastimil","Eduard","Josef","Světlana","Radek","Leona","Ivona","Gabriel","Marián","Emanuel","Dita","Soňa","Taťána","Arnošt","Kvido",}
m4 = {"Hugo","Erika","Richard","Ivana","Miroslava","Vendula","Heřman\r\nHermína","Ema","Dušan","Darja","Izabela","Julius","Aleš","Vincenc","Anastázie","Irena","Rudolf","Valérie","Rostislav","Marcela","Alexandra","Evženie","Vojtěch","Jiří","Marek","Oto","Jaroslav","Vlastislav","Robert","Blahoslav",}
m5 = {"1. máj","Zikmund","Alexej","Květoslav","Klaudie","Radoslav","Stanislav","Osvobození\r\nod fašismu","Ctibor","Blažena","Svatava","Pankrác","Servác","Bonifác","Žofie","Přemysl","Aneta","Nataša","Ivo","Zbyšek","Monika","Emil","Vladimír","Jana","Viola","Filip","Valdemar","Vilém","Maxim","Ferdinand","Kamila",}
m6 = {"Laura","Jarmil","Tamara","Dalibor","Dobroslav","Norbert","Iveta","Medard","Stanislava","Gita","Bruno","Antonie","Antonín","Roland","Vít","Zbyněk","Adolf","Milan","Leoš","Květa","Alois","Pavla","Zdeňka","Jan","Ivan","Adriana","Ladislav","Lubomír","Petr a Pavel","Šárka",}
m7 = {"Jaroslava","Patricie","Radomír","Prokop","Cyrila a Metoděje","mistr Jan Hus","Bohuslava","Nora","Drahoslava","Libuše","Olga","Bořek","Markéta","Karolína","Jindřich","Luboš","Martina","Drahomíra","Čeněk","Ilja","Vítězslav","Magdaléna","Libor","Kristýna","Jakub","Anna","Věroslav","Viktor","Marta","Bořivoj","Ignác",}
m8 = {"Oskar","Gustav","Miluše","Dominik","Kristián","Oldřiška","Lada","Soběslav","Roman","Vavřinec","Zuzana","Klára","Alena","Alan","Hana","Jáchym","Petra","Helena","Ludvík\r\nLuisa","Bernard","Johana","Bohuslav","Sandra","Bartoloměj","Radim","Luděk","Otakar","Augustýn","Evelína","Vladěna","Pavlína",}
m9 = {"Linda\r\nSamuel","Adéla","Bronislav","Jindřiška","Boris","Boleslav","Regina","Mariana","Daniela","Irma","Denisa","Marie","Lubor","Radka","Jolana","Ludmila","Naděžda","Kryštof","Zita","Oleg","Matouš","Darina","Berta","Jaromír","Zlata","Andrea","Jonáš","Václav","Michal","Jeroným",}
m10 = {"Igor","Olívia\r\nGalina","Bohumil","František","Eliška","Hanuš","Justýna","Věra","Štefan\r\nSára","Marina","Andrej","Marcel","Renáta","Agáta","Tereza","Havel","Hedvika","Lukáš","Michaela","Vendelín","Brigita","Sabina","Teodor","Nina","Beata","Erik","Šarlota\r\nZoe","Den vzniku\r\nčeskoslovenského státu","Silvie","Tadeáš","Štěpánka",}
m11 = {"Fenix","Památka zesnulých","Hubert","Karel","Miriam","Liběna","Saskie","Bohumír","Bohdan","Evžen","Martin","Benedikt","Tibor","Sáva","Leopold","Otmar","Den boje studentů\r\nza svobodu","Romana","Alžběta","Nikola","Albert","Cecílie","Klement","Emílie","Kateřina","Artur","Xenie","René","Zina","Ondřej",}
m12 = {"Iva","Blanka","Svatoslav","Barbora","Jitka","Mikuláš","Ambrož","Květoslava","Vratislav","Julie","Dana","Simona","Lucie","Lýdie","Radana","Albína","Daniel","Miloslav","Ester","Dagmar","Natálie","Šimon","Vlasta","Adam a Eva\r\nŠtědrý den","Boží hod\r{m2min}\n1. svátek vánoční","Štěpán\r\n2. svátek vánoční","Žaneta","Bohumila","Judita","David","Silvestr",}
svatky = {m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12}
m={dn}
d={dd}
month = svatky[m]
day = month[d]
return string.sub(day, 1, 30)
end

Chci docílit: Rád bych si proto převedl už vytvořený a vygenerovaný kod z WM do VS nebo do Tizen Studia a aby mnou vytvořený ciferník nebyl vázaný na program v hodinkách, pod kterým ten můj ciferník pracuje.
Jeden člověk na FB se mi snažil nějak pomoci, ale z jeho rad jsem moc moudrý nebyl.

 
Odpovědět
23. srpna 19:26
Tento výukový obsah pomáhají rozvíjet následující firmy, které dost možná hledají právě tebe!
Avatar
Daniel Semerák:23. srpna 20:00

Vzhled ciferníku
Pod hodnotou tepu chci právě umístit počet nastoupaných schodů, ale WM, jak se zdá, nemá pro tuhle fíčuru žádnou proměnnou.

 
Nahoru Odpovědět
23. srpna 20:00
Děláme co je v našich silách, aby byly zdejší diskuze co nejkvalitnější. Proto do nich také mohou přispívat pouze registrovaní členové. Pro zapojení do diskuze se přihlas. Pokud ještě nemáš účet, zaregistruj se, je to zdarma.

Zobrazeno 2 zpráv z 2.