summaryrefslogtreecommitdiff
path: root/designer
AgeCommit message (Collapse)Author
2015-07-13property sheet: improve grouping and sortingSiva Velusamy
This CL implements a first cut at grouping attributes together and displaying them in a certain order. Attributes are first grouped into groups based on a few different criteria such as the parent stylable that declares the attribute, and for certain attributes coming from the base View class, by their name such as padding/margin or layout parameters. The grouped items are then sorted based on a predefined ordering for known types of attributes. Both the grouping and sorting needs to be improved further based on criteria from UX and including per View meta data. Change-Id: Ie8a9c23f18618a7a255780b6cade6db4461fe79a (cherry picked from commit 1f3fdc7f9d4e0eb7f49936248117e9acdc805fbc)
2015-07-13Add error view to the new layout editorTor Norbye
The error view displays errors in the layout for the first/primary screen in the design surface. Also cleans up some painting logic and handles Retina resolution painting. Change-Id: I3f60d4649181616515ef5597e0db9df7e93401e8 (cherry picked from commit 494e5538ac99071e80095282587c7fe73bbdb120)
2015-07-13Handle NumberPicker component (and MergeCookies) properlyTor Norbye
The NumberPicker renders with children whose getCookie methods return MergeCookies pointing back to the parent; this resulted in assertions when synchronizing the snapshot hierarchy with the component hierarchy. Change-Id: I4c08d2d2575b834b34263146700c06a9b5d9747c (cherry picked from commit a6f2707f6dc06fe8380327ceac243e132d359f14)
2015-07-13Add component creation in the model which calls create hooksTor Norbye
Change-Id: I8750faea82b640e185f6b4cb00fa2b4db8bde558 (cherry picked from commit bbb34223ec194fb811ff39af9bca70e73e0dcb24)
2015-07-13Update attribute lookup to use PSI snapshotTor Norbye
I missed this one because it used the tag field directly instead of going via getTag() as all the other usages. Change-Id: Ib11fa18f30cc403b7afb71a9878c85c7a65cb793 (cherry picked from commit 81f793085a3568b350cf3fc0af25af013c739bfb)
2015-07-13Use a PSI snapshot for the layout editor component modelTor Norbye
This ensures that all the views are showing a consistent view of the layout (and avoids problems where edits have rendered XmlTags invalid and painting code comes along and tries to access it.) Change-Id: I1e3b2405505a268270b71decd7b74775316dddb7 (cherry picked from commit 21d33183afcacb137bf0aaca091110288c7276c4)
2015-07-13Do not access attributes directly from the property sheet.Siva Velusamy
The XML tag and/or attribute information could be invalid at a later point in time if the user has performed some edit. Rather than directly accessing the tag/attribute and checking for its validity, we query the component for this information. It is now the component's responsibility to check for validity. The component should eventually be updated to maintain a copy of the PSI data structure so that it can always return the result from a snapshot in time. Change-Id: Id002993503227412dc32968e87e84c25c5a9352c (cherry picked from commit c3377bea6124fa7535f8939bbaefbd5d1e34c4e8)
2015-07-13Nele: Add an ItemTransferable for palette/designer drag & drop.Jens Ole Lauridsen
This is a preparation for using a ViewHandler instead of passing static xml for creation of a component. This CL will also center the image on the mouse pointer. Change-Id: If95d67f7a7ff91747575f732a93dd8dd93a8de1e (cherry picked from commit bd5d24cf148660c6307f2045d4ba13d6b042f16b)
2015-07-13Nele: Drop the new component on the correct screen view.Jens Ole Lauridsen
There were a bug: if you drag a new component in from the left (i.e. over the blueprint) and drop it on the normal screen view, the coordinates would be computed as if it was dropped on the blueprint view. Change-Id: Ib5254c534e7457541211db089a543a163e0fcc27 (cherry picked from commit d37a8d6269776b0c7d25e9eb47f8226a9f7fc1be)
2015-07-13Nele: Add a preview mode on the palette.Jens Ole Lauridsen
A preview of some of the components are shown instead of the icon and text shown by default. The images are rendered once for each session. The images are cahed in the system folder. Change-Id: I8b9746e39539632e33e80a9a1cd861e665444d14 (cherry picked from commit 5976c3839723057e03344a944a81036a6d3b794d)
2015-07-13Disable new layout editor by defautTor Norbye
Change-Id: I2e1b42a9ba14168748c2501b7e6214ece9225a6b (cherry picked from commit 99d9ca0c1baad6eba5267acf6d09310287636ba6)
2015-07-13Additional view handlers and view handler supportTor Norbye
This CL improves the infrastructure for view handlers, and adds new view handlers for more widgets and layouts. (1) Adds a RelativeLayout drag handler and resize handler, based on the one from the old layout editor (2) Adds a LinearLayout drag handler and resize handler, based on the one from ADT (3) Adds a creation handler where widgets can do custom actions when they are created; added handlers for <ImageView> and <ImageButton> to prompt on drop for the corresponding image; added handlers for <fragment> to ask for a fragment class, added a handler for <include> to ask for a corresponding layout, etc. It also now assigns unique id's on drop (for views that need it.) (4) Added a default resize handler which can snap to wrap bounds and fill bounds. (5) Added a model version such that handlers can cache data structures and refresh them when they are known to be stale. (6) Made the graphics handler perform coordinate transformations such that the view handlers can operate solely in the Android coordinate space without worrying about conversions. Change-Id: Ib60443ae53ac6615c66f29f3b72aa98b90407f42 (cherry picked from commit 6ae1438495eaab130a5e7cf39c875fa66d6505d0)
2015-07-13Extract property table widget to be independent of NlPropertiesSiva Velusamy
This CL introduces a new widget - PTable that is an implementation of a property table that can be shared across different models. Change-Id: Id1229c26261a7e259a663e89ebc36aa6112062b8 (cherry picked from commit 8d7f05994ab84360cda81405c6bb47dcf9ba4090)
2015-07-13property sheet: Show current values for attributesSiva Velusamy
Change-Id: I5563a27bb519db791aaefbded08d6c23b741fe48 (cherry picked from commit 50a14aabb71ab02d1c291880bcb3fb8eca0fcad6)
2015-07-13Use the resource notification manager in the new layout editorTor Norbye
Change-Id: If9cdb152f3a53ee1b4ad84adfc0b4d135db17422 (cherry picked from commit ad198e996684bd3aa0ab60f2d65d815542513c2c)
2015-07-13First cut of the property sheetSiva Velusamy
This CL adds an initial implementation of the property sheet. In its current form, it simply displays a list of attributes applicable to the component currently selected in the design surface. A few noteworthy points: - The list of attributes are obtained using the same mechanism as used by the IDE in order to offer code completion. - The selection events from the design surface are passed via a MergingUpdateQueue, which provides coalescing of events, but does introduce a 500ms lag from the component selection to the property sheet showing the appropriate attributes. - Most of the work happens on the EDT, with just the reading the list of applicable attributes happening on a pooled thread holding a read lock. - In order to populate the model, a new NlProperty instance is created for every applicable attribute right away. However, this operation is pretty cheap as the NlProperty object is just a simple bean. If necessary, this could be moved to a later stage (model.getValueAt), but so far that doesn't seem necessary.. Change-Id: I6d91417c04c2d396b0de6c270c4bbf1151c40c77 (cherry picked from commit be816c2c939cbd9a962eb396a98092ed1c95701b)
2015-07-13Add resize and drag view handlersTor Norbye
This CL puts in the basic resizing and drag plumbing, a sample implementation for AbsoluteLayout, and testing fixtures. Change-Id: I1e728fc4680bce16e8bc65440e9950df0078a24b (cherry picked from commit 3ae4019f515493a78d311983c08d8678685ef524)
2015-07-13Nele: Implement drag and drop from the palette.Jens Ole Lauridsen
Add DnD as text for now. Later we can drag a more complicated object to customize the xml that is being generated when adding a component. Change-Id: Ib8994074c791c97fd5a9857be19fc9d8e4bbf269 (cherry picked from commit a135949b47d3cb36f00c9afff4b4f779c007df9d)
2015-07-13Nele: Add speed search to the palette.Jens Ole Lauridsen
Add speed search and make the tree the receiver of the focus when the palette window is chosen. The latter allows speed search to be started after the user clicks on the titlebar of the palette. Change-Id: Ifbf2a815ffcebf939fbe1a1fb0286bf834434a98 (cherry picked from commit 872bdcf1cca16cdd09b1998a2d56fa0a1116de4e)
2015-07-13NIEditor: Fix the minimize of palette and structure panes.Jens Ole Lauridsen
The LightToolWindow needed a extra panel with an initial invisible element to function. Referenced in LightFillLayout. Change-Id: Ibdb3fbdea636c6f3b659dc005f991028455c14b2 (cherry picked from commit 30c73f785dad0bd663bfca9bca6a7eea8f03af3f)
2015-07-13Add a component palette.Jens Ole Lauridsen
Initially use a UI similar to the current Android Studio. Change-Id: I40bbb898456183eb5cc6913201726cac140d4f07 (cherry picked from commit b156cd0d0724ff74d93c4a5d610d5131cbc9b30a)
2015-07-13Fix package name typo: uilbuilder -> uibuilderSiva Velusamy
Change-Id: I02dccedd5a23de5513000cbb7f1f6c6af933b317 (cherry picked from commit f411952041ba65f31d4e9fa9656ec97e489f4c8c)
2015-07-13NlEditor: dispose of splitter and the modelSiva Velusamy
Change-Id: I7e19fc05ee174dbeab87957f30c79d416f046811 (cherry picked from commit c5949ef2f2a2befdc915c802a1e2fe80017cd8aa)
2015-07-13layout: Added skeleton for palette and structure panes.Jens Ole Lauridsen
Used the Intellij LightToolWindowManager. Change-Id: I4304982b97d3d4432535448ac96f297a32a13b95 (cherry picked from commit 8329f577045e1cba1e3017d7166086058c42e57e)
2015-07-13New layout editor - initial skeletonTor Norbye
This CL puts in some basic plumbing for a new layout editor. A few pieces are there (IDE editor integration, layoutlib rendering, event listening to re-render and repaint on edits, basic selection & deletion, etc), along with core handling such as a Layers/Overlays and Interactions. There are no toolbars etc; for now, you can drive the zoom with +/-/1/0, switch orientation with o, cycle through devices with d, and toggle devices frames with f. Package names, prefixes like Nl etc are temporary, but uploading to start collaboration. Change-Id: I7adf760ced363b8550f1a615dd2d9b3fe49add13 (cherry picked from commit 60a3e1005c0a23ecd0c14a4e69009b849374a378)