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

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

Related

Hide input panels with setting configuration?

Is there a way to hide certain input panels on the window form using configuration or config file of some sort?
For example.... let's say in my database I have items with 12 possible fields in each (Name, LastName, Age, Occupation, Location.......etc).
But what is a user of application only wants to fill in 3 fields every single time (for example - LastName, Age, Location)? Leaving others in place when user doesn't needs them is an extra clutter. So how can I hide or disable those input panels based on user's preference on which fields he wants to use?
--
I think I found a way to hide items by setting Visible boolean.
Code:
this.txtName.Visible = false;
this.lblName.Visible = false;
this.txtOccupation.Visible = false;
this.lblOccupation.Visible = false;
However, how can I move up other fields between or below them? Currently hiding just creates empty spaces.
You can turn the textbox off completely by setting its enabled property to false.
You can then move other textboxes and labels over it by setting their Location.X and Location.Y properties.
You will have to keep track of where everything is on the screen, and what is enabled and what isn't.
stephj said:
You can turn the textbox off completely by setting its enabled property to false.
You can then move other textboxes and labels over it by setting their Location.X and Location.Y properties.
You will have to keep track of where everything is on the screen, and what is enabled and what isn't.
Click to expand...
Click to collapse
Thanks.
Do you know if there is an easy way to move everything up? (lets say I make first item invisible and want to move the 10 items below up) Or will I have to call everyone individually to move up?
Also.. Is there away how I can use TabIndex to call those forms?
There are others ways to accomplish what you are looking for, but no easy route to it.
They all end up as broad as long. You either spend time during the design stage, creating an array of possible tabbed forms to be used by the program later, or spend time designing the program to deal dynamically with the fields required. The latter of the two is harder to do, but it is far more elegant.
Sorry, but there is no silver bullet.

Fragment vs Activity

Hey Guys,
I am thinking of an app where the screen has 2 parts. I am thinking of using fragments for this.
However here is my question:
In the first screen/activity I am asking a user to click something on the bottom half based on the question in the top half. Once the answer is correct the user goes to the next set of questions.
Example:
The first screen can have 2 half, on top pick colour black,and the bottom has 4 or 5 different colors. Once the user clicks black, I want the user to see the next question, Maybe, Pick color Red and so on and so forth.
My questions is should I be having one main activity and different fragments based on number of questions that I want to ask?
Also can I make a generic template for a fragment and use an array list to populate the contents of the fragements ?
Thanks
I would put all of them into one Activity, no Fragments are needed. Indeed, the app should be faster without Fragments.
For another question just change the text/color of the View at the bottom.
Your question cannot have a specific answer
If you could make a template (base) actvitity for all possible answers at the bottom part of the screen, why not adding the top part also
and make one template activity without fragments?
But i have a feeling that your app will benefit from fragments if you cant make the template above.
If all your answers are not so similar in UI or logic (for example colors, geometric drawings, ... songs played) then you need to
a) build on base answer activity used to communicate with the question activity (passing data etc)
b) build some ancestor activities for all possible answer types, and finally
c) populate an array of activity "types" (from ) and their parameters to load on the bottom fragment when needed
so you pick the next from the array.. make an instance of the activity based on its base class, pass the parameters and pass it on the fragment

[Q] Weather Condition Text on Multiple Lines?

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.

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

Append variable width bitmaps dynamically so that resultant bitmap row is centered

I'm pretty sure what I'm trying to do is impossible with Zooper — I've experimented and searched massively — but maybe some wiz actually will know a workaround to what I'm trying to do:
I want to have a widget — which will place let's say two bitmaps side by side: they will be selected dynamically and their widths vary massively. I want the resultant “image”, consisting of the two images, centered: thus I can't put one left—aligned image next to one right—aligned, because the whole thing will not be centered.
I hoped the image field would let me specify two consecutive “” fields and I could nicely center this compound object — but it doesn't work, only displays the first image.
Is there a way to accomplish what I'm after, or is it truly impossible?
--
白い熊

Categories

Resources