Using resource values as layout attributes (config.xml)

Posted by synic on Stack Overflow See other posts from Stack Overflow or by synic
Published on 2010-03-28T00:59:56Z Indexed on 2010/03/28 1:23 UTC
Read the original article Hit count: 335

Filed under:

Looking in the android sdk folders, I've found a file called values/config.xml. This seems to be somewhere that you can define values for later use in layouts and animations.

Given the config.xml:

<resources>
    <string name="config_somePadding">50dip</string>
</resources>

How would I reference this to use as the layout_height in a layout xml file?

@string/config_somePadding is actually the only one I've found that doesn't throw an error in Eclipse (even though there isn't a config_somePadding in values/strings.xml), but it appears to just put an empty string.

In the sdk, they use an integer for animation duration. They reference it like this: android:duration="@android:integer/config_longAnimTime". Is there a way to use values that aren't integers in the layout_height attribute?

© Stack Overflow or respective owner

Related posts about android