Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to create a custom class that utilizes API-specific XML tags?
    primarykey
    data
    text
    <p>I am attempting to create a drawable in xml using a <code>Drawable</code> subclass (in this case <a href="http://developer.android.com/reference/android/graphics/drawable/LayerDrawable.html" rel="nofollow"><code>LayerDrawable</code></a>) to use as a background in a <code>View</code>, but the drawable does not calculate and display its layers the way I had intended. With help from this forum I have found the particular lines of source code that are causing my issue and feel I can very easily create a subclass or change the code or to do what I want.</p> <p>My question is, assuming I make a new class with no unintended side-effects and I will never need access the old functionality, is it possible to use the new <code>Drawable</code> with the <a href="http://developer.android.com/guide/topics/resources/drawable-resource.html" rel="nofollow">original <code>Drawable</code>'s xml tag structure</a> (ex. <code>layer-list</code>) to create my updated drawable in the same way?</p> <p>For example, replace:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/resource_name" android:drawable=drawable/drawable_resource" /&gt; &lt;/layer-list&gt; </code></pre> <p>with this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;package.MyLayerDrawable xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/resource_name" android:drawable=drawable/drawable_resource" /&gt; &lt;/package.MyLayerDrawable&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload