summaryrefslogtreecommitdiff
path: root/designer
AgeCommit message (Collapse)Author
2015-08-03Merge "Implemented some of GridDragHandler.paint" into studio-1.4-devJuan Nuno
2015-07-30Implemented some of GridDragHandler.paintJuan C Nuno
Ported code from RadGridLayoutComponent.getGridInfo, (the old) GridInfo.addLineInfo, and GridOperation.GridFeedback. This is a work in progress. Change-Id: I3083542489230237cbd21591833f29d57e4909be
2015-07-30Fix some Nele tests that are failing on Jenkins.Jens Ole Lauridsen
Change-Id: Id5838e75897cd0303c0429abc4869994ee5794ce
2015-07-30Use Disposer.dispose() instead of directly calling dispose()Siva Velusamy
Calling the Disposer allows it to dispose all other child widgets registered using the Disposer infrastructure. Without this, components inside the splitter that are registered via "Disposer.register(this, myFirstDivider)" don't get disposed. Change-Id: Iedf750c1ab4b9dd7ad4453463ad853d2a540c64a
2015-07-30Show lint errors on the design surfaceSiva Velusamy
This CL shows lint errors for the current layout on the design surface. It works as follows: - The designer editor registers a background highlighter. - This highlighter queries lint for errors on the layout (this happens on a worker thread that holds a read lock). - Once the results are available, it sets the lint annotations result in the NlModel, which results in a refresh of the design surface. - The warning layer registered on the design surface looks for any lint errors stored in the model. If any are present, it shows an icon at the top right corner of the corresponding component. - The interaction manager now tracks mouse events, and if it detects a mouse hover, then it queries all the layers whether any appropriate information can be displayed. Currently, only the warning layer will respond with the message from lint if it detects that the mouse is hovered over the icon it rendered for that component. - This message is displayed by the design surface on the error panel (which has now been slightly tweaked to differentiate warnings and errors) TODO: - Show quick fixes as links in the error panel - Show a global setting to enable/disable viewing these warnings on the design surface - Currently the warning panel disappears as soon as the mouse is moved, so there is no way for a user to click on links there. One possibility is to keep it open as long as the mouse is moving towards that panel. Change-Id: I3c1ad8587c06357a3429cc8f40ccf2b26a0682c2
2015-07-29Nele: Add dependency checks for palette.Jens Ole Lauridsen
The components on the palette that belong to a library that is not included in the current module will no longer be able to be dragged onto the designer. If the user clicks on the component on the palette, a dialog prompts the user if the library should be added to the module. Changes to the known list of missing libraries for the palette is detected from project save operations. Change-Id: I2b1a1093b9214c5c359192fb854e81f1bc28485d
2015-07-28Merge "Nele: Fix the disposing of the palette and structure pane." into ↵Jens Ole Lauridsen
studio-1.4-dev
2015-07-28Merge "Nele: Resize of child in Relative Layout gives garbage in layout ↵Jens Ole Lauridsen
file." into studio-1.4-dev
2015-07-27Nele: Fix the disposing of the palette and structure pane.Jens Ole Lauridsen
These components were not disposed as intended and it caused some subtle bugs ex: open/close/reopen a project with a designer open then change the color theme of AS => an exception because a palette panel that were no longer used was still receiving notifications. Change-Id: I261ebb12f5f1abe855d12ee16dd28d4b440da7ce
2015-07-27Nele: Resize of child in Relative Layout gives garbage in layout file.Jens Ole Lauridsen
This fixes the following error: Resizing a textview child with margin set to e.g. 100dp and alignParentEnd=true causes the child to move to the upper right and a couple of http strings are added to the file (garbage). Change-Id: I2c17209ba561865ef0aac5e014f20e22dade47f8
2015-07-27Merge "Nele: Use NlModel.addComponents for drag/drop in InteractionManager." ↵Jens Ole Lauridsen
into studio-1.4-dev
2015-07-27Nele: Use NlModel.addComponents for drag/drop in InteractionManager.Jens Ole Lauridsen
User the same methods that copy/paste and Dnd in the structure pane is using. Also: Fix handling of text dragged in from an external process. Change-Id: I6fd818f918db0c32a44eed6702e6a5ce30d6bf30
2015-07-23property sheet: Fix failing testSiva Velusamy
Change-Id: I21b9550cc12473554e3da61b1deda067961812eb
2015-07-22Nele: Fix update bug in structure pane.Jens Ole Lauridsen
Nodes were being reused without updating the NlComponent which may refer to a completely different tag. Also make sure if 2 components accidentally has the same id, then we only reuse the cached node once. Add tests for this and other missing test cases. Change-Id: I9aafa46ff4502b44482d2d7574b6decbcbbfea3e
2015-07-21Nele: Implement drag and drop in the structure pane.Jens Ole Lauridsen
The implementation uses AWT DnD such that we can interact with other Android Studio processes i.e. drag an component from one project to another. Change-Id: I67db693e89f83c6e1bb533775550d78afafd44c1
2015-07-16Use getParent instead of the Android coordinatesJuan C Nuno
When resizing a child layout in Nele's blueprint view sometimes its resize handler got created and used when only the parent's handler should have. Fixed by using myComponent.getParent() instead of the Android coordinates to get the parent's resize handler. Change-Id: I27b9dfcea23640512ee8ca268a570971119feb85
2015-07-16Merge "Fix the updating of files after modifying statelists" into studio-1.4-devJerome Gaillard
2015-07-15Merge "Nele: Fix problem with hierarchy updates in NlModel." into studio-1.4-devJens Ole Lauridsen
2015-07-15Merge "Enable NlPreviewManager only if nele.enabled=true" into studio-1.4-devRaluca Sauciuc
2015-07-15Enable NlPreviewManager only if nele.enabled=trueSiva Velusamy
Opening the preview toolwindow results in the following error: java.lang.IllegalArgumentException: window with id="Preview" is already registered Change-Id: Ia23fe10240a668cfcea9d8a680979b2af4b02567
2015-07-14Do not show tooltips in the Nele PaletteJuan C Nuno
They are more obnoxious than helpful. But this is really for me to learn the Android Git workflow which is new to me. Change-Id: I03b2ca873f021be22d931d12bd1394fe75bec66a
2015-07-14Nele: Fix problem with hierarchy updates in NlModel.Jens Ole Lauridsen
When an XML files is parsed e.g. after a user changes the XML by hand in the "Text" pane of the designer, some of the components end up having the TagName property set to something different from Tag.Name. It looks like the XmlTag instances have been reallocated to the same spot in memory and the hash in NlModel is still pointing to an older version. In that case the TagName in NlComponent end up with the wrong value which causes bad behaviour in the structure panel and the designer. This is a bandaid - we should reevaluate the use of the hash in NlModel. Change-Id: I65ca3af2e7bc8536af440628e2353016e5684b50
2015-07-14Fix build broken by http://r.android.com/172415Jerome Gaillard
And revert temporary fix introduced in http://r.android.com/159296 Change-Id: I7cd556d4bc3119c41b9066a408adacf5a30ac156
2015-07-14Fix the updating of files after modifying statelistsJerome Gaillard
Uses Psi files to make sure that one always works with the most up-to-date version of the resource files. Bug: http://b.android.com/174955 Change-Id: I44cb74c574bce66ea65b16862b40636580d81bfa
2015-07-14Merge "Fix build temporarily." into studio-1.4-devJerome Gaillard
2015-07-13Nele: Change the approach for updating the structure tree after a model change.Jens Ole Lauridsen
The previous code was keeping references to XmlTag references which is a memory leak in itself because they were never discarded. Worse: the instances were being reused such that the tree would expand the wrong nodes after an update. This has now been fixed by holding a map from component id to tree node and attempting to restore the visibility of all the nodes we recognize the id for. [This may cause some nodes without id to close and other nodes with duplicate ids to open - but these issues are deemed less important that the previous problems.] Change-Id: I00818473add6dcac10c658b1d191110ff8584c40 (cherry picked from commit c21d60a752c5244f7f6a68f377f8fddf67b4dca9)
2015-07-13Fix build temporarily.Deepanshu Gupta
This may not be the right fix. Fixing it till the owner gets time to fix it properly. Change-Id: I214b414642945c39ce294e244bb72538441132f7
2015-07-13property sheet: Improve keyboard focus handlingSiva Velusamy
- Pressing Enter key will expand/collapse a node if it has children, start editing the value otherwise. - an editor.activate() allows editors to do something custom: e.g. a boolean editor would just change the state - pressing space will change the property value only if it is a boolean property - Pressing the right/left arrows will also behave just like a tree would Change-Id: I4c91d77e2ccfbdf4a1228c5ce5d7c4d5698ef577 (cherry picked from commit f476896c9e14ee1cfdf2c4e8a49d4b8fa85c4e6b)
2015-07-13Nele: Change Drag and Drop format to contain multiple components.Jens Ole Lauridsen
This is in preparation for drag and drop in the structure pane. Change the Drag and Drop format currently only used by the palette to be able to contain multiple components. Also add information to determine the type of drop and if the source model is identical to the target model. Change-Id: I219e3a316c180613fc1b7cc24d0144159867e5f2 (cherry picked from commit dc1fbbaac6471fb16ae78ca15e582842e41dd80f)
2015-07-13Add toolbar to Nele XML previewTor Norbye
Also moves the layout editor toolbar into the design surface area instead of sitting on top of the palette and property sheet areas. Change-Id: If845e3d362a48939f3668ce38acb3cf06891a4d4 (cherry picked from commit 39abb353b132dc9eb4b214396a5275067329f053)
2015-07-13Nele: Create component tree (pure restructure).Jens Ole Lauridsen
As a preparation for adding drag and drop to the structure pane, create a class for controlling the tree separate from the structure pane that also controls the properties panel. Change-Id: I8696eefce9a56bc087ae6140ba609601f03f3371 (cherry picked from commit 6879840782a434d166924d9f48b04da257ccc1a1)
2015-07-13Nele: Propagate preview surface changes to the attached palette.Jens Ole Lauridsen
When the preview is notified that the active editor has changed the palette may have to update since the file may have a different theme. Change-Id: Id91aafc7c007b8b2dd9e1ce19d66825be621dd28 (cherry picked from commit b0d83d0871667aa80af724450723f88665339f93)
2015-07-13Nele: Use a queue for displaying updates in the structure pane.Jens Ole Lauridsen
The user should not wait for the structure pane to update for every change made in the designer. Change-Id: I2360a0497d476b62787285481ac9d94d82ddb281 (cherry picked from commit b9fa097032d0baf9f7915220c6a490202700859c)
2015-07-13Nele: Show a vertical LinearLayout icon in the structure pane.Jens Ole Lauridsen
The same icon was used for any LinearLayout component. Change-Id: I0ecef7f23a9a9c8105fcaf183482666c27492b50 (cherry picked from commit d555f44565ef16a21aef5130416a575d421bd6e2)
2015-07-13property sheet: Support auto complete in text fieldsSiva Velusamy
This CL adds support for auto completing resource references. The list of possible references matches what is shown in the ChooseResourceDialog (which is what is shown when you click on "Browse.." next to the text field), but will be tweaked in a future CL to reuse the logic used by the XML editor to determine possible completions. Also resolved conflicts as in 2cf93887950204cd2563adf1. Change-Id: Iebceec4fece83225cc27557dcd4f578b6e092583 (cherry picked from commit b5d5d3e05d7e5666f57690f982420f1d60a01cae)
2015-07-13Nele config chooserTor Norbye
This CL adds a configuration chooser to the Nele editor window. To avoid code duplication this just tweaks the old configuration actions such that they work with the new layout editor; we can move and drop the render context when we switch exclusively to the new editor. Also resolved the conflicts as resolved in ad1921fa016e378. Change-Id: I0915bee480d1bce975adc8bce36090cd12ce627a (cherry picked from commit 4c39a2cde7d7cca0185ad2962ce8b6bf0375242b)
2015-07-13Nele: Include the preview form in the active tool editors.Jens Ole Lauridsen
The preview form should be able to interact with a floating tool palette. This did not work because the preview was ignored as a possible editor. After this fix there are still a couple of problems: 1) When a floating palette is opened the palette for the preview is disposed twice => NullPointerException. 2) The palette for the preview has an option to be placed on the right, but that is actually not implemented, so eht option should be removed. Change-Id: I9ca2f34f78c7536e1c3282fdb3220393b741f5db (cherry picked from commit d82a376dbfa7838414d007222bff670006e731cd)
2015-07-13Dispose off DesignSurfaceSiva Velusamy
Change-Id: I5b5cf4b5d155f3ae04cddaf042ef276efa990527 (cherry picked from commit b45e2f34edebe0a59814d7e20eb6eda41813a965)
2015-07-13Add XML preview support, misc other layout editor fixesTor Norbye
This CL adds support for using the layout editor as an XML editor preview pane. There were many other related and unrelated changes that wound up touching a lot of files: * Up until now we were just using the ChangeListener interface for clients to listen to various related changes (selection changes, render complete, etc). Added more specific listener interfaces (SelectionListener, ModelListener, DesignSurfaceListener) now to make this cleaner and less confusing, especially for clients that need to react to multiple of these events. * The DesignSurface itself now propagates selection events. This allows the propertysheet to just subscribe to selection events without worrying about which model is active in the design surface. Similarly the Structure Panel can subscribe to model changes in the surface such that it can update itself based on file changes in the surface. * A DesignerSurface (which used to be able to have one or more screens) can now have 0 or more screens, which means getCurrentScreenView() can return null, and various client code needs to check for this. (This happens if you open up the preview window before navigating to a particular layout file for example.) * SelectionModel now returns a List instead of an Iterable. The idea behind the Iterable was that clients can use it for for-each iteration and the model can return it without worrying about clients modifying it, but there were ever increasing usages which needed to put it into lists anyway, so it's now a list (with a defensive copy for now in the selection model.) * Some threading cleanup, allowing immediate, fast and delayed model rendering based on client usage. The XML preview form will use delayed rendering whereas the interactive layout editor requests fast rendering. * Show a progress indicator while waiting for layout changes. * Some color and font tweaks. Use @NonNull instead of @NotNull consistently. * Make blueprint mode optional ('b' cycles through the modes for now) Change-Id: I9fe09133f34386549008d21412f3135fef620b88 (cherry picked from commit dfbe30b4278cc18a7f18f44fcda5169c4ab78fbe)
2015-07-13Nele: Show the design components show in the structure panel.Jens Ole Lauridsen
Currently the design components show up as CustomView. Restructure the PaletteModel to hold items for the design components such that the structure pane can display them. Also: Use android nullable annotations instead of Intellij. Change-Id: I0e1a9a4df3af1b7c7321ab8e41e13faff26cb71a (cherry picked from commit f4a5da4ff88a380413fca47901ad3a97016a221e)
2015-07-13property sheet: Add speed searchSiva Velusamy
Change-Id: I33b5e759dfcf636c4b46c4641974e342fa656d66 (cherry picked from commit 5f41c3a23535f2879b96f30da3baacf9f674a330)
2015-07-13Nele: A floating properties panel should see the current screen view.Jens Ole Lauridsen
The properties panel did not update when the properties panel was floating. This is hooked up in this CL. Change-Id: Iafab2df992e54661539c4da1bfea9722c9d57441 (cherry picked from commit 6fb52fe8ec7cd9a4a6b8378bbf2708bc925b58e2)
2015-07-13property sheet: editing support and other renderer improvementsSiva Velusamy
This CL includes a number of changes to the property sheet: Renderer improvements: - The renderer and editor for booleans now use a ThreeStateCheckbox instead of a checkbox to allow for 3 states (yes, no, default). The actual widget used will be tweaked after UX review. - The default renderer for resource references will now attempt to show an icon for color and drawable references. - Hovering over a cell will automatically show a browse button that can be clicked to bring up the resource chooser dialog. Editors: - Includes editing support for: - booleans (using a ThreeStateCheckbox) - enums (using a JComboBox) - and other reference properties (just an EditorTextField) - Flag properties are missing, and auto complete within the text fields is also missing Misc: - A "Show expert properties" toolbar button has been added. This doesn't do anything right now, but will be wired up to show just a filtered list of properties. This CL includes it just so that the toolbar has some action setup in it. Change-Id: I089ce7da5158b6565b695c536e24d6411a73b0c9 (cherry picked from commit 846e9f1f055ea958a489874704950ae186689762)
2015-07-13Nele: Update the options in the App Bar Wizard.Jens Ole Lauridsen
Include a collapsed view. Remove/add options such that the choices make more sense to the user. Change-Id: If1a819fe02c1b083608298ace61419fb48328319 (cherry picked from commit ad355a79f815d963f305d14c6405ea267a195747)
2015-07-13Nele: Add components from Material design to the palette.Jens Ole Lauridsen
Add a number of components including layouts to the palette. Handlers are added to guide the addition of the components to the design surface. Change-Id: Ifced932c3829483b8222987621c8608cb261e764 (cherry picked from commit d06e3f2ed63fbee6d4ebeab1ae952507319782b2)
2015-07-13Nele: Add a structure pane.Jens Ole Lauridsen
Add a structure pane which reflect selection changes. This CL does NOT contain logic for changing the layout xml in the structure pane. This is left for a later CL. Change-Id: I10ce0d6b11c04f6e8cf6c5554a4b2e940e8b7d3e (cherry picked from commit 5ce22023c14cced62356cc3d7fdf7a4f2c4654e2)
2015-07-13Nele: Use the theme background & foreground color for palette.Jens Ole Lauridsen
When we show rendered components on the palette the text colors may be hard to see on the default IDE background color. This CL will use the theme colors to avoid this problem. Change-Id: Ice4e6c3b41659cb4519b65e0525ee8267e669971 (cherry picked from commit 9f9f6593b9382f84f0f624871d7325c694c90079)
2015-07-13Add acceptChild/acceptParent methods to the view handlersTor Norbye
Change-Id: I610e46f298f8c805cbb4c5439754e85757e4fe16 (cherry picked from commit 2989076b843b879bd6504b18a24c405291bb8780)
2015-07-13Nele: Use the Viewhandlers on the drag image from the palette.Jens Ole Lauridsen
Use ViewHandlers to modify the xml for each component on the palette before displaying an image representation to drag onto the design surface. Change-Id: Icd7579056e97cedb39fc180ebd6e80650f295abf (cherry picked from commit 5c32dcf63b641da525e085f11879e92bd2dc13c5)
2015-07-13Use a custom renderer for boolean property valuesSiva Velusamy
Change-Id: I24a5429b94801dfd678e53d07e5a0ac7069038bd (cherry picked from commit f14a8b6fa1514200db13462eaa51aefdb089f7fc)