Hi

I'm developing an app and I need to changed between full size labels on
the tablets and other larger screened devices, and abbreviations for
those of a smaller screens size or when the user's language has long
names for the English equivalents.

So I created a custom attribute for my custom view (attrs.xml):
        <?xml version="1.0" encoding="utf-8"?>
        <resources>
            <declare-styleable name="SchemeView">
                <attr name="useAbbreviations" format="boolean"/>
            </declare-styleable>
        </resources>

In my layout file I referenced a style:

    <org.dobbo.colour.view.SchemeView
            android:id="@+id/schemeView"
            style="@style/SchemeViewStyle"/>

And created the appropriate styles (values-small/styles.xml show):
<?xml version="1.0" encoding="utf-8"?>
        <resources
                xmlns:dobbo="http://schemas.android.com/apk/res-auto";>

            <style name="SchemeViewStyle">
                <!--item name="dobbo:useAbbreviations">true</item-->
            </style>
        </resources>

However when compiling a get the following error:

.../values-small/styles.xml
  Error:(6, 21) No resource found that matches the given
        name: attr 'dobbo:useAbbreviations'.
  Error:(6, 21) Execution failed for task
        ':ColorWheel:processDebugResources'.
    > com.android.ide.common.internal.LoggedErrorException:
        Failed to run command:
        ...
  Error Code:
        1
  Output:
        .../build/res/all/debug/values-small/values.xml:8: error:
  Error: No resource found that matches the given
        name: attr 'dobbo:useAbbreviations'.

Have I missed something, or are custom styled not supported?  If I've
missed something can you please point me at the documentation that
defines it?  If they are not yet supported when will they?

As always thanks for any help and your time
Steve

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to