Home | History | Annotate | Download | only in layout
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.eclipse.org/org/documents/epl-v10.php
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.ide.common.layout;
     18 
     19 import com.android.annotations.NonNull;
     20 import com.android.annotations.Nullable;
     21 import com.android.ide.common.api.DropFeedback;
     22 import com.android.ide.common.api.IDragElement;
     23 import com.android.ide.common.api.INode;
     24 
     25 /**
     26  * An ignored layout is a layout that should not be treated as a layout by the
     27  * visual editor (usually because the widget extends a layout class we recognize
     28  * and support, but where the widget is more restrictive in how it manages its
     29  * children so we don't want to expose the normal configuration options).
     30  * <p>
     31  * For example, the ZoomControls widget is not user-configurable as a
     32  * LinearLayout even though it extends it. Our ZoomControls rule is therefore a
     33  * subclass of this {@link IgnoredLayoutRule} class.
     34  */
     35 public abstract class IgnoredLayoutRule extends BaseLayoutRule {
     36     @Override
     37     public DropFeedback onDropEnter(@NonNull INode targetNode, @Nullable Object targetView,
     38             @Nullable IDragElement[] elements) {
     39         // Do nothing; this layout rule corresponds to a layout that
     40         // should not be handled as a layout by the visual editor - usually
     41         // because some widget is extending a layout for implementation purposes
     42         // but does not want to expose configurability of the base layout in the
     43         // editor.
     44         return null;
     45     }
     46 }
     47