Eclipse IDE - Android Graphical Layout and XML Layout Side by Side - android

Is it possible to have the Android Graphical Layout next to the Android XML layout so I can modify both simultaneously? It would be much better to change the XML and instantly see the effects, as opposed to clicking the tab to change it all the time.

Yes, although I just tried it and it has a bit of lag after you change something in the Graphical Layout editor.
Open your layout file, such as "activity_foo.xml".
Choose the menu item "Window > New Editor". This will give you another editor for the same layout. In this example, you'll see two tabs that both have "activity_foo.xml".
Mouse press on the second tab and then drag it to the right and downwards, until you see the outlines of two rectangles representing editor views side by side, then let go of the mouse button.
You now have the editors side by side. Place one into Graphical Layout mode and the other into XML mode by choosing the respective tabs.
Note that it seems like the Graphical Layout will consistently update the XML. However, changes in the XML don't seem to affect the Graphical Layout until you save and then click in the Graphical Editor again.

I managed to make the code instantly update the graphical layout and to have both of them shown at the same time.
First, I followed the steps given by louielouie on his answer to have both graphical layout and XML code shown at the same time but this wasn't enough.
Then, I clicked on the code of the XML file and after that I clicked on the graphical layout. At this point, I was able to make changes on the XML file and they were instantly shown in the graphical layout.

There is a little bit better possibility to do that then with new editor like louielouie wroted..
1) Open your layout from project explorer and show it in graphical layout.
2) Get project explorer, right click on your layout
3) Select OPEN WITH -> XML EDITOR
4) At bottom you can switch between Source and Design layout.
5) Catch the 'header' and put it on the side of your graphical layout.
In short word just right click your layout -> open with -> xml editor.

Related

Android Studio can't extract layout

I am a complete beginner and following a guide. it asked me to click anywhere on my vertical layout and refractor -> refract this -> extract layout but as you can see in the screenshot all my options are greyed out
and the only option that I get in refactor this is "remove unused resources"
https://www.dropbox.com/s/vkeh7m1gs5zmeek/Screenshot%202017-06-23%2018.55.37.png?dl=0
https://www.dropbox.com/s/71v1b3nc2ysqk0t/Screenshot%202017-06-23%2022.46.12.png?dl=0
Maybe you are clicking on the LinearLayout Element on the Left side, Guide says to click anywhere inside vertical layout.
Try right clicking on the vertical layout in Design View.
In the preview screen, click on the layout you want to extract.
Then choose Refactor and Extract style.
You can save the layout in camelCase or in lowercase.
Note: You should not start layout names with captial letters.
Anywhere in the vertical layout means any elements inside the design window. But not inside the Component Tree. That means click anywhere inside the red marked area.

When I opened the layout file in eclipse with Android common XML editor,there is only one view mode shown to me

The option bar at the bottom doesn't exist.
I can only use the graphical layout view mode,unless I select the xml file to open with other xml editor.
So,how can I fix that?
Thanks!
update:
In fact, I can use the hot key "shift+alt+f7" to switch the view mode between graphical layout and xml editor, while there is no option bar at the bottom.
update2:
Finally,I find the cause of the problem.
This problem turned out to be a side effect of the Dark Juno theme.
reference:
How do I force eclipse to show xml layouts and styles as text?
Right click on any of the layout files in the package explorer(on the left), right click -> Open With -> Android Layout Editor

Missing configuration drop down buttons in Graphical Layout editor

I have two xml layouts in my project in Eclipse and when i want to edit them in the graphical layout tab, only one of them has the configuration drop-down buttons in the section above the layout. I would post up pictures but I don't have high enough reputation yet.
It contains buttons to choose the type of phone/tablet you want to display on, the screen orientation, the Theme, associate activity etc.
I want both of them to have it but I'm not sure how to put it back. Does anyone know how to make it appear?
Thanks in advance

diplaying both Graphical and Textual XML edit view in eclipse?

is it possible in eclipse to display both Graphical Layout view next to a Textual XML Editor for the same XML Layout file?
the reason is that i want to see the results in the graphical layout as soon as i save changes to the XML Editor, without the need to change tabs.
You can open any file in Eclipse in multiple editors and display them side-by-side. All editors referencing the same file will share the same editing buffer, so the changes in one should be reflected in the other. Just right click on the file and use the "Open With" menu item to open the editors you need. Then drag the opened editors around your workbench so that they are displayed side-by-side.

Is possible to view both Graphic layout and layout.xml in the same time?

I'm new to Android development and for me, a good way to learn how the Graphic layout and xml relate to each other is by trying an xml attribute and see the changes in the Graphic UI. Is there a way to see both side by side in the same time and not have to switch from one to another?
The picture show what I want to achieve.
Here is a better answer.
Open Layout
Windows -> New Editor
Set one window to Graphical, another window to xml
Eclipse IDE - Android Graphical Layout and XML Layout Side by Side
Use IntelliJ Idea. It's an IDE that has this feature.
Edit: I'm not sure I understood your question well, but what I got was that you want to make changes and see them update automatically. This feature IS present in Idea:
In the mean time I've found a different and more elegant way of doing this split (still in Eclipse R 4.4.0 + ADT 23.0.3.1327240):
Open Layout XML file.
Window > Editor > Toggle Split Editor (Vertical)
Select Graphical Layout in the pane to the right.
The clever thing about this approach is that the two split panes are retained within the editor tab.
Currently Both graphical and xml editor in same window is not there in Eclipse.
Update your Android SDK Tools to Revision 21
The update includes new tools and capabilities that can help you work more efficiently as you create applications. Tools such as a new multi-config editor, and new Lint rules will help you..
Ref here:enter link description here
Multi-config editor
A new multi-configuration editor allows you to develop and prototype your UI across various orientations, screen sizes and locales. For example, while editing your layout in portrait mode, you can see if your edits aren't visible in the shorter landscape orientation.
Here's how to do it in Eclipse Luna R 4.4.0 + ADT 23.0.3.1327240:
Open Layout XML file.
Window -> Editor Clone
Drag the new editor tab and place it next to the current editor window.
Set one editor window to Graphical Layout and the other to XML.
I can recommend an Eclipse setup with three windows next to each other:
Package Explorer, usually collapsed) | 2. XML | 3. Graphical with its Outline Structure panel open.
Caveats:
Changes made in XML do not automatically get reflected in the graphical window; you need to perform some action here, a click will suffice.
Selecting a new XML file in the Package Explorer will only open it in one (e.g. the XML) editor window, not both; you will need to select the other (e.g. Graphical) editor window and open the file in here too. Thankfully both windows have tabs of recently opened files, so this isn't that much of a hassle.
The usual Outline Window (Window > Show View > Outline) links with the currently selected editor; if you don't show the same file in both the Graphical and XML editor window, things may get confusing.

Categories

Resources