Did I miss something? If the styles in question are private, and I make a copy, and they change in the future, have I not lost the point of extension?
Say I wish to extend android:WindowTitle. >From the source @ http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD it has four properties. I want the default platform look & feel, but wish to tweak say the shadowColor, but wish to retain the other property settings from the default. >From what I understand, currently, I need to make a copy from Android source, and embed that in my application. When another aapt is released and the property shadowRadius is changed, for example, how do I "inherit" that? With this current solution I believe I have to detect these changes manually, and then update all the copies of any private styles I copied. I just want to extend what is the default, tweak some one property, and then remain in sync with the default, regardless of what other property values change or are added. On Jul 28, 3:48 pm, Xavier Ducrohet <[email protected]> wrote: > hello everyone, > > I just commented on the bug but I'll copy-paste it here too. > > Short version: this is working as intended (and has it should always have > been). > > What is happening is that some styles, like WindowTitle are not public > (you won't find them in android.R.style). You should not be extending > non public resources. aapt used to let you do that but it was a bug > which was fixed in platform-tools r6. > > The issue is that once compiled, resources are assigned an integer. In > this case your custom style is assigned an integer and its parent is > referenced through the parent integer. > > For the framework, only public resources are guaranteed to only have > the same integer, build after build. The integer of private resources > integer will change from build to build. > > This means that your custom style is referencing a parent that *will > not* be valid once installed on a device. It'll referenced either > another resources or none at all, and it won't do what you want. > > If you wish to reuse a style that is private, you should copy the > content of that style into your own instead of extending it. > > Reverting to an older aapt that lets you do this is basically similar > to using a private Java API. > > Our stance on this has been clear since 1.0: Don't do it. It may be > convenient for a bit, but it'll break on devices, all of them in this > case too, and it's not good for anyone. > > xav > -- > Xavier Ducrohet > Android SDK Tech Lead > Google Inc.http://developer.android.com|http://tools.android.com > > Please do not send me questions directly. Thanks! -- 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

