OSDN Git Service

Deemphasize AbsoluteLayout
authorTor Norbye <tnorbye@google.com>
Fri, 28 Jan 2011 03:42:29 +0000 (19:42 -0800)
committerTor Norbye <tnorbye@google.com>
Sat, 29 Jan 2011 16:49:56 +0000 (08:49 -0800)
Move AbsoluteLayout out of the Layout category in the palette, and
into the "Advanced" category.  Also add selection hints for the
absolute which explains that AbsoluteLayout is deprecated.

Change-Id: I2b1633e90794bdec7b7a0d3171f9a29eb25dd258

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml

index 2fa20ea..4af4559 100644 (file)
@@ -30,6 +30,8 @@ import com.android.ide.common.api.Point;
 import com.android.ide.common.api.Rect;
 import com.android.util.Pair;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -38,6 +40,14 @@ import java.util.Map;
  */
 public class AbsoluteLayoutRule extends BaseLayoutRule {
 
+    @Override
+    public List<String> getSelectionHint(INode parentNode, INode childNode) {
+        List<String> infos = new ArrayList<String>(2);
+        infos.add("AbsoluteLayout is deprecated.");
+        infos.add("Use other layouts instead.");
+        return infos;
+    }
+
     // ==== Drag'n'drop support ====
     // The AbsoluteLayout accepts any drag'n'drop anywhere on its surface.
 
index 9fa235b..627c2e9 100644 (file)
@@ -47,7 +47,6 @@
         <view class="android.widget.LinearLayout" fill="opposite" render="skip"/>
         <view class="android.widget.RelativeLayout" fill="opposite" render="skip"/>
         <view class="android.widget.FrameLayout" fill="opposite" render="skip"/>
-        <view class="android.widget.AbsoluteLayout" fill="opposite" render="skip"/>
         <view class="android.widget.TableLayout" fill="opposite" render="skip"/>
         <view class="android.widget.TableRow" fill="opposite" render="skip"/>
     </category>
@@ -99,6 +98,7 @@
         <view class="include" skip="true" render="skip"/>
         <view class="merge" skip="true" render="skip"/>
         <view class="android.widget.DialerFilter" fill="width_in_vertical" render="skip"/>
+        <view class="android.widget.AbsoluteLayout" fill="opposite" render="skip"/>
     </category>
     <category name="Other">
         <!--  This is the catch-all category which contains unknown views if we encounter any -->