XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Change Text Size within Android App https://www.bbs.xwidget.com/viewtopic.php?f=7&t=6565 |
Page 1 of 1 |
Author: | sbs8331 [ December 20th, 2016, 1:53 pm ] |
Post subject: | Change Text Size within Android App |
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. |
Author: | Jimking [ December 20th, 2016, 2:24 pm ] |
Post subject: | Re: Change Text Size within Android App |
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.. |
Author: | sbs8331 [ December 20th, 2016, 3:14 pm ] |
Post subject: | Re: Change Text Size within Android App |
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). Thanks for the reply. I was thinking that I had seen it done a while back. Must have been dreaming. Merry Christmas.
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.. |
Author: | Jimking [ December 20th, 2016, 3:42 pm ] |
Post subject: | Re: Change Text Size within Android App |
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 |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |