Re: [android-developers] what are the restrictions on the declare-styleable name attribute? (Does it allow sub packages?)
declare-styleable is probably way simpler and dumber than you think. :)
It it is, is a way to give a list of resource names that something is interested in, so that aapt can generate an array of the resource IDs in the required sorted order to be passed to obtainStyledAttributes(). So for each set of attributes you want to retrieve with obtainStyledAttributes(), declare them with declare-styleable. They can be any you want.
--
Dianne Hackborn
Android framework engineer
hackbod@android.com
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.
-- On Tue, May 22, 2012 at 7:53 PM, Satya Komatineni <satya.komatineni@gmail.com> wrote:
what happens if I have two custom views
com.mycompany.projectname.CustomView
com.mycompany.projectname.subpkg.CustomView
How do I declare styleable resoruce for these classes? (of course I
can name them differently, but is that the only way?)
Here is an example
<resources>
<declare-styleable name="CustomView">
.....
</declare-styleable>
</resources>
would I then do for the second sub package custom view?
<resources>
<declare-styleable name="subpkg.CustomView">
.....
</declare-styleable>
</resources>
If so how does the constant
R.styleable.CustomView
look for the sub pakcage "subpkg.CustomView?"
I suppose I can try it and see but If one of you is kind enough to
throw some light
Thanks
http://satyakomatineni.com/android/training
http://satyakomatineni.com
http://androidbook.com
http://twitter.com/SatyaKomatineni
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Dianne Hackborn
Android framework engineer
hackbod@android.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home