summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge
Commit message (Collapse)AuthorAgeFilesLines
* LayoutLib: fix incorrect indices in one of the 2 native_drawTextRun methods.Xavier Ducrohet2011-02-241-3/+2
| | | | | | Fixes http://b.android.com/15007 Change-Id: Iff06180def92c5fa25e82520b76192c089edd8cc
* LayoutLib: move tests to their own project.Xavier Ducrohet2011-02-2411-64/+66
| | | | Change-Id: I8a9e128e4a17ab57ec7b126a378035d9ce5bc168
* LayoutLib: Add debug mode.Xavier Ducrohet2011-02-2316-14/+62
| | | | Change-Id: If4263c7dba63a063f84e0c6988c270eb6d291ac3
* LayoutLib: downsize the SparseArray when possible.Xavier Ducrohet2011-02-231-3/+11
| | | | Change-Id: I570b93ab161414b7729f8d2dce8ddadb706f186b
* LayoutLib: misc fixes.Xavier Ducrohet2011-02-234-27/+106
| | | | | | | - 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
* LayoutLib: Hold onto delegate references.Xavier Ducrohet2011-02-2337-141/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* LayoutLib: Import of SparseArray as SparseWeakArray.Xavier Ducrohet2011-02-231-0/+338
| | | | | | This is a straight copy for easy review of the customization. Change-Id: I351ec570c3e7a025561939ab05c1ae7eded30b38
* LayoutLib: remove assert in resource resolution.Xavier Ducrohet2011-02-181-8/+0
| | | | | | | These code paths were valid in case there's a mismatch between the style/theme/version of Android Change-Id: I8cb3b2a3f3a1ef5c37ccec0c8ddbb7add69bfbe0
* LayoutLib: support defStyleRes in obtainStyledAttributes.Xavier Ducrohet2011-02-181-24/+60
| | | | | | This fix the Spinner rendering. Change-Id: I20a71d9e07f6c86652a74fba3fc05a027a057ff8
* LayoutLib: properly handle @null references in more places.Xavier Ducrohet2011-02-181-0/+24
| | | | Change-Id: I240298ab79c19ab0e49cb6da19d6b0187493d3b5
* LayoutLib: add support for layout_only render.Xavier Ducrohet2011-02-172-42/+49
| | | | Change-Id: I1cd791cf9560156c1ac488f8e454240c84e29cc6
* am 1858c95e: am 02d2b5a4: LayoutLib: When possible ensure parsers are popped ↵Xavier Ducrohet2011-02-145-21/+46
|\ | | | | | | | | | | | | from the stack. * commit '1858c95e99f81ac46eea93288cb8866260b3d5d8': LayoutLib: When possible ensure parsers are popped from the stack.
| * LayoutLib: When possible ensure parsers are popped from the stack.Xavier Ducrohet2011-02-145-21/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | LayoutLib: remove some exceptions.Xavier Ducrohet2011-02-095-46/+83
| | | | | | | | | | | | | | We need to move away from throwing anything and instead log errors/warnings. Change-Id: Ib1af71a90c06e8565fbd0c061ba56f4d19baa3df
* | LayoutLib: Annotate the custom delegate methods.Xavier Ducrohet2011-02-0950-271/+540
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | LayoutLib: now depends on tools-common-prebuilt.Xavier Ducrohet2011-02-092-2/+2
|/ | | | Change-Id: I11196c2363da378027fb8ca001e7dce0f58f657f
* LayoutLib: fix the background of title/action bars.Xavier Ducrohet2011-02-074-13/+30
| | | | | | | | | | | | | 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
* LayoutLib: Update to latest API fix.Xavier Ducrohet2011-02-071-1/+1
| | | | Change-Id: I5147010e4f16a5c2ea0b98709c42f7ecd9412ff6
* Merge "LayoutLib: Handle color state list in methods returning an int." into ↵Xavier Ducrohet2011-02-071-7/+4
|\ | | | | | | honeycomb
| * LayoutLib: Handle color state list in methods returning an int.Xavier Ducrohet2011-02-061-7/+4
| | | | | | | | Change-Id: Ia35ea09b992a239873026c7ef1629a01dd2e6cec
* | LayoutLib: improved rendering for system/title/action bars.Xavier Ducrohet2011-02-0613-131/+250
| | | | | | | | Change-Id: I926531e9ad4a7b98e04e23cac3837794f7c89449
* | LayoutLib: add implementation of Bridge.renderDrawable()Xavier Ducrohet2011-02-043-6/+178
|/ | | | Change-Id: Ic4d96488fd1a2e5b7d24353bebc8fdb24262c1d1
* LayoutLib: split RenderSession's base method into RenderAction.Xavier Ducrohet2011-02-043-244/+348
| | | | | | This will allow us to create RenderDrawable that extends RenderAction. Change-Id: If9cd350453ceffae4859a925a7b436502b311f9c
* LayoutLib: update to the new API.Xavier Ducrohet2011-02-042-7/+8
| | | | Change-Id: Ice028933cd2270c81c3d17f7bef7c5a9d14bd802
* LayoutLib: Replace custom BitmapFactory by a simpler delegateXavier Ducrohet2011-02-044-605/+135
| | | | Change-Id: Ie61a0a5b4426e64bb71a22d76d05efa4c0865e5e
* LayoutLib: render system/title/action bars.Xavier Ducrohet2011-02-0421-201/+770
| | | | | | | Also a few generic fixes in the layoutlib itself to support this. Change-Id: Ie3f24c9056bd3cc72f39f8a4f2c0861be15bff55
* LayoutLib: Fix some rendering issuesXavier Ducrohet2011-02-022-5/+9
| | | | Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
* Make TimePicker/DatePicker/CalendarView render in Eclipse.Xavier Ducrohet2011-02-025-4/+287
| | | | Change-Id: Id5313a6f0f53bf45f6eaabc0e10fcf0660eeac08
* LayoutLib: update with Pair API.Xavier Ducrohet2011-01-2810-83/+82
| | | | Change-Id: Iba945153f7544872ea84e3311584223aea740e2e
* LayoutLib: Update with the new resource map APIs.Xavier Ducrohet2011-01-2810-32/+50
| | | | Change-Id: I30d83c2bb4569513f4f5e22670cffe938706f105
* LayoutLib: Properly compute available space to layouts.Xavier Ducrohet2011-01-278-81/+228
| | | | | | | Also display placeholders for status/title/action bars depending on if the app is a tablet and its theme. Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
* LayoutLib: put a default image on the quickcontactbadge.Xavier Ducrohet2011-01-261-0/+4
| | | | Change-Id: I64b3f4004801ec03f374460384f9a492e66bfaf0
* LayoutLib: properly erase the bitmap when rendering a new session.Xavier Ducrohet2011-01-264-8/+26
| | | | | | | 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
* LayoutLib: return ViewInfo for all merged items + Build init.Xavier Ducrohet2011-01-255-14/+88
| | | | | | | android.os.Build is now initialized from the build properties parsed from the SDK build.prop file. Change-Id: If16953215ca90fb0beacb51bf405b89a5c8a34fa
* LayoutLib: Use special view cookie for include-merge case.Xavier Ducrohet2011-01-243-5/+116
| | | | | | | | 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
* visibility ("lights out") API.Joe Onorato2011-01-231-0/+4
| | | | | | | | | | | | | | | | 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
* LayoutLib: properly configure ApplicationInfo with targetSdkVersion.Xavier Ducrohet2011-01-172-3/+9
| | | | Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
* Allow TabHosts to have no children in the tabcontent widgetTor Norbye2011-01-171-18/+28
| | | | | | | | | | | 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
* LayoutLib: Update to use the new RenderResources API.Xavier Ducrohet2011-01-177-647/+103
| | | | Change-Id: Ic64eff3f324c4519da89bab10e6d59f0a9341a04
* Merge "LayoutLib: extract resource resolution into its own class." into ↵Xavier Ducrohet2011-01-169-561/+652
|\ | | | | | | honeycomb
| * LayoutLib: extract resource resolution into its own class.Xavier Ducrohet2011-01-169-561/+652
| | | | | | | | | | | | | | | | | | | | | | 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
* | Support non-rectangular input regions.Jeff Brown2011-01-161-1/+1
|/ | | | | | | | 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
* LayoutLib: update logs to use new data bundleXavier Ducrohet2011-01-1422-91/+89
| | | | | | Also change some resource.resolve tags to resource.format Change-Id: I3f0b0d2eb69a5ec98375e4014a3bb1bfceb8c855
* LayoutLib: Misc fixes.Xavier Ducrohet2011-01-142-18/+34
| | | | | | | | | | | | | | | - 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
* LayoutLib: Fix multi-line text rendering.Xavier Ducrohet2011-01-131-1/+1
| | | | | | Stupid indices. Change-Id: I1dbdd04b8f25a5769de8dc21e6c513cef3e35635
* LayoutLib: Use the new log tag constants from LayoutLogXavier Ducrohet2011-01-1323-90/+80
| | | | Change-Id: I29dd578ae16405358d3673caf13528be393f0967
* LAyoutLib: Fix build by adding missing IWindowSession implementation.Xavier Ducrohet2011-01-131-0/+6
| | | | Change-Id: I0af178d149b782cac3ae0c36fa5fc03f4dc6118b
* Merge "LayoutLib: move MockView back into its original package." into honeycombXavier Ducrohet2011-01-134-4/+4
|\
| * LayoutLib: move MockView back into its original package.Xavier Ducrohet2011-01-124-4/+4
| | | | | | | | | | | | | | | | | | | | This is used by Eclipse when the custom view is not found. It couldn't find the view in the new package either. We should probably move this logic of creating a mock view into the layout library instead. Change-Id: Ifa1a717cddf7004a7719bb4d0798cd53b43273ea
* | Merge "LayoutLib: Add getViewParent/getViewIndex on RenderSession." into ↵Xavier Ducrohet2011-01-131-0/+39
|\ \ | |/ | | | | honeycomb