XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 1st, 2025, 1:20 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 20th, 2016, 1:53 pm 
Offline

Joined: March 25th, 2015, 11:55 am
Posts: 105
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: December 20th, 2016, 2:24 pm 
Offline
User avatar

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

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


Top
 Profile  
 
PostPosted: December 20th, 2016, 3:14 pm 
Offline

Joined: March 25th, 2015, 11:55 am
Posts: 105
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: December 20th, 2016, 3:42 pm 
Offline
User avatar

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

_________________
...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 14 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:  
cron

Powered by phpBB® Forum Software © phpBB Group