I need to use the following resources in my widget:
I hope that usage of these resources will allow me to have orange background on standard android and green on HTC.
But they are not public, so usage of
android:drawable="@android:drawable/pressed_application_background_static"
is not allowed. Is still there any way to use them?
Resource Manager is a tool window for importing, creating, managing, and using resources in your app. You can open the tool window by selecting View > Tool Windows > Resource Manager from the menu bar or by selecting Resource Manager on the left side bar. Click Add to add a new resource to your project.
Externalizing your resources also allows you to provide alternative resources that support specific device configurations such as different languages or screen sizes, which becomes increasingly important as more Android-powered devices become available with different configurations.
If no matching resource is available, the system uses the default resource and scales it up or down as needed to match the current screen size and density The "default" resources are those that are not tagged with a configuration qualifier. For example, the resources in drawable/ are the default drawable resources.
You can reference them like this
android:drawable="@*android:drawable/pressed_application_background_static"
but it is not recommended, because private resources are likely to be renamed or removed in the future.
browse the sdk for the drawable and copy it locally to you res/drawable folder. it will probably be an XML file but if you search for "pressed_application_background_static" you should find it without trouble.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With