XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 1:14 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 25 posts ] 
Author Message
 Post subject: scipt function/Android
PostPosted: March 12th, 2014, 5:39 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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..? :|

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 12th, 2014, 11:49 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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,

==================


Top
 Profile  
 
PostPosted: March 13th, 2014, 1:25 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 13th, 2014, 4:01 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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..)
With only addition the "Hot Spot" core for the click on option for weather update or shortcut.
when i said gui i mean designer, as i mostly use script for my works and don't like to use designer.

jimking wrote:
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..
when i said png i mean [image object] in designer and using binding core data to link to the png files.
(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


Top
 Profile  
 
PostPosted: March 13th, 2014, 8:05 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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"..


Attachments:
long_shadows_clock.xwp [134.19 KiB]
Downloaded 306 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: March 13th, 2014, 10:41 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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.)


Last edited by hamid on March 13th, 2014, 11:31 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: March 13th, 2014, 11:24 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i also found another method right now;
test your widget that i edited right now and find what i did :D
Attachment:


Top
 Profile  
 
PostPosted: March 13th, 2014, 12:08 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
i also found another method right now;
test your widget that i edited right now and find what i did :D

Unfortunately doesn't work... :(
All the days appear the same and "lighting".
Tested on Android too...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 13th, 2014, 2:23 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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:

Image

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..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 13th, 2014, 10:57 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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. :D
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:


Top
 Profile  
 
PostPosted: March 14th, 2014, 2:57 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Now it works!!! :D
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? :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 14th, 2014, 4:08 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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.


Top
 Profile  
 
PostPosted: March 14th, 2014, 4:37 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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! 8-)


... and congrats for the promotion! :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 14th, 2014, 2:39 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hamid, unfortunately this mode doesn't work on Android... :(
(The meters are not removed yet)

Image

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 14th, 2014, 3:15 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 14th, 2014, 3:54 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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?


Top
 Profile  
 
PostPosted: March 14th, 2014, 6:11 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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. :lol:
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..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 15th, 2014, 1:07 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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.
how about other images? (weather, date, clock, ...)
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


Top
 Profile  
 
PostPosted: March 15th, 2014, 3:04 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hey, you don't have an Android mobile!? :o
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:
Image

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!)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 15th, 2014, 3:48 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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.............. :arrow: for tony to answer your post :D


Top
 Profile  
 
PostPosted: March 15th, 2014, 4:17 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
or you can wait.............. :arrow: for tony to answer your post :D

Maybe it's better this way... :lol:

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 15th, 2014, 5:14 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
the only solution for android widget is using 7 images like this:


Attachments:
day_lighting.xwp [131.88 KiB]
Downloaded 305 times
Top
 Profile  
 
PostPosted: March 15th, 2014, 5:53 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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!

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 15th, 2014, 7:03 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
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.


Top
 Profile  
 
PostPosted: March 15th, 2014, 10:00 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
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..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 57 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group