Oh also you can just do a percentage dimension ("50%") and retrieve it with
a base value of 1 or 100 as desired.On Wed, Dec 22, 2010 at 5:40 PM, Dianne Hackborn <[email protected]>wrote: > You can use them as attributes, but unfortunately right now there is no way > to get them as direct resources. > > Well you can probably do it by being tricky -- use <item> to define a raw > resource, and Resources.getValue() to retrieve its value. > > (One reason why this doesn't exist is if it made entries in R. for float > values it would create code that can't compile since "float" is a keyboard. > :p I solved that with ints by calling them integers, and booleans by > calling them bools, but we never really needed floats so I never tried to > come up with something to call them.) > > > On Wed, Dec 22, 2010 at 5:04 PM, Zsolt Vasvari <[email protected]> wrote: > >> Am I missing something or there is no mechanism to define a float >> value as a resource? >> >> I am trying to have a locale dependent weight added to some of my >> buttons. Right now, as a workaround, I am defining the weight as an >> Integer and then divide and manualy set it. But why would there be >> such a seemingly arbitrary decision made as not to allow floats but >> allow ints? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<android-developers%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

