mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Morphing
This commit is contained in:
+11
-2
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.android.designer.model;
|
||||
|
||||
import com.intellij.android.designer.model.morphing.RelativeLayout;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.designer.model.RadLayout;
|
||||
@@ -97,7 +98,15 @@ public class ComponentMorphingTool {
|
||||
"com.intellij.android.designer.model.morphing." + component.getMetaModel().getTag());
|
||||
Object sourceConverter = sourceConverterClass.newInstance();
|
||||
|
||||
Method method = sourceConverterClass.getMethod(target.getTag(), RadViewComponent.class, MetaModel.class);
|
||||
return (RadViewComponent)method.invoke(sourceConverter, component, target);
|
||||
try {
|
||||
Method method = sourceConverterClass.getMethod(target.getTag(), RadViewComponent.class, MetaModel.class);
|
||||
return (RadViewComponent)method.invoke(sourceConverter, component, target);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
if ("RelativeLayout".equals(target.getTag())) {
|
||||
return RelativeLayout.RelativeLayout(component, target);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.model.morphing;
|
||||
|
||||
import com.intellij.android.designer.model.ComponentMorphingTool;
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.model.layout.relative.RadRelativeLayout;
|
||||
import com.intellij.android.designer.model.layout.relative.RadRelativeLayoutComponent;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class AbsoluteLayout {
|
||||
public static RadViewComponent RelativeLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
return new ComponentMorphingTool(component, new RadRelativeLayoutComponent(), target, new RadRelativeLayout()) {
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
for (RadComponent childComponent : myNewComponent.getChildren()) {
|
||||
XmlTag tag = ((RadViewComponent)childComponent).getTag();
|
||||
|
||||
XmlAttribute xAttribute = tag.getAttribute("android:layout_x");
|
||||
if (xAttribute != null) {
|
||||
tag.setAttribute("android:layout_alignParentLeft", "true");
|
||||
xAttribute.setName("android:layout_marginLeft");
|
||||
}
|
||||
|
||||
XmlAttribute yAttribute = tag.getAttribute("android:layout_y");
|
||||
if (yAttribute != null) {
|
||||
tag.setAttribute("android:layout_alignParentTop", "true");
|
||||
yAttribute.setName("android:layout_marginTop");
|
||||
}
|
||||
}
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.model.morphing;
|
||||
|
||||
import com.intellij.android.designer.model.*;
|
||||
import com.intellij.android.designer.model.layout.Gravity;
|
||||
import com.intellij.android.designer.model.layout.grid.RadGridLayout;
|
||||
import com.intellij.android.designer.model.layout.grid.RadGridLayoutComponent;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableLayout;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.util.containers.hash.HashMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class FrameLayout {
|
||||
private static final String COLUMN_KEY = "Column";
|
||||
|
||||
public static RadViewComponent TableLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
final MetaModel tableRowModel = ViewsMetaManager.getInstance(component.getTag().getProject()).getModelByTag("TableRow");
|
||||
|
||||
return new ComponentMorphingTool(component, new RadTableLayoutComponent(), target, new RadTableLayout()) {
|
||||
@Override
|
||||
protected void convertChildren() throws Exception {
|
||||
RadViewComponent[] rowComponents = new RadViewComponent[3];
|
||||
Map<RadViewComponent, Map<Gravity, List<RadViewComponent>>> components =
|
||||
new HashMap<RadViewComponent, Map<Gravity, List<RadViewComponent>>>();
|
||||
|
||||
for (int i = 0; i < rowComponents.length; i++) {
|
||||
RadViewComponent newRowComponent = ModelParser.createComponent(null, tableRowModel);
|
||||
ModelParser.addComponent(myNewComponent, newRowComponent, null);
|
||||
rowComponents[i] = newRowComponent;
|
||||
}
|
||||
|
||||
for (RadComponent childComponent : new ArrayList<RadComponent>(myOldComponent.getChildren())) {
|
||||
Pair<Gravity, Gravity> sides = Gravity.getSides(childComponent);
|
||||
|
||||
RadViewComponent rowComponent = rowComponents[getRowIndex(sides.second)];
|
||||
Map<Gravity, List<RadViewComponent>> rowMap = components.get(rowComponent);
|
||||
if (rowMap == null) {
|
||||
rowMap = new HashMap<Gravity, List<RadViewComponent>>();
|
||||
components.put(rowComponent, rowMap);
|
||||
}
|
||||
|
||||
List<RadViewComponent> rowChildren = rowMap.get(sides.first);
|
||||
if (rowChildren == null) {
|
||||
rowChildren = new ArrayList<RadViewComponent>();
|
||||
rowMap.put(sides.first, rowChildren);
|
||||
}
|
||||
rowChildren.add((RadViewComponent)childComponent);
|
||||
}
|
||||
|
||||
for (RadViewComponent rowComponent : rowComponents) {
|
||||
Map<Gravity, List<RadViewComponent>> rowMap = components.get(rowComponent);
|
||||
boolean column = moveComponents(rowComponent, rowMap.remove(Gravity.left), -1);
|
||||
column = moveComponents(rowComponent, rowMap.remove(Gravity.center), column ? 1 : -1);
|
||||
moveComponents(rowComponent, rowMap.remove(Gravity.right), column ? 2 : -1);
|
||||
|
||||
for (List<RadViewComponent> rowChildren : rowMap.values()) {
|
||||
moveComponents(rowComponent, rowChildren, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
for (RadComponent rowComponent : myNewComponent.getChildren()) {
|
||||
for (RadComponent cellComponent : rowComponent.getChildren()) {
|
||||
XmlTag childTag = ((RadViewComponent)cellComponent).getTag();
|
||||
ModelParser.deleteAttribute(childTag, "android:layout_gravity");
|
||||
|
||||
Integer column = cellComponent.extractClientProperty(COLUMN_KEY);
|
||||
if (column != null) {
|
||||
childTag.setAttribute("android:layout_column", column.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadChildProperties(PropertyParser propertyParser) throws Exception {
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
|
||||
private static boolean moveComponents(RadViewComponent container, Collection<RadViewComponent> children, int column) throws Exception {
|
||||
if (children != null) {
|
||||
for (RadViewComponent childComponent : children) {
|
||||
if (column != -1) {
|
||||
childComponent.setClientProperty(COLUMN_KEY, column);
|
||||
}
|
||||
ModelParser.moveComponent(container, childComponent, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int getRowIndex(Gravity side) {
|
||||
if (side == Gravity.center) {
|
||||
return 1;
|
||||
}
|
||||
if (side == Gravity.bottom) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static RadViewComponent GridLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
return new ComponentMorphingTool(component, new RadGridLayoutComponent(), target, new RadGridLayout()) {
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
XmlTag tag = myNewComponent.getTag();
|
||||
tag.setAttribute("android:rowCount", "3");
|
||||
tag.setAttribute("android:columnCount", "3");
|
||||
|
||||
for (RadComponent childComponent : myNewComponent.getChildren()) {
|
||||
XmlTag childTag = ((RadViewComponent)childComponent).getTag();
|
||||
Pair<Gravity, Gravity> sides = Gravity.getSides(childComponent);
|
||||
ModelParser.deleteAttribute(childTag, "android:layout_gravity");
|
||||
childTag.setAttribute("android:layout_row", getRowIndexValue(sides.second));
|
||||
childTag.setAttribute("android:layout_column", getColumnIndexValue(sides.first));
|
||||
}
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
|
||||
private static String getRowIndexValue(Gravity side) {
|
||||
if (side == Gravity.center) {
|
||||
return "1";
|
||||
}
|
||||
if (side == Gravity.bottom) {
|
||||
return "2";
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
private static String getColumnIndexValue(Gravity side) {
|
||||
if (side == Gravity.center) {
|
||||
return "1";
|
||||
}
|
||||
if (side == Gravity.right) {
|
||||
return "2";
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.model.morphing;
|
||||
|
||||
import com.intellij.android.designer.model.*;
|
||||
import com.intellij.android.designer.model.layout.grid.RadGridLayoutComponent;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableLayout;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class GridLayout {
|
||||
public static RadViewComponent TableLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
final RadComponent[][] components = ((RadGridLayoutComponent)component).getGridComponents(false);
|
||||
final MetaModel tableRowModel = ViewsMetaManager.getInstance(component.getTag().getProject()).getModelByTag("TableRow");
|
||||
|
||||
return new ComponentMorphingTool(component, new RadTableLayoutComponent(), target, new RadTableLayout()) {
|
||||
@Override
|
||||
protected void convertChildren() throws Exception {
|
||||
for (RadComponent[] rowComponents : components) {
|
||||
RadViewComponent newRowComponent = ModelParser.createComponent(null, tableRowModel);
|
||||
ModelParser.addComponent(myNewComponent, newRowComponent, null);
|
||||
|
||||
for (RadComponent cellComponent : rowComponents) {
|
||||
if (cellComponent != null) {
|
||||
ModelParser.moveComponent(newRowComponent, (RadViewComponent)cellComponent, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
XmlTag tag = myNewComponent.getTag();
|
||||
ModelParser.deleteAttribute(tag, "android:rowCount");
|
||||
ModelParser.deleteAttribute(tag, "android:columnCount");
|
||||
|
||||
for (RadComponent rowComponent : myNewComponent.getChildren()) {
|
||||
for (RadComponent cellComponent : rowComponent.getChildren()) {
|
||||
XmlTag cellTag = ((RadViewComponent)cellComponent).getTag();
|
||||
ModelParser.deleteAttribute(cellTag, "android:layout_row");
|
||||
ModelParser.deleteAttribute(cellTag, "android:layout_rowSpan");
|
||||
|
||||
XmlAttribute attribute = cellTag.getAttribute("android:layout_columnSpan");
|
||||
if (attribute != null) {
|
||||
attribute.setName("android:layout_span");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadChildProperties(PropertyParser propertyParser) throws Exception {
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.model.morphing;
|
||||
|
||||
import com.intellij.android.designer.model.ComponentMorphingTool;
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.model.layout.relative.RadRelativeLayout;
|
||||
import com.intellij.android.designer.model.layout.relative.RadRelativeLayoutComponent;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class RelativeLayout {
|
||||
public static RadViewComponent RelativeLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
return new ComponentMorphingTool(component, new RadRelativeLayoutComponent(), target, new RadRelativeLayout()) {
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
Rectangle parentBounds = myOldComponent.getBounds();
|
||||
|
||||
for (RadComponent childComponent : myNewComponent.getChildren()) {
|
||||
Rectangle bounds = childComponent.getBounds();
|
||||
XmlTag tag = ((RadViewComponent)childComponent).getTag();
|
||||
tag.setAttribute("android:layout_alignParentLeft", "true");
|
||||
tag.setAttribute("android:layout_marginLeft", Integer.toString(bounds.x - parentBounds.x) + "dp");
|
||||
tag.setAttribute("android:layout_alignParentTop", "true");
|
||||
tag.setAttribute("android:layout_marginTop", Integer.toString(bounds.y - parentBounds.y) + "dp");
|
||||
}
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.model.morphing;
|
||||
|
||||
import com.intellij.android.designer.model.ComponentMorphingTool;
|
||||
import com.intellij.android.designer.model.ModelParser;
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.model.layout.grid.RadGridLayout;
|
||||
import com.intellij.android.designer.model.layout.grid.RadGridLayoutComponent;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent;
|
||||
import com.intellij.android.designer.model.layout.table.RadTableRowLayout;
|
||||
import com.intellij.designer.model.MetaModel;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class TableLayout {
|
||||
private static final String TABLE_ROW_KEY = "TableRow";
|
||||
|
||||
public static RadViewComponent GridLayout(RadViewComponent component, MetaModel target) throws Exception {
|
||||
final RadComponent[][] components = ((RadTableLayoutComponent)component).getGridComponents(false);
|
||||
|
||||
return new ComponentMorphingTool(component, new RadGridLayoutComponent(), target, new RadGridLayout()) {
|
||||
@Override
|
||||
protected void convertChildren() throws Exception {
|
||||
for (final RadComponent rowComponent : new ArrayList<RadComponent>(myOldComponent.getChildren())) {
|
||||
if (RadTableRowLayout.is(rowComponent)) {
|
||||
for (RadComponent cellComponent : new ArrayList<RadComponent>(rowComponent.getChildren())) {
|
||||
ModelParser.moveComponent(myOldComponent, (RadViewComponent)cellComponent, (RadViewComponent)rowComponent);
|
||||
}
|
||||
rowComponent.delete();
|
||||
}
|
||||
else {
|
||||
rowComponent.setClientProperty(TABLE_ROW_KEY, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
super.convertChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convertTag() {
|
||||
XmlTag tag = myNewComponent.getTag();
|
||||
if (components.length > 0) {
|
||||
String columnCount = Integer.toString(components[0].length);
|
||||
tag.setAttribute("android:rowCount", Integer.toString(components.length));
|
||||
tag.setAttribute("android:columnCount", columnCount);
|
||||
|
||||
for (int i = 0; i < components.length; i++) {
|
||||
RadComponent[] rowComponents = components[i];
|
||||
|
||||
RadComponent firstCellComponent = rowComponents[0];
|
||||
if (firstCellComponent != null && firstCellComponent.extractClientProperty(TABLE_ROW_KEY) == Boolean.TRUE) {
|
||||
XmlTag cellTag = ((RadViewComponent)firstCellComponent).getTag();
|
||||
ModelParser.deleteAttribute(cellTag, "android:layout_span");
|
||||
cellTag.setAttribute("android:layout_column", "0");
|
||||
cellTag.setAttribute("android:layout_columnSpan", columnCount);
|
||||
cellTag.setAttribute("android:layout_gravity", "fill_horizontal");
|
||||
}
|
||||
|
||||
for (RadComponent cellComponent : rowComponents) {
|
||||
if (cellComponent != null) {
|
||||
XmlTag cellTag = ((RadViewComponent)cellComponent).getTag();
|
||||
cellTag.setAttribute("android:layout_row", Integer.toString(i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (RadComponent childComponent : myNewComponent.getChildren()) {
|
||||
XmlAttribute attribute = ((RadViewComponent)childComponent).getTag().getAttribute("android:layout_span");
|
||||
if (attribute != null) {
|
||||
attribute.setName("android:layout_columnSpan");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.result();
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -1113,7 +1113,7 @@
|
||||
<palette title="RadioGroup" icon="/com/intellij/android/designer/icons/RadioGroup.png"
|
||||
tooltip="This class is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group."/>
|
||||
|
||||
<morphing to="LinearLayout FrameLayout TableLayout GridLayout RelativeLayout"/>
|
||||
<morphing to="LinearLayout TableLayout GridLayout RelativeLayout"/>
|
||||
|
||||
<properties inplace="orientation checkedButton"
|
||||
important="orientation checkedButton"
|
||||
@@ -1282,7 +1282,7 @@
|
||||
<palette title="LinearLayout" icon="/com/intellij/android/designer/icons/LinearLayout.png"
|
||||
tooltip="A Layout that arranges its children in a single column or a single row."/>
|
||||
|
||||
<morphing to="FrameLayout RadioGroup TableLayout GridLayout RelativeLayout"/>
|
||||
<morphing to="RadioGroup TableLayout GridLayout RelativeLayout"/>
|
||||
|
||||
<properties inplace="orientation"
|
||||
important="orientation gravity baselineAligned measureWithLargestChild showDividers"
|
||||
@@ -1309,7 +1309,7 @@
|
||||
<palette title="FrameLayout" icon="/com/intellij/android/designer/icons/FrameLayout.png"
|
||||
tooltip="FrameLayout is designed to block out an area on the screen to display a single item."/>
|
||||
|
||||
<morphing to="LinearLayout RadioGroup TableLayout GridLayout RelativeLayout"/>
|
||||
<morphing to="TableLayout GridLayout RelativeLayout"/>
|
||||
|
||||
<properties important="foreground foregroundGravity"
|
||||
expert="layout:gravity.fill layout:gravity.clip layout:gravity.start layout:gravity.end"
|
||||
@@ -1333,7 +1333,7 @@
|
||||
<palette title="AbsoluteLayout" icon="/com/intellij/android/designer/icons/AbsoluteLayout.png"
|
||||
tooltip="A layout that lets you specify exact locations (x/y coordinates) of its children. Absolute layouts are less flexible and harder to maintain than other types of layouts without absolute positioning."/>
|
||||
|
||||
<morphing to="RelativeLayout FrameLayout TableLayout GridLayout"/>
|
||||
<morphing to="RelativeLayout"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
@@ -1355,7 +1355,7 @@
|
||||
<palette title="TableLayout" icon="/com/intellij/android/designer/icons/TableLayout.png"
|
||||
tooltip="A layout that arranges its children into rows and columns. A TableLayout consists of a number of TableRow objects, each defining a row (actually, you can have other children, which will be explained below). TableLayout containers do not display border lines for their rows, columns, or cells. Each row has zero or more cells; each cell can hold one View object. The table has as many columns as the row with the most cells. A table can leave cells empty. Cells can span columns, as they can in HTML."/>
|
||||
|
||||
<morphing to="RelativeLayout GridLayout FrameLayout"/>
|
||||
<morphing to="GridLayout RelativeLayout"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
@@ -1396,7 +1396,7 @@
|
||||
expert="layout:gravity.clip layout:gravity.start layout:gravity.end"
|
||||
/>
|
||||
|
||||
<morphing to="TableLayout RelativeLayout FrameLayout"/>
|
||||
<morphing to="TableLayout RelativeLayout"/>
|
||||
|
||||
<palette title="GridLayout" icon="/com/intellij/android/designer/icons/GridLayout.png"
|
||||
tooltip="A layout that places its children in a rectangular grid."/>
|
||||
@@ -1419,8 +1419,6 @@
|
||||
<properties inplace="gravity"
|
||||
important="gravity"/>
|
||||
|
||||
<morphing to="GridLayout TableLayout FrameLayout"/>
|
||||
|
||||
<palette title="RelativeLayout" icon="/com/intellij/android/designer/icons/RelativeLayout.png"
|
||||
tooltip="A Layout where the positions of the children can be described in relation to each other or to the parent."/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user