Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f8956d8 authored by Philip Milne's avatar Philip Milne
Browse files

Introduction of GridLayout.

Change-Id: Ia2ec315e7d29dcc5aa13b080fc6ce00708e9c034
parent 73a4b2b3
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
@@ -301,7 +301,9 @@ package android {
    field public static final int colorBackgroundCacheHint = 16843435; // 0x10102ab
    field public static final int colorForeground = 16842800; // 0x1010030
    field public static final int colorForegroundInverse = 16843270; // 0x1010206
    field public static final int columnCount = 16843633; // 0x1010371
    field public static final int columnDelay = 16843215; // 0x10101cf
    field public static final int columnOrderPreserved = 16843634; // 0x1010372
    field public static final int columnWidth = 16843031; // 0x1010117
    field public static final int completionHint = 16843122; // 0x1010172
    field public static final int completionHintView = 16843123; // 0x1010173
@@ -575,6 +577,8 @@ package android {
    field public static final int layout_centerInParent = 16843151; // 0x101018f
    field public static final int layout_centerVertical = 16843153; // 0x1010191
    field public static final int layout_column = 16843084; // 0x101014c
    field public static final int layout_columnSpan = 16843639; // 0x1010377
    field public static final int layout_columnWeight = 16843640; // 0x1010378
    field public static final int layout_gravity = 16842931; // 0x10100b3
    field public static final int layout_height = 16842997; // 0x10100f5
    field public static final int layout_margin = 16842998; // 0x10100f6
@@ -582,6 +586,9 @@ package android {
    field public static final int layout_marginLeft = 16842999; // 0x10100f7
    field public static final int layout_marginRight = 16843001; // 0x10100f9
    field public static final int layout_marginTop = 16843000; // 0x10100f8
    field public static final int layout_row = 16843636; // 0x1010374
    field public static final int layout_rowSpan = 16843637; // 0x1010375
    field public static final int layout_rowWeight = 16843638; // 0x1010376
    field public static final int layout_scale = 16843155; // 0x1010193
    field public static final int layout_span = 16843085; // 0x101014d
    field public static final int layout_toLeftOf = 16843138; // 0x1010182
@@ -751,9 +758,11 @@ package android {
    field public static final int rotation = 16843558; // 0x1010326
    field public static final int rotationX = 16843559; // 0x1010327
    field public static final int rotationY = 16843560; // 0x1010328
    field public static final int rowCount = 16843631; // 0x101036f
    field public static final int rowDelay = 16843216; // 0x10101d0
    field public static final int rowEdgeFlags = 16843329; // 0x1010241
    field public static final int rowHeight = 16843058; // 0x1010132
    field public static final int rowOrderPreserved = 16843632; // 0x1010370
    field public static final int saveEnabled = 16842983; // 0x10100e7
    field public static final int scaleGravity = 16843262; // 0x10101fe
    field public static final int scaleHeight = 16843261; // 0x10101fd
@@ -984,6 +993,7 @@ package android {
    field public static final int unfocusedMonthDateColor = 16843588; // 0x1010344
    field public static final int unselectedAlpha = 16843278; // 0x101020e
    field public static final int updatePeriodMillis = 16843344; // 0x1010250
    field public static final int useDefaultMargins = 16843635; // 0x1010373
    field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310
    field public static final int useLevel = 16843167; // 0x101019f
    field public static final int userVisible = 16843409; // 0x1010291
@@ -24167,6 +24177,67 @@ package android.widget {
    ctor public Gallery.LayoutParams(android.view.ViewGroup.LayoutParams);
  }
  public class GridLayout extends android.view.ViewGroup {
    ctor public GridLayout(android.content.Context);
    ctor public GridLayout(android.content.Context, android.util.AttributeSet, int);
    ctor public GridLayout(android.content.Context, android.util.AttributeSet);
    method public int getColumnCount();
    method public int getOrientation();
    method public int getRowCount();
    method public boolean getUseDefaultMargins();
    method public boolean isColumnOrderPreserved();
    method public boolean isRowOrderPreserved();
    method protected void onLayout(boolean, int, int, int, int);
    method public void setColumnCount(int);
    method public void setColumnOrderPreserved(boolean);
    method public void setOrientation(int);
    method public void setRowCount(int);
    method public void setRowOrderPreserved(boolean);
    method public void setUseDefaultMargins(boolean);
    field public static final android.widget.GridLayout.Alignment BASELINE;
    field public static final android.widget.GridLayout.Alignment BOTTOM;
    field public static final android.widget.GridLayout.Alignment CENTER;
    field public static final android.widget.GridLayout.Alignment FILL;
    field public static final int HORIZONTAL = 0; // 0x0
    field public static final android.widget.GridLayout.Alignment LEFT;
    field public static final android.widget.GridLayout.Alignment RIGHT;
    field public static final android.widget.GridLayout.Alignment TOP;
    field public static final int VERTICAL = 1; // 0x1
  }
  public static abstract interface GridLayout.Alignment {
    method public abstract int getAlignmentValue(android.view.View, int);
    method public abstract int getSizeInCell(android.view.View, int, int);
  }
  public static class GridLayout.Group {
    ctor public GridLayout.Group(android.widget.GridLayout.Interval, android.widget.GridLayout.Alignment);
    ctor public GridLayout.Group(int, int, android.widget.GridLayout.Alignment);
    ctor public GridLayout.Group(int, android.widget.GridLayout.Alignment);
    field public final android.widget.GridLayout.Alignment alignment;
    field public final android.widget.GridLayout.Interval span;
  }
  public static class GridLayout.Interval {
    ctor public GridLayout.Interval(int, int);
    field public final int max;
    field public final int min;
  }
  public static class GridLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public GridLayout.LayoutParams(android.widget.GridLayout.Group, android.widget.GridLayout.Group);
    ctor public GridLayout.LayoutParams();
    ctor public GridLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public GridLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public GridLayout.LayoutParams(android.widget.GridLayout.LayoutParams);
    ctor public GridLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    method public void setGravity(int);
    field public android.widget.GridLayout.Group columnGroup;
    field public float columnWeight;
    field public android.widget.GridLayout.Group rowGroup;
    field public float rowWeight;
  }
  public class GridView extends android.widget.AbsListView {
    ctor public GridView(android.content.Context);
    ctor public GridView(android.content.Context, android.util.AttributeSet);
@@ -25049,6 +25120,12 @@ package android.widget {
    method public abstract void onScrollStarted();
  }
  public final class Space extends android.view.View {
    ctor public Space(android.content.Context, android.util.AttributeSet, int);
    ctor public Space(android.content.Context, android.util.AttributeSet);
    ctor public Space(android.content.Context);
  }
  public class Spinner extends android.widget.AbsSpinner implements android.content.DialogInterface.OnClickListener {
    ctor public Spinner(android.content.Context);
    ctor public Spinner(android.content.Context, int);
+2036 −0

File added.

Preview size limit exceeded, changes collapsed.

+75 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * 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 android.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

/**
 * Space is a lightweight View subclass that may be used to create gaps between components
 * in general purpose layouts.
 */
public final class Space extends View {
    /**
     * {@inheritDoc}
     */
    public Space(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    /**
     * {@inheritDoc}
     */
    public Space(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * {@inheritDoc}
     */
    public Space(Context context) {
        super(context);
    }

    /**
     * Draw nothing.
     *
     * @param canvas an unused parameter.
     */
    @Override
    public void draw(Canvas canvas) {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ViewGroup.LayoutParams getLayoutParams() {
        return super.getLayoutParams();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setLayoutParams(ViewGroup.LayoutParams params) {
        super.setLayoutParams(params);
    }
}
+62 −0
Original line number Diff line number Diff line
@@ -2429,6 +2429,36 @@
        <!-- Size of padding on either end of a divider. -->
        <attr name="dividerPadding" format="dimension" />
    </declare-styleable>
    <declare-styleable name="GridLayout">
        <!-- The orientation property is not used during layout. It is only used to
        allocate row and column prameters when they are not specified by its children's
        layout paramters. GridLayout works like LinearLayout in this case;
        putting all the components either in a single row or in a single column -
        depending on the value of this flag. In the horozintal case, a columnCount
        property may be additionally supplied to force new rows to be created when a
        row is full. The rowCount attribute may be used similarly in the vertical case.
        The default is horizontal. -->
        <attr name="orientation" />
        <!-- The maxmimum number of rows to create when automatically positioning children. -->
        <attr name="rowCount" format="integer" />
        <!-- The maxmimum number of columns to create when automatically positioning children. -->
        <attr name="columnCount" format="integer" />
        <!-- When set to true, tells GridLayout to use default margins when none are specified
        in a view's layout parameters.
        The default value is false.
        See {@link android.widget.GridLayout#setUseDefaultMargins(boolean)}.-->
        <attr name="useDefaultMargins" format="boolean" />
        <!-- When set to true, forces row boundaries to appear in the same order
        as row indices.
        The default is false.
        See {@link android.widget.GridLayout#setRowOrderPreserved(boolean)}.-->
        <attr name="rowOrderPreserved" format="boolean" />
        <!-- When set to true, forces column boundaries to appear in the same order
        as column indices.
        The default is false.
        See {@link android.widget.GridLayout#setColumnOrderPreserved(boolean)}.-->
        <attr name="columnOrderPreserved" format="boolean" />
    </declare-styleable>
    <declare-styleable name="ListView">
        <!-- Reference to an array resource that will populate the ListView.  For static content,
             this is simpler than populating the ListView programmatically. -->
@@ -3128,6 +3158,38 @@
        <attr name="layout_weight" format="float" />
        <attr name="layout_gravity" />
    </declare-styleable>
    <declare-styleable name="GridLayout_Layout">
        <!-- The row boundary delimiting the top of the group of cells
        occupied by this view. -->
        <attr name="layout_row" format="integer" />
        <!-- The row span: the difference between the bottom and top
        boundaries delimiting the group of cells occupied by this view.
        The default is one.
        See {@link android.widget.GridLayout.Group#span}. -->
        <attr name="layout_rowSpan" format="integer" min="1" />
        <!-- A number indicating the relative proportion of availible space that
        should be taken by this group of cells.
        The default is zero.
        See {@link android.widget.GridLayout.LayoutParams#columnWeight}. -->
        <attr name="layout_rowWeight" format="float" />
        <!-- The column boundary delimiting the left of the group of cells
        occupied by this view. -->
        <attr name="layout_column" />
        <!-- The column span: the difference between the right and left
        boundaries delimiting the group of cells occupied by this view.
        The default is one.
        See {@link android.widget.GridLayout.Group#span}. -->
        <attr name="layout_columnSpan" format="integer" min="1" />
        <!-- A number indicating the relative proportion of availible space that
        should be taken by this group of cells.
        The default is zero.
        See {@link android.widget.GridLayout.LayoutParams#columnWeight}.-->
        <attr name="layout_columnWeight" format="float" />
        <!-- Gravity specifies how a component should be placed in its group of cells.
        The default is LEFT | BASELINE.
        See {@link android.widget.GridLayout.LayoutParams#setGravity(int)}. -->
        <attr name="layout_gravity" />
    </declare-styleable>
    <declare-styleable name="FrameLayout_Layout">
        <attr name="layout_gravity" />
    </declare-styleable>
+13 −0
Original line number Diff line number Diff line
@@ -1672,4 +1672,17 @@
  <public type="attr" name="fullBackupAgent" />
  <public type="attr" name="suggestionsEnabled" />

  <public type="attr" name="rowCount" />
  <public type="attr" name="rowOrderPreserved" />
  <public type="attr" name="columnCount" />
  <public type="attr" name="columnOrderPreserved" />
  <public type="attr" name="useDefaultMargins" />

  <public type="attr" name="layout_row" />
  <public type="attr" name="layout_rowSpan" />

  <public type="attr" name="layout_rowWeight" />
  <public type="attr" name="layout_columnSpan" />
  <public type="attr" name="layout_columnWeight" />

</resources>
Loading