XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
scipt function/Android https://www.bbs.xwidget.com/viewtopic.php?f=8&t=4239 |
Page 1 of 1 |
Author: | Jimking [ March 12th, 2014, 5:39 pm ] |
Post subject: | scipt function/Android |
I already made widgets with the function of "lighting" days like these for example: (the Today-Day shows with different color) http://jimking.deviantart.com/art/Angle ... -435947823 or http://jimking.deviantart.com/art/Light ... -432343711 I always use a certain type of script. But I was wondering, since the Android app of XWidget doesn't support script codes, is there a way to reproduce this mode to Android..? ![]() |
Author: | hamid [ March 12th, 2014, 11:49 pm ] |
Post subject: | Re: scipt function/Android |
i have never used android mode and also i'm not so good in gui mode, but i think this can be done by using more objects, you can try these: ================= 1. first method: using pngs with different colors as background of every day, you will need 7pngs for every day, name them like this: --------- obj1-sat.png obj2-sun.png obj3-mon.png obj4-tue.png obj5-wed.png obj6-thu.png obj7.fri.png -------------- then add 7 image object to the widget and put each of them at the back of every day, use binding core as datetimecore for every image objects and write like this in binding core data: -------- obj1-${WeekShort}.png obj2-${WeekShort}.png obj3-${WeekShort}.png obj4-${WeekShort}.png obj5-${WeekShort}.png obj6-${WeekShort}.png obj7-${WeekShort}.png ----------- since for example [obj1-tue.png] not exist so i think it shouldn't show any image so light effect will be disabled for non-exist images and you will finish it here. but if there is a problem with non exist images you should add empty pngs and name them as above for those too. ============= 2. second method: using two series of pngs that one have backgroung light and one doesn't have background light, naming and binding is same as above, ================== |
Author: | Jimking [ March 13th, 2014, 1:25 am ] |
Post subject: | Re: scipt function/Android |
Quote: i'm not so good in gui mode There is no "gui mode" hamid. The Android mode in the Designer works like the normal one, but with less components and cores, and no compatibility for script! (I don't know for the future versions of the app..) With only addition the "Hot Spot" core for the click on option for weather update or shortcut. From your reply I see that you talk about .png files.. About pngs there is a default code for this function that I used once putting this code "${WeekNumInt2}.png" Here: http://jimking.deviantart.com/art/Class ... -437006491 My query is if this can be reproduced with TXTs... There are already a lot android widgets with this mode, and when I try to check them from "inside" I don't find any pngs, so somehow is possible.. |
Author: | hamid [ March 13th, 2014, 4:01 am ] |
Post subject: | Re: scipt function/Android |
jimking wrote: There is no "gui mode" hamid. The Android mode in the Designer works like the normal one, but with less components and cores, and no compatibility for script! (I don't know for the future versions of the app..) when i said gui i mean designer, as i mostly use script for my works and don't like to use designer.With only addition the "Hot Spot" core for the click on option for weather update or shortcut. jimking wrote: From your reply I see that you talk about .png files.. when i said png i mean [image object] in designer and using binding core data to link to the png files.About pngs there is a default code for this function that I used once putting this code "${WeekNumInt2}.png" Here: http://jimking.deviantart.com/art/Class ... -437006491 My query is if this can be reproduced with TXTs... There are already a lot android widgets with this mode, and when I try to check them from "inside" I don't find any pngs, so somehow is possible.. (just to note [image object] is available in android mode but [pnganimate object] doesn't.) (also you can use any other formats for images that xwidget support (like jpg); png was just an example) for example if you create png file with name [obj1-sat.png], when saturday is today, in binding core it will get obj1-sat.png for saturday and image will be shown but other objects will get obj2-sat.png , obj3-sat.png that the file is doesn't exist, so nothing will shown for those objects, so you hide other days that way. i tested my idea and it works, just you need to create empty png files instead of non-exist files that i said above as well, to hide image after first load. (this should be a bug of xwidget: after the first time image loaded it will doesn't hide until matching new image name to load it; this means binding core doesn't update until match an image) i hope you get what i mean |
Author: | Jimking [ March 13th, 2014, 8:05 am ] | ||
Post subject: | Re: scipt function/Android | ||
Thanks hamid for your reply.. I'm sure that your ideas work! I hoped that there is a way to make it work with txts instead of pngs.. Making png is not so hard, but to match them is a certain design adding color etc, surely requires moreeee time than work with the design's elements..It should be a trick.. A good example is this Analog clock widget: http://jimking.deviantart.com/art/Long- ... -420356344 It has the day/night function that works through the script. Now check the attach file to see how the same widget works with the same way BUT without a script! Only renaming the images, doing some changes in the components of the widget and adding a core that is not in the default list. ![]() I hoped that there is something "similar" to this "mod"..
|
Author: | hamid [ March 13th, 2014, 10:41 am ] |
Post subject: | Re: scipt function/Android |
this works exactly same way that i said to you in above post. for your attachment: there is 2 png files for each element that will change between day and night. if you notice the binding core there is a hour_${dayOrNight}.png for hour and minute_${dayOrNight}.png for minute. this (hour_${dayOrNight}.png) means that: when ${dayOrNight} is [day] that sends [d]: result will be hour_d.png when ${dayOrNight} is [night] that sends [n]: result will be hour_n.png in this widget because of the 2 object that need to be replaced from day to night are in same place it doesn't need more objects and it will be replaced by first one. but in your widget you have 7objects in different places so each one should get hidden on its place and not replaced by something on same place, so we use empty png to make it hidden and activate another object in another place. (remember that we are using more than one object because we couldn't change the [position of object] on the fly without script.) |
Author: | hamid [ March 13th, 2014, 11:24 am ] |
Post subject: | Re: scipt function/Android |
i also found another method right now; test your widget that i edited right now and find what i did ![]() Attachment:
|
Author: | Jimking [ March 13th, 2014, 12:08 pm ] |
Post subject: | Re: scipt function/Android |
hamid wrote: i also found another method right now; test your widget that i edited right now and find what i did ![]() Unfortunately doesn't work... ![]() All the days appear the same and "lighting". Tested on Android too... |
Author: | Jimking [ March 13th, 2014, 2:23 pm ] |
Post subject: | Re: scipt function/Android |
I found a mistake for the week days (you added the "${WeekShort}" instead of "${WeekEnShort}". But still doesn't work properly..But we're close! It shows like this: ![]() Also as you noticed using txt, XWidget by default shows two days of the week Thursday and Thusday with 4 letters, Thur and Thus, that ruin the design.. At this point I think that the .pngs maybe are the only way.. I was thinking to create the 7 .pngs for the days taking screenshots from of the widget, cut the images,and place them to the right position. And then using the codes that you posted.. |
Author: | hamid [ March 13th, 2014, 10:57 pm ] |
Post subject: | Re: scipt function/Android |
i'm using xwidget 1.8.8.1111 portable and everything working right. plz say which version you're using to test it out. if it display 4character for some days and 3 for others, i don't think it is standard way. but nothing to worry i also have some idea for this. ![]() the Full week one should be same in all versions of xwidget, so i used ${WeekEN} in this one to create short 3Char names manually. this should prevent any problem in the future Changes of Xwidget. try this out: Attachment: ![]() Downloaded 343 times |
Author: | Jimking [ March 14th, 2014, 2:57 am ] |
Post subject: | Re: scipt function/Android |
Now it works!!! ![]() You're my man! What have you done to make it work!??? (I would like to port some more widgets that will be nice for the Android) I was thinking you and meme, "promote" you to something like "coder" for this forum. You are very active, you always help users and first of all you know very well the script language. Unfortunately as a Mod I don't have the privileges to do it, but I'll talk to Tony and qiancang about this.. What do you think? ![]() |
Author: | hamid [ March 14th, 2014, 4:08 am ] |
Post subject: | Re: scipt function/Android |
jimking wrote: What have you done to make it work!??? (I would like to port some more widgets that will be nice for the Android) there is a [Substitute] option available for [text] Objects in the Attributes Tab of Inspector in Designer. this will do replacement of words and also can change case of letters in words. i used it to replace the day of week with 3 characters and for other days replace by nothing (will erase characters) jimking wrote: I was thinking you and meme, "promote" you to something like "coder" for this forum. You are very active, you always help users and first of all you know very well the script language. Unfortunately as a Mod I don't have the privileges to do it, but I'll talk to Tony and qiancang about this.. What do you think? ![]() i'm ready to help as ever; xwidget is really easy to use program and userfriendly, and me as a newbie has found it a good way to learn coding and find skill on it, so i would help this project to express my support and to contribute in some way. |
Author: | Jimking [ March 14th, 2014, 4:37 am ] |
Post subject: | Re: scipt function/Android |
Quote: there is a [Substitute] option available for [text] Objects in the Attributes Tab of Inspector in Designer. this will do replacement of words and also can change case of letters in words. i used it to replace the day of week with 3 characters and for other days replace by nothing (will erase characters) Just..GENIUS! ![]() ... and congrats for the promotion! ![]() |
Author: | Jimking [ March 14th, 2014, 2:39 pm ] |
Post subject: | Re: scipt function/Android |
Hamid, unfortunately this mode doesn't work on Android... ![]() (The meters are not removed yet) ![]() |
Author: | Jimking [ March 14th, 2014, 3:15 pm ] |
Post subject: | Re: scipt function/Android |
I created manually 7 png files with the "light" days and I used the default "${WeekNumInt2}.png" code. But seems that there is a bug or not good compatibility with the Android mode. Tested and doesn't work either.. The light days not appear.. THIS WORKS ON PC BUT NOT ON ANDROID... |
Author: | hamid [ March 14th, 2014, 3:54 pm ] |
Post subject: | Re: scipt function/Android |
Quote: THIS WORKS ON PC BUT NOT ON ANDROID... you mean pngs worked in pc but not in android? also check the ${WeekNumInt2} with a text object in android to see if it exist in android if it exist, then you have done something wrong, because in your above post, other images are working fine and those are using binding core too. so check the bindings again. and something strange: why all CPU, RAM, HDD are 100 in your above image? |
Author: | Jimking [ March 14th, 2014, 6:11 pm ] |
Post subject: | Re: scipt function/Android |
Quote: you mean pngs worked in pc but not in android? I mean that I tested on pc and android. In the first case works, on android the lighting days(pngs) are not appear. Quote: also check the ${WeekNumInt2} with a text object in android to see if it exist in android if it exist, then you have done something wrong, because in your above post, other images are working fine and those are using binding core too. so check the bindings again. I checked and there is this default code and the similar one in the list, both for pc and android (both support datetimecore) So nothing wrong. Quote: and something strange: why all CPU, RAM, HDD are 100 in your above image? Is a test widget, so I didn't delete the old codes/meters. ![]() First I must resolve the days issue. You can check all these by yourself: Try this for ex: http://jimking.deviantart.com/art/Class ... -437006491 (pc=ok, android=not works) I'm almost sure that there is a compatibility bug with this code for Android.. |
Author: | hamid [ March 15th, 2014, 1:07 am ] |
Post subject: | Re: scipt function/Android |
jimking wrote: Quote: also check the ${WeekNumInt2} with a text object in android to see if it exist in android if it exist, then you have done something wrong, because in your above post, other images are working fine and those are using binding core too. so check the bindings again. I checked and there is this default code and the similar one in the list, both for pc and android (both support datetimecore) So nothing wrong. they all used binding core, so how they are working? also i don't undestand what do you mean by default code, i don't see any default for binding core. jimking wrote: You can check all these by yourself: Try this for ex: http://jimking.deviantart.com/art/Class ... -437006491 (pc=ok, android=not works) sorry i don't have android to check |
Author: | Jimking [ March 15th, 2014, 3:04 am ] |
Post subject: | Re: scipt function/Android |
Hey, you don't have an Android mobile!? ![]() Quote: I don't undestand what do you mean by default code, With the "default code" I mean the built-in codes that are in the list and available for pc and android. Look: ![]() It doesn't matter that the other pngs/images work hamid. In the past (before the android XWidget app)there are some built-in codes that were broken, and didn't work well or at all. Then Tony fixed them but as you know the pc and android versions have many differences especially with the compatibility and the way that a pc program will run on an Android device! So maybe we have this case. Why not.. (if Tony give us a reply here will be better!) |
Author: | hamid [ March 15th, 2014, 3:48 am ] |
Post subject: | Re: scipt function/Android |
i think instead of code calling them tags is better also i saw problems with some tags not working on pc with new formatting ${} maybe this is same you can try create a test widget with some text objects and assign each tag to them, to see which one in working or which one don't. or you can wait.............. ![]() ![]() |
Author: | Jimking [ March 15th, 2014, 4:17 am ] |
Post subject: | Re: scipt function/Android |
hamid wrote: or you can wait.............. ![]() ![]() Maybe it's better this way... ![]() |
Author: | qiancang [ March 15th, 2014, 5:14 am ] | ||
Post subject: | Re: scipt function/Android | ||
the only solution for android widget is using 7 images like this:
|
Author: | Jimking [ March 15th, 2014, 5:53 am ] |
Post subject: | Re: scipt function/Android |
But with the 7 png images we will have the same problem again... Tested and doesn't work. If you read the previous posts you will understand the problem.. Thanks for the reply though! |
Author: | qiancang [ March 15th, 2014, 7:03 am ] |
Post subject: | Re: scipt function/Android |
jimking wrote: But with the 7 png images we will have the same problem again... Tested and doesn't work. If you read the previous posts you will understand the problem.. Thanks for the reply though! it work fine on my phone. you have to change the date of your phone manually since !gonextday and !goprevday don't work on phone. |
Author: | Jimking [ March 15th, 2014, 10:00 am ] |
Post subject: | Re: scipt function/Android |
qiancang wrote: jimking wrote: But with the 7 png images we will have the same problem again... Tested and doesn't work. If you read the previous posts you will understand the problem.. Thanks for the reply though! it work fine on my phone. you have to change the date of your phone manually since !gonextday and !goprevday don't work on phone. But this is the fact qiancang. The lighting of the week days must be automatically, like work on pc! (maybe you didn't understand the kind of the widget's function..) The tag exists in both pc and android modes under datetimecore but on android simply doesn't work.. |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |