[Q] Weather Condition Text on Multiple Lines? - Zooper Widget General

Hi
Is there any way to get the weather conditions to split each word onto multiple lines?
eg. "Partly Cloudy" to display as
Partly
Cloudy
I'm trying to get the text to display on a specific image that is in my background bitmap.
Any help is much appreciated.

Are you using Rich Text or regular?
Rich text give you the option. One of the guru's here might have a different idea.
Sent from my Nexus 5 using Tapatalk

I'm trying to use regular text, as I'm setting a rotation, which I don't think Rich Text can handle.

I've tried a few different things to get the text to split across multiple lines without any success, so thought I'd see how to do it using the rich text.
It's got me completely befuddled.
Could someone point me in the right direction as to how I might achieve the text split?
Also, I've seen a number of widgets with custom icons in them. How do you embed icons from an icon pack in a widget; if at all possible. I may be mistaking the widget creation for something to do with a theme creation.
Any help is appreciated.

CPAPerseus said:
Could someone point me in the right direction as to how I might achieve the text split?
.
Click to expand...
Click to collapse
If you are cannot use rich text that limits you severely, and I'm not sure it is possible with Zooper alone. You can use tasker to do this, however. this will require some research on your part, but you can do an HTTP Get action in tasker to retrieve the weather condition for your location, and then perform a variable split to produce two variables, one for the first word of the weather condition, and a second variable for the second word. You would then send these to Zooper using the #T...# format.
So it is possible if you cannot use Rich Text objects in Zooper, it just requires more work on that back end.

For me I can only get Rich Text to wrap onto multiple lines if it is near the edge of the screen.

Use rich text. Set two lines and keep on increasing x-margin till it shows as two lines. For example to get two lines to show on my widget my margin number is 520. Text on different areas of the screen requires different x-margin.

Related

[Q] Need help restricting text length, Margins in Rich Text aren't working

Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Zanthany said:
Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Click to expand...
Click to collapse
You should consider using the [tr]-tags to limit your field to a certain amount of characters. Usage example in your case would be
Code:
#C0SEEE dd - HH:mm# [tr=30]#C0TITLE#[/tr]
This would limit the output of the title to 30 characters and put three dots at the end to indicate the string is longer than what is displayed. You'll have to play around a bit to find the right limit for your particular setup though.
For future references, you can find all the available tags for Rich Text Modules here.
Hope this helps you out

[Q] 2 Questions about limiting the size of text in Zooper

I am making a spin-off of infobar, and I have it mostly working the want I want with two exceptions:
1) The weather string is usually fine, but in some cases it gets too large. Is there any way to get it to wrap to a specific bounding rectangle, or to shrink it if it gets past a certain length? Is there some way to test how long the string is? I don't want to use [tr], because I want to see the whole string.
2) Right now I am using [tr=0,25] to make sure the appointments don't overrun the box. I use [tr=0,25] instead of [tr=25] because I don't want the "..." for shorter strings. Is there some way to test the length of the string so I can only use the [tr] when I need to? That way I can get the "..." when it is appropriate. I tried using
$[tr=0,22]#C0TITLE#[tr]=#C0TITLE#?#C0TITLE#: [tr=22]#C0TITLE#[/tr]$
but the [tr=0,22]#C0TITLE#[tr]=#C0TITLE# always comes back as not equal.
Thanks.
mlkaufman said:
I am making a spin-off of infobar, and I have it mostly working the want I want with two exceptions:
1) The weather string is usually fine, but in some cases it gets too large. Is there any way to get it to wrap to a specific bounding rectangle, or to shrink it if it gets past a certain length? Is there some way to test how long the string is? I don't want to use [tr], because I want to see the whole string.
2) Right now I am using [tr=0,25] to make sure the appointments don't overrun the box. I use [tr=0,25] instead of [tr=25] because I don't want the "..." for shorter strings. Is there some way to test the length of the string so I can only use the [tr] when I need to? That way I can get the "..." when it is appropriate. I tried using
$[tr=0,22]#C0TITLE#[tr]=#C0TITLE#?#C0TITLE#: [tr=22]#C0TITLE#[/tr]$
but the [tr=0,22]#C0TITLE#[tr]=#C0TITLE# always comes back as not equal.
Thanks.
Click to expand...
Click to collapse
There is currently no way to test the length of a string in Zooper, sorry. As to the "wrap to a specific bounding rectangle", check out the X margin and Lines on a Rich Text Module The first defines the distance in pixels from the screen side when the text will break into additional lines. The second option sets into how many lines the text will break at maximum. Anything above that will be cut-off without an indicator like you get with the trim option. It's not exactly what you are looking for but I thought you might want another option to work with

[Q] Tasker to Change Font Color & Size for Missed Calls or New Messages?

I'm trying to use tasker to alter the font for some items. I have a popup widget that has email, gmail, sms, phone,etc. on it that I want to change font color and become bold when I have a missed call or new message. I've set up tasks and profiles for sms, and gmail so they will change color. I cannot seem to get them to become bold though. They are made as Rich Text if that matters. I can't figure out how to write the parameter where the [c][/c] and take effect together. Can somebody tell me how to write the advanced parameter to get this to work?
Also, I can't seem to figure out the code to use for email or phone. I've tried %COUNTEMAIL, %COUNTMSG, %MISSEDCALL but they don't seem to work. This is the tutorial I used for this: https://seo-michael.co.uk/change-text-colour-in-zooper-widget-with-tasker (sorry can't post a link yet). Can I make this work with the Email App and the Phone?
Thanks!
From what I've read you are trying to display a count rather than the actual text/phonecall details? In which case you would be better off using Zooper's built in variables #SMCALLS# for missed calls and so on. To change the colour of the font in rich text format you can use a conditional like this:
[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]
This will display missed call count in red when you have missed calls and green when you don't.
Then to change to bold for missed calls as well you can wrap the above in a conditional like this:
HTML:
$#SMCALLS#>0?[b]$[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]$#SMCALLS#>0?[/b]$
Hope this helps.
ps Sorry about the HTML tags but I don't know how to stop it from rendering the bold tags in the code instead of displaying them
Thanks. Are there built in variables for gmail, email, and sms? I'm trying that code but it doesn't seem to do anything on my phone...
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Torgadden said:
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Click to expand...
Click to collapse
I'm putting it into the advanced parameters because the manual text area is what is labeling the shortcut I have. It doesn't nothing when I enter it. I've written it, copy and pasted from the site, and still nothing. I can modify it and get the color I want to change but it will not turn bold.
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Torgadden said:
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Click to expand...
Click to collapse
Hmm ok. How do I write the paramater and still keep the text I have then? So for example, I have one line that says "gmail". Clicking the word opens gmail and when I have a new email it changes from white to green based on the #COUNTGMAIL task I have in Tasker. How do I write in the code in the manual field to keep the "gmail" and still make it change? I'll be playing with this shortly when I get a chance.
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Torgadden said:
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Click to expand...
Click to collapse
Thank you. That code works perfectly. If only I could get the zooper widget to update quicker.
So my next question is, do you have the parameter code for regular email? I know the #SUG# is gmail but I don't have the code for email, or phone, or sms. I think those are the only ones I need to do this. Although I would like to have the "music" line change color when poweramp is running....
If you go to edit text you will see the list of available fields. SMS counts, etc are under system. Looking at them I could have sworn that there was a regular email count but I can't see it now, you should be able to capture that in Tasked and pass it to zooper as a variable though.
As for the media, use Media Utilities to get the player state. It gives you a whole set of variables which will let you work with media states in Zooper

[Q] tasker bbcode color/size variables not updating

hello, i am relatively new to zooper, but I'm pretty good with tasker.
I'm creating a basic notification widget, and i have it sending and updating the notification numbers just fine, but I am lazy and i don't wan't to have to copypasta the color codes/font sizes 12 times whenever i change my mind (frequently).
I have a tasker widget called" Zooper Widget Vars" pushing these commands (via the Zooper Widget Pro Variable plugin) (brackets are obviously not in the code)
configuration #TZFLG# = 50 (large size for icons)
configuration #TZFSM# = 10 (small size for numbers)
configuration #TZFLGC# = #ffffffff (color for icons)
configuration #TZFSMC# = #ff66d5da (color for numbers)
And i just press play whenever i want to send the variables to Zooper.
in zooper, in a rich text module, I have:
[s=#TZFSM#][c=#TZFSMC#]#TWHATSAPPCT#[/c][/s]
and in another Rich text module I have:
[s=#TZFLG#][c=#TZFLGC#]f[/c][/s]
#TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC#
#TWHATSAPPCT# updates just fine. Problem is, #TZFSM# and #TZFSMC# do not update the widget until #TWHATSAPPCT# changes. #TZFLG# and #TZLGC# do not change at all unless I manually change the letter icon and change it back, which is, quite frankly, a pain in the ass.
I have tried just sticking #TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC# in an RT module without the BBcode around them, and their values do print out, so I know that Zooper is actually receiving them, but its just ignoring them when they are enclosed in BBtags.
In layman's terms, the widget will not redraw with the new color and size parameters unless the content that the bbcode is modifying changes. Ive spent about 2 hours youtubing and googleing and wiki-ing, and I've decided I'm a noob and should just ask for help.
thank you so much in advance for any assistance.
(Nexus 5 with the lollipop dev preview installed)
P.S. though I think that ZW Utilities is a lovely little tool, it does not solve the lack of size updates, so please do not direct me there.
digitalgraffiti said:
hello, i am relatively new to zooper, but I'm pretty good with tasker.
I'm creating a basic notification widget, and i have it sending and updating the notification numbers just fine, but I am lazy and i don't wan't to have to copypasta the color codes/font sizes 12 times whenever i change my mind (frequently).
I have a tasker widget called" Zooper Widget Vars" pushing these commands (via the Zooper Widget Pro Variable plugin) (brackets are obviously not in the code)
configuration #TZFLG# = 50 (large size for icons)
configuration #TZFSM# = 10 (small size for numbers)
configuration #TZFLGC# = #ffffffff (color for icons)
configuration #TZFSMC# = #ff66d5da (color for numbers)
And i just press play whenever i want to send the variables to Zooper.
in zooper, in a rich text module, I have:
[s=#TZFSM#][c=#TZFSMC#]#TWHATSAPPCT#[/c][/s]
and in another Rich text module I have:
[s=#TZFLG#][c=#TZFLGC#]f[/c][/s]
#TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC#
#TWHATSAPPCT# updates just fine. Problem is, #TZFSM# and #TZFSMC# do not update the widget until #TWHATSAPPCT# changes. #TZFLG# and #TZLGC# do not change at all unless I manually change the letter icon and change it back, which is, quite frankly, a pain in the ass.
I have tried just sticking #TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC# in an RT module without the BBcode around them, and their values do print out, so I know that Zooper is actually receiving them, but its just ignoring them when they are enclosed in BBtags.
In layman's terms, the widget will not redraw with the new color and size parameters unless the content that the bbcode is modifying changes. Ive spent about 2 hours youtubing and googleing and wiki-ing, and I've decided I'm a noob and should just ask for help.
thank you so much in advance for any assistance.
(Nexus 5 with the lollipop dev preview installed)
P.S. though I think that ZW Utilities is a lovely little tool, it does not solve the lack of size updates, so please do not direct me there.
Click to expand...
Click to collapse
Instead of entering the bbcode in the text field with the text did you try separating it out and entering it in the advanced parameters field.
jr67 said:
Instead of entering the bbcode in the text field with the text did you try separating it out and entering it in the advanced parameters field.
Click to expand...
Click to collapse
in the end i figured it out with putting all of the styling in the advanced params space and the content in the text area
thanks for your help!

How to force line break?

I am trying a new weather widget that provides weather conditions in text form. Occasionally the text it too long to fit on one line so I need to be able to force a line break in the incoming text. How do I do that?
Thanks in advance.
DerrikMo
Wrong thread
Mokum020 said:
How about something like this in a Rich Text module:
Code:
[tr=0,4]#WCCOND#[/tr]
[tr=4,20]#WCCOND# [/tr]
I don't know at wich letter you want the line break so my example is after the fourth letter.
On the first line the first four letters will be shown and on the second line (cropped) from the fifth to the twentieth letter.
You need some empty spaces (and calculate them yourself as after which letter you want the line break) in the second line because otherwise Zooper will show the text if it becomes the same or smaller as the crop start point.
Click to expand...
Click to collapse
Very crafty. And yes line breaks seem only to be avaialable in Rich Text, and to truncate/substring is good to shorten a line (and sometimes it adds the dots "...") but, both together is a cool way to do it!
Wrong thread
Mokum020 said:
How about something like this in a Rich Text module:
Code:
[tr=0,4]#WCCOND#[/tr]
[tr=4,20]#WCCOND# [/tr]
I don't know at wich letter you want the line break so my example is after the fourth letter.
On the first line the first four letters will be shown and on the second line (cropped) from the fifth to the twentieth letter.
You need some empty spaces (and calculate them yourself as after which letter you want the line break) in the second line because otherwise Zooper will show the text if it becomes the same or smaller as the crop start point.
Click to expand...
Click to collapse
Thanks for the help. I wasn't able to use the solution however, because the length of the text that I want on the 1st line is always variable. The second portion of the text comes from a different feed, so I just decided to make a different field and put that field below the 1st. But your suggestion did come in handy on a different portion of the widget. I will keep your suggestion in my stash of Zooper tricks.
Thanks again,
DerrikMo
Wrong thread

Categories

Resources