When the layout content is embedded inside a decor layout
to emulate system bar (top or bottom) and title bar (or action bar)
then the code computing the full required size based on the RenderingMode
would fail because the decor layout would prevents the content layout to
take as much room as possible.
There is also an issue with the way we know render dialogs as the
dialogs usually as a frame with some padding and the previous measurements
would not take into account the dialog padding when increasing the
screen size.
This fix makes the code measure the size of the content layout in the
normal rendering, and then separately from the root layout with the proper
MeasureSpec to let the content grown. The difference in size is then added
to the screen size.
Bug: http://code.google.com/p/android/issues/detail?id=15892
Change-Id: Ibb9ca2a67c6c450d10d9f9a8050536e094650f8b
Commented out a Capability that is not in ADT 10.
BridgeTypedArray.getDimensionPixelSize shouldn't call
getDimension since most of the code is duplicated, and
it prevents use from properly detecting malformed attribute
values.
Change-Id: I005b17061590dc0668729af16e896fad815f1973
Also make TypedArray.getDimensionPixelSize properly
handle negative values (which are not allowed).
Change-Id: I960fc1c9e8ad97852d4a14e4f0f71a2c2034b4e7
- 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
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