summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Layoutlib: Animation support.Xavier Ducrohet2010-11-2910-78/+647
| | | | | | | | | | | | | | | | | | | | | | | | | | New locking mechanims to prevent concurrent renderings. There's now a thread specific prepareThread() method (only prepares the looper) and its associated cleanupThread(). For the rendering itself, acquire must be called before doing any type of Android specific work on the scene (inflate or rendering) After instantiation, init() must be called, which also acts as acquire. Added a lot of checks to make sure method aren't called without acquire or if scenes try to be rendered while acquire was called from the same thread but on another scene. Animation implementation: - Handler delegate to use our own queue (since the animation runs through handler messages). This uses a callback to process the message. This callback is per-thread and only used in animation threads. - SystemClock delegate to provide clock implementation. - AnimationThread to handle playing the animation and calling back to the animation listener. Change-Id: Ia39aba7ed476759df1da3200e413fe3e92590d15
* Merge "Fix build on Linux due to different strrchr prototype."Jeff Brown2010-11-231-1/+1
|\
| * Fix build on Linux due to different strrchr prototype.Jeff Brown2010-11-231-1/+1
| | | | | | | | | | | | | | It seems Linux host build has a fancy strrchr overload that preserves constness. That's nice but it broke this. Change-Id: I3c9b57b9ce9abc5d334d1e7b2498a3248bd20a6a
* | Merge "Port Emulator keymaps."Jeff Brown2010-11-232-0/+144
|\ \ | |/
| * Port Emulator keymaps.Jeff Brown2010-11-232-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also added a validation tool for keymaps (not currently integrated into the build system but getting there). This change brings back Android.mk with the intent that it will be used to validate keymaps in a later change. Added some missing keys that are present on phones. Bug: 3215210 Bug: 3225421 Change-Id: Id817c6e2215164616942c51a42752915d9ceacd3
* | Layoutlib: use default nine patch classes.Xavier Ducrohet2010-11-2310-166/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add knowledge of mipmap to aaptKenny Root2010-11-224-25/+60
|/ | | | | | | New mipmap drawable type that does not get filtered according to configuration. Useful for things that get built as part of the system. Change-Id: I556033d065e504079271dce79c23c90d3c387ce4
* Layoutlib: support for editing embedded layouts.Xavier Ducrohet2010-11-195-18/+130
| | | | | | | | | When Resources.getLayout(int) is called to return a parser for an embedded layout, this queries the current parser for a custom parser (Eclipse will provide one on top of the current XML model being edited) Change-Id: Ia9e837358f67daed0a835e1b3f4f50c0516ceee9
* LayoutLib: use the new expand API.Xavier Ducrohet2010-11-191-9/+20
| | | | Change-Id: I248de70ebe97aa6fb1cbcb5b6572a4a46c5ca1ba
* LayoutLib: fix some testsXavier Ducrohet2010-11-192-3/+7
| | | | Change-Id: Iacd641e2fac663ff12fe2a08ba093c4eaa2e8862
* Layoutlib: support viewkey in include nodes.Xavier Ducrohet2010-11-183-44/+69
| | | | | | | | | | | | | | | | | When an include tag is parsed, the custom bridge code never has access to both parsers at the same time. The child parser is created out of an in (representing the layout id), and the code inflating the content of the include layout doesn't see the parent parser either. This changeset adds a parser stack in the BridgeContext in order to allow access to the parent parser when setting the viewkey. This is only used if the current parser depth is 1 (top node), as we only want to set the include node to the top node of the included layout. Change-Id: I2ac3b72a0c84a269d9019f44f98cbc0b615ab959
* Layoutlib: use int[] wrapper to use as map keys.Xavier Ducrohet2010-11-181-3/+43
| | | | | | | | | | | | | | | | | This fixes the SlidingDrawer that failed to load. For some reason, in case of the SlidingDrawer, when the constructor uses android.R.styleable.SlidingDrawer it's the same values but not the same instance as the array read from android.R through reflection. So what works for all other widgets, and has worked since the very first layoutlib isn't working anymore, and we'll now have to use a wrapper similarly to what we use in ADT in the project callback. We should probably provide a single int[] wrapper class in layoutlib API for all to use. Change-Id: I4d7d038540f8a24541a588696f1059a020b589e5
* Layoutlib: Properly dispose of bitmap delegate.Xavier Ducrohet2010-11-183-91/+16
| | | | | | | | | | | | | This is done by initializing the android.util.Finalizers that's reponsible for calling out to the native bitmap destructor. Also implemented the native bitmap destructor Also fix Bridge by removing obsolete API methods, and removing some unneeded synchronized blocks now that the whole rendering (and scene creation) is protected by a synchronized on the bridge object anyway. Change-Id: Ie1792da6db354836542dfc11f457fe4a6d78ddfb
* Layoutlib: support XML based ColorStateList.Xavier Ducrohet2010-11-171-7/+34
| | | | | | This fixes the rendering of the TabHost in Eclipse. Change-Id: I333c4d65b18df76871e24a04f0a888ae42ba40ef
* Layoutlib: Fix alpha support in Canvas/Paint.Xavier Ducrohet2010-11-122-42/+21
| | | | Change-Id: I359098cfc542a7a0b7d99478c0eb13587b4439d0
* Layoutlib: Fill the default prop value map for View objects.Xavier Ducrohet2010-11-123-28/+33
| | | | Change-Id: I35426ced17a10eb092fac2153276f1202692876f
* Fix fill color alpha in layoutlibTor Norbye2010-11-111-1/+1
| | | | | | | | | | | | new Color(int) ignores the upper 8 bits - it creates a color without an alpha channel. In order to pass in rgba we have to use a different constructor, new Color(int,true). (In the layout library API we should also specify that the custom color, if specified, needs to include an alpha, or in particular add in 0xFF<<24 if the color is opaque.) Change-Id: I1c44caed8a5780e61b1c799f3b45bef3eb7bc97b
* Misc fix in layoutlib bridge + View.isIneditMode as delegate.Xavier Ducrohet2010-11-118-34/+56
| | | | Change-Id: Ideab29167e933203da99d4270cebcb777726201f
* Layoutlib: New bridge implementation using the new API 5.Xavier Ducrohet2010-11-1140-1098/+1326
| | | | | | | | | | | | | | | | | | | | 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
* Layoutlib: Load fragmentsXavier Ducrohet2010-11-085-8/+135
| | | | | | | | | | | | | This change does the following: - Make the bridge context extend Activity instead of Context so that it can act as a view factory. This is needed because the Activity is used as factory for Fragment objects. - Override the default Fragment.instantiate(...) method through a delegate. This is done to load the Fragment classes located in the project (similar to custom views). Change-Id: If62e7c9ff2b7585677077ad825aa1c3591d1b5e0
* Layoutlib: more text drawing.Xavier Ducrohet2010-11-082-11/+9
| | | | Change-Id: I32f46d23e746b095be0577a53b61567a868f0b8a
* am 3442611e: am 5580e44c: Merge "Support changing style parent in overlays"Jean-Baptiste Queru2010-11-061-14/+0
|\ | | | | | | | | * commit '3442611ee11b2987c83054fe3c7ed5521f27f052': Support changing style parent in overlays
| * am 5580e44c: Merge "Support changing style parent in overlays"Jean-Baptiste Queru2010-11-051-14/+0
| |\ | | | | | | | | | | | | * commit '5580e44c250944f5cd011b2682eea5cc2de9706c': Support changing style parent in overlays
| | * Merge "Support changing style parent in overlays"Jean-Baptiste Queru2010-11-041-14/+0
| | |\
| | | * Support changing style parent in overlaysMartin Nordholts2010-08-171-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package overlays makes it possible for vendors to tweak the look of the platform and the applications without touching any platform or application code directly. This makes package overlays an important mechanism in the Android build system. There is currently a limitation that forbids changing the parent of a style. If vendors could change the parent of e.g. ‘CalendarTheme’ from Android’s vanilla ‘Theme’ to ‘VendorTheme’, then vendor specific adjustments could be done without changing any code directly. From looking at the code it can be seen that the parent value of a style is stored temporarily in ResourceTable::Entry::mParent while overlays are gone through in buildResources(), and processed (in ResourceTable::Entry::assignResourceIds()) at first after all overlays have been handled, so there aren’t any obvious reasons why changing parent in an overlay should be forbidden. Change-Id: I5969bb8aab90df437e1967fc504cc0da79107d13
* | | | am 4da6efc8: am 46151652: Merge "fix xlarge support in aapt for gingerbread" ↵Scott Main2010-11-061-2/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | into gingerbread * commit '4da6efc8a3ecfcf46a8988ad1d277ae00ed1f58c': fix xlarge support in aapt for gingerbread
| * | | am 46151652: Merge "fix xlarge support in aapt for gingerbread" into gingerbreadScott Main2010-11-051-2/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * commit '46151652b8dc562f4a3332e1d12fa799e3638ea8': fix xlarge support in aapt for gingerbread
| | * | | fix xlarge support in aapt for gingerbreadScott Main2010-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I4d8872fb839a6eadc538055215d4455af328846c
* | | | | Layoutlib native delegate: FloatMath.Xavier Ducrohet2010-11-032-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the difference is pretty minor since it's a small class, the point is that the unit test will ensure that we detect new methods added to FloatMath more easily. Change-Id: Ia8bfee231cc4ae0cfeb18692be86d02649c187d5
* | | | | Layoutlib native delegate: path effects and xfermode.Xavier Ducrohet2010-11-038-131/+304
| | | | | | | | | | | | | | | | | | | | Change-Id: Iafaac6dbaf452e2dba3e77c801089dad33ac4ea9
* | | | | Layoutlib native delegate: primitive shapes and shadersXavier Ducrohet2010-11-0312-348/+524
| | | | | | | | | | | | | | | | | | | | Change-Id: Id2b0c6231589e82d8e96c9f019042eba348a6583
* | | | | More layout Canvas/Paint implementation.Xavier Ducrohet2010-11-012-36/+161
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib3da4a4b2259dc7c53b24444b5c0b78cee15d387
* | | | | More implementation of the layoutlib Paint/Canvas delegates.Xavier Ducrohet2010-11-013-127/+720
| | | | | | | | | | | | | | | | | | | | Change-Id: I0c0029b9a679af4ae0178488f70b2a90292ea42d
* | | | | Layoutlib Canvas and Paint implementation through native delegatesXavier Ducrohet2010-11-0112-2487/+1370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fix native delegate generation to put "this" parameter even for methods that don't have any parameters. Change-Id: I5dd0c505871370ff7b4cda16de84a5b3ae438f73
* | | | | Implement the layoutlib Bitmap through a native delegate.Xavier Ducrohet2010-10-299-348/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Fix the layoutlib_bridge .classpath to not use the full layoutlibXavier Ducrohet2010-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead this uses the actual output of layoutlib_create, which is all the modified classes before the content of the bridge is added to form layoutlib. Change-Id: I22755f38800cd69206834ff9594a99cb0c1d2139
* | | | | Move layoutlib typeface implementation to delegate.Xavier Ducrohet2010-10-278-293/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also move BridgeContentProvider to its own class to make it less messy in BridgeContentResolver. Change-Id: Id3462218b500d43d4c9b20b25326ad24e4106fa5
* | | | | am 57f7ccc4: am 63e5d07e: Merge "Fix issue with project resources overriding ↵Xavier Ducrohet2010-10-273-19/+22
|\ \ \ \ \ | |/ / / / | | | | | | | | | | framework resources." into gingerbread
| * | | | am 63e5d07e: Merge "Fix issue with project resources overriding framework ↵Xavier Ducrohet2010-10-273-19/+22
| |\ \ \ \ | | |/ / / | | | | | | | | | | resources." into gingerbread
| | * | | Fix issue with project resources overriding framework resources.Xavier Ducrohet2010-10-263-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Framework resources loaded through Drawable.createFromXml could be overriden by project resources if there were loaded through a state list drawable where the final resource name was used by a project resource (of the same type). This ensures that the XML parser knows that it's a framework resource being parsed and that the resource resolution uses that information. Change-Id: I39cf9eba755e55f1604b968637aeecff969a558d
* | | | | Reimplement the native matrix method using the new delegate way.Xavier Ducrohet2010-10-278-1070/+1246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Fix rendering of digitalClock/Gallery in Eclipse editors.Xavier Ducrohet2010-10-263-11/+115
| | | | | | | | | | | | | | | | | | | | Change-Id: Iedcd3184cd9f34be8d0695a51eda953ac68683ce
* | | | | Revert "Fix rendering of digitalClock/Gallery in Eclipse editors."Raphael2010-10-263-104/+11
| | | | | | | | | | | | | | | | | | | | This reverts commit 25e96ce7b99f9736a6024d25bd65a83774c7640f.
* | | | | am a44a5e02: am 1b6180ec: Merge "Fix rendering of digitalClock/Gallery in ↵Xavier Ducrohet2010-10-263-11/+104
|\ \ \ \ \ | |/ / / / | | | | | | | | | | Eclipse editors." into gingerbread
| * | | | am 1b6180ec: Merge "Fix rendering of digitalClock/Gallery in Eclipse ↵Xavier Ducrohet2010-10-263-11/+104
| |\ \ \ \ | | |/ / / | | | | | | | | | | editors." into gingerbread
| | * | | Fix rendering of digitalClock/Gallery in Eclipse editors.Xavier Ducrohet2010-10-263-11/+104
| | | | | | | | | | | | | | | | | | | | Change-Id: I80f4f90b173529632eaf2fbc3bb5471b7ede8216
* | | | | Fix debug statements and aapt assert.Patrick Scott2010-10-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ENABLE_PSEUDOLOCALIZE seems to not exist. Change-Id: Ifef771a96938c7ff0f8b664142bb502030b8c543
* | | | | Merge "Implement issue #3116702: New manifest tags for supported screen sizes"Dianne Hackborn2010-10-221-9/+50
|\ \ \ \ \
| * | | | | Implement issue #3116702: New manifest tags for supported screen sizesDianne Hackborn2010-10-221-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged from GB. Change-Id: I94730b54bcacd083f77708e84c35f4932a7b9d2e
* | | | | | Merge "Layoutlib_Create: Fix order of class adapters."Xavier Ducrohet2010-10-221-5/+6
|\ \ \ \ \ \