5,597,138 Members 45,234 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Zanthany
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Dec 2013
Default [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?
 
kwerdenker
Old
#2  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1527
Posts: 1,227
Join Date: Apr 2010
Location: Probably the Zooper Forums
Quote:
Originally Posted by Zanthany View Post
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?
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
Mobile: LG Nexus 4 | ROM: Paranoid Android 4.0 + Xposed | Kernel: faux Kernel
Tablet: Asus Nexus 7 (2013) | ROM: Paranoid Android 3+ | Kernel: faux Kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes