- implement some Paint methods that are needed for 2.x
- fix the phone system bar to display the icons on the right.
Change-Id: I3a938b14ec9a449dbc23a33303a3c8405a5369a8
When an object is given a delegate to hold onto, keep
the reference to the delegate instead of its native integer.
Also change the way the finalizer works by not explicitely deleting
the delegate. Instead we want the delegate to be deleted when
nothing holds a reference to it. To do this, instead of using
a regular SparseArray, we use a SparseArray of WeakReferences.
Because the main Java object that "owns" the delegate does not
actually holds a reference to the delegate, we fake this by
having the delegate manager hold a reference to delegates for
the main object. This is added/removed as the object is created
and the native finalized is called.
This makes layoutlib behave more like the JNI code where the native
objects are reference counted, and where the Java object can be
deleted but the delegate it owns is kept around (usually because
another type of delegates hold a reference on it.)
To properly handle the WeakReferences, we need to be able to
regularly clear the SparseArray of WeakReference that were
referencing objects that have been GC'ed.
Since the SparseArray is regularly being compacted (actually only
when items are removed), we use a custom SparseWeakArray (started
as a straight copy of SparseArray) that handles the WeakReference
and takes care of compacting the array by removing deleted indices
and WeakReference that returns null. Since our specific use case
doesn't call actually delete() or remove(), the compacting
only happens when the array needs to be resized.
Change-Id: Iacc5c1ff5b21732b8816fda87eb090da12d034e0
Some parser consumers (seems to be mostly resource inflation)
don't use the pull parser up to the END_DOCUMENT tag, making
the parser not pop itself from the parser stack automatically.
This is likely due to the XML resources being very shallow (1-2 levels
max), and the inflater just reading the content that it expects instead
of parsing till the document is done.
This ensures that *some* parsers are pop'ed from the stack when
used. Some other parsers we don't really control and hope the
user will parse till END_DOCUMENT.
Change-Id: Ie1f5762983fed2b2ae97b896218ae12b493e7ad9
Every method implementing a delegate needed by the
layoutlib_create bytecode modification must now be
annotated with LayoutlibDelegate.
The methods in the original source code that are delegated
are already automatically annotated. Now with the implementations
being annotated we can do bi-directional tests and find not
only missing implementations but also dead obsolete code.
This will be useful when backporting to earlier versions of
Android, or when native (non public) method disappear. In fact,
the new test detected one such method in Shader.
Change-Id: I491708b68ac2736ca5669aa86cd5e930a00f9db3
The bars are supposed to sit on top of the window so
that if they are transparent (which is the default case
for the action bar), the window background shows through.
Fix this using a layout to represent the window content
(all but the system bar) in which the title/action bars
and the layout content sits. This layout receives the
windowBackground drawable.
Change-Id: I8072c5ff52f585fa32acb589d8526e1c13cbcd94
When generating delegates, LayoutLib.Create support renaming
inner classes. Only one level of inner class is supported.
The method Outer$Inner#get(...) generates a call to:
static Outer_Inner_Delegate#get(Outer instance, Outer$Inner instance, ...)
Change-Id: Ie70f2b8e5e5f311ed9c7f26b7f64637ae6157a51
Also display placeholders for status/title/action bars depending
on if the app is a tablet and its theme.
Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
This fix the issue where going from a full theme to a dialog theme
would show the dialog on top of the previous rendering.
Change-Id: Ib52b9719f44b04969423547b9de8d039f90b6f46
android.os.Build is now initialized from the build properties
parsed from the SDK build.prop file.
Change-Id: If16953215ca90fb0beacb51bf405b89a5c8a34fa
All items directly under the <merge> tag now return the view cookie
of the referencing <include> tag using a special class for
easy differentiation in the calling client.
Change-Id: I7a2a4e642be9564f47e256fd1586012497d34792
1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself. (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)
2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.
Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
Replace the code which throws an exception if there are no children in
the FrameLayout that is the tabcontent, with code to add a single
dummy tab.
This makes the TabHost renderable in those scenarios where the real
tabs are added dynamically rather than via XML.
Change-Id: I72442bd7d40eddd875b3507585c1f372fcae3329
This enables the system bar to carve out a region through which
events will be sent to the IME behind it.
Bug: 3238092
Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
Next step is to make it a jar that will also live in
ADT.
The version in layoutlib will be through a prebuilt jar
file, like ninepatch.
Also add ninepatch.jar inside the layoutlib.jar file.
Change-Id: I4a0cc9f2dd99709de6408386054c6d4abae7c824
- Fix resource resolution for framework
resources of type "id" that are dynamically generated
through "@+id/..."
- Proper implementation of setBitmap on a canvas that
already has a bitmap. Transform/clip are kepts but the
existing layers are replaced with the new bitmap
- return a null service for INPUT_METHOD_SERVICE in
Context.getSystemService
Change-Id: I35e46fff50e6492a8995e95427d5f38bc945429d