XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Dec 15日 15:41

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2016年 Dec 20日 13:53 
Offline

Joined: 2015年 Mar 25日 11:55
Posts: 82
When editing a widget within Android, how can I change the text size within a single text element using bind core. For example, I'd like to have a single text item that contains the 12 hour clock (centered, no leading zero) with the AM/PM element. I know I can have a separate text element for AM/PM, but if I combine, it will keep the spacing between it and the clock consistent when the tens hour appears and disappears. To do this, I can input "${Time} ${AMPM}" in the core label, but is there a code available to make the AMPM text size smaller than the clock, e.g. 1/4 the size? Thanks.


Top
 Profile  
 
PostPosted: 2016年 Dec 20日 14:24 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4568
I'm afraid that this cannot be done using the Android app. Because simply doesn't support any java script (using show hide layers).
The solution as you said is to create a separate txt for AM/PM. I know that sometimes especially without the '0' the space appears a bit large but there is no other way. Try to play with the alignment or put the ampm text on top or bottom of the clock for the best result.

Edit: The show hide is supported on the Android but only for images. But for a single image. Creating ampm images you will need 3 images - one script code, so I'm not sure if it will work..

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


Top
 Profile  
 
PostPosted: 2016年 Dec 20日 15:14 
Offline

Joined: 2015年 Mar 25日 11:55
Posts: 82
jimking wrote:
I'm afraid that this cannot be done using the Android app. Because simply doesn't support any java script (using show hide layers).
The solution as you said is to create a separate txt for AM/PM. I know that sometimes especially without the '0' the space appears a bit large but there is no other way. Try to play with the alignment or put the ampm text on top or bottom of the clock for the best result.

Edit: The show hide is supported on the Android but only for images. But for a single image. Creating ampm images you will need 3 images - one script code, so I'm not sure if it will work..
Thanks for the reply. I was thinking that I had seen it done a while back. Must have been dreaming. Merry Christmas.


Top
 Profile  
 
PostPosted: 2016年 Dec 20日 15:42 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4568
Wait.... :!:
The "AM", "PM" as an image can be used on Android using this tag code (to assign to a single image):
Code:
ampm\12hr${AP01}.png

(ampm = name of the folder)

As I told you need to have 3 images- same size X,Y(in the folder):
1) name= 12hr0 for AM
2) name= 12hr1 for PM
3) name= 12hr (empty-transparent)

I don't know if you mean this ... You can create a text-clock and next add the image for AMPM.
(depending on the font style, I suggest you to test with this time value 12:00 or 12:56 to check where you will put the image)

EXAMPLE:
http://android.xwidget.com/page/widgets ... Clock.html

I don't know which program you're using, but with GIMP you can create these .pngs really easy and fast

_________________
Image
...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  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 8 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