manumaticx / circularprogress

Circular Progressbar Widget for Alloy
87 stars 19 forks source link

Its posible Text + Value? #29

Closed Geryy closed 6 years ago

Geryy commented 6 years ago

i want put Text + value. Photo exemple:

captura de pantalla 2017-09-26 a las 10 53 52

its all! thanks!

manumaticx commented 6 years ago

Hi, it should be possible with formatValue. Try something like this:

$.progress.formatValue = function(val){ return "custom text\n" + value; };

Let me know if this works out.

Geryy commented 6 years ago

I test it and.. yes, this work fine! Thanks @manumaticx and nice widget!

manumaticx commented 6 years ago

great! thank you <3

Geryy commented 6 years ago

Sorry for that but i have a last question. Now i want align the text, any solution?

manumaticx commented 6 years ago

Unfortunately you can't apply properties to the label through the widget API. I'll think about how to add this functionality.

To align the text, you have to change the widget code and set $.label.textAlign = Ti.UI.TEXT_ALIGNMENT_CENTER

Geryy commented 6 years ago

Ok thanks for all :D!

manumaticx commented 6 years ago

@Geryy hey, I've just added classes to view and label.

After updating the widget you should be able to style it without hacking the widget source.

". circularprogress_label": {
  textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER
}