This allows ViewConfiguration to be properly implemented which is now
required for the rendering to happen.
Change-Id: I55629689fa8f5f874b43fcac2aa0789ce02d58f4
fe051bb2 : Change the way the layoutlib instantiate its XmlPullParser.
A lot of the init code was duplicated so I made a ParserFactory class.
Also created an extension of the KXmlPullParser to override toString().
This allows easier debugging when dealing with multiple parsers (which
is always the case).
Also added some (disabled) debugging printf to deal with parser stack
as it can be tricky figuring out which parsers are in the stack at
which point.
8969147c : Fix case where the int[] attrs doesn't directly match a styleable.
In the case of the FastScroller the int[] is a custom mix of attr
instead of a int[] that exists as R.styleable.foo.
This makes our reflection based mechanism used to find the styleable
fail, so instead we search for each attribute separately (like
we probably should have done from the beginning).
0c264b35: Fix various cases of getDimension to report error if unit is missing.
if getDimention###() is called for a string that has no unit,
then an error is output through LayoutLog, but the rendering keeps
going by using dp as a default.
0beb7eea: Make (Bridge)TypedArray.getInteger() call out to getInt()
Only getInt() resolved attribute flags/enum and I'm not sure why
there's two to begin with.
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
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
Move away from using our own implementation of NinePatchDrawable.
Now use native delegate for a few methods of NinePatch.
The byte[] used to describe the 9-patch chunk is entirely controlled
by the delegate. Therefore, while the default version (JNI) use the
array as a representation of a C struct, this version uses the array
as a serialized version of NinePatchChunk.
A cache mechanism using SoftReferences allows us to not deserialize
the array every time rendering needs to access the chunk itself.
The Bridge-level cache mechanism for bitmaps and nine-patches as
changed. Since the new nine-patches doesn't hold the bitmap
data anymore (it's stored in a normal Android bitmap which
is cached itself through the cache), then the nine-patch cache
has been changed to only contain the nine patch chunk.
Also initialize the canvas with the display metrics to prepare
for correct scaling when density of the assets don't match the target
density.
Still to come: actual density support in the 9-patch drawing code.
Change-Id: Ibefcccf4432e1986e8436e0c41a0107741593536
Since the new API prepare for stateful layoutlib, major
reorganization of the code.
New "android" sub-package for all extended android classes.
Also moved BridgeInflater in here so that all extended classes
are in this package. Only delegates and classes replacing
renamed classes are in their original android.* packages.
Also created full file for the empty implementations of
IWindow and IWindowSession.
New "impl" for the dirty work implementation.
Main package contains the basic implementation of the API.
Most of the code that was in Bridge is now in .impl.LayoutSceneImpl,
with the main init/inflate/render code split into the contrustrutor,
inflate() and render().
Change-Id: Ie15b15e5a1b2388cd6ef82e518345b1fc02ec981
Also fix native delegate generation to put "this" parameter even
for methods that don't have any parameters.
Change-Id: I5dd0c505871370ff7b4cda16de84a5b3ae438f73
This does not implement all the native methods of the
android.graphics.Bitmap class, only what's needed to draw an
ImageView object. The rest will be implemented after Canvas and
Paint have been moved to the native delegate.
Change-Id: Ia0c3b2cafa03871c298deaef5817a25ac1c35521
Instead of renaming the old Matrix class into _Original_Matrix
and have layoutlib provide a full new implementation of Matrix,
we keep the old one by only modifying it to implement the native
methods which calls out to a new Matrix_Delegate class.
The goal is to not have to maintain the java portion in
sync between the framework and the layoutlib version.
Change-Id: I3e1aefffbae45e91b75331c0c6ff2260323deacd
- Move test files to their own package for easy binary inclusion
in adt-test
- fix some tests and remove obsolete ones.
Change-Id: I5b967f29074fdad74073f9b37d903eabe8dc29e6