Android
com.google.android.maps
public static class

com.google.android.maps.MapView.LayoutParams

java.lang.Object
android.view.ViewGroup.LayoutParams
com.google.android.maps.MapView.LayoutParams

Per-child layout information associated with MapView. Child views can be laid out either positioned with respect to the MapView (MODE_VIEW), or positioned with respect to the map that is being displayed by the MapView (MODE_MAP).

Summary

XML Attributes inherited from class android.view.ViewGroup.LayoutParams

Constants

      Value  
int  BOTTOM  Horizontal alignment: Align bottom.  80  0x00000050 
int  BOTTOM_CENTER  Alignment: Align to bottom vertically, center horizontally.  81  0x00000051 
int  CENTER  Alignment: Align center in both dimensions.  17  0x00000011 
int  CENTER_HORIZONTAL  Horizontal alignment: Align center horizontally.  0x00000001 
int  CENTER_VERTICAL  Vertical alignment: Align center vertically.  16  0x00000010 
int  LEFT  Horizontal alignment: Align left.  0x00000003 
int  MODE_MAP  Layout mode: map relative.  0x00000000 
int  MODE_VIEW  Layout mode: map view relative.  0x00000001 
int  RIGHT  Horizontal alignment: Align right.  0x00000005 
int  TOP  Vertical alignment: Align top.  48  0x00000030 
int  TOP_LEFT  Alignment: Align to top left.  51  0x00000033 
Constants inherited from class android.view.ViewGroup.LayoutParams

Fields

public      int  alignment  Placement of child relative to the location. 
public      int  mode  The layout mode. 
public      GeoPoint  point  The location of the child on the map. 
public      int  x  The x location of the child relative to the view. 
public      int  y  The y location of the child relative to the view. 
Fields inherited from class android.view.ViewGroup.LayoutParams

Public Constructors

            MapView.LayoutParams(int width, int height, GeoPoint point, int alignment)
Creates a new set of layout parameters with the specified width, height and location.
            MapView.LayoutParams(int width, int height, GeoPoint point, int x, int y, int alignment)
Creates a new set of layout parameters with the specified width, height and location.
            MapView.LayoutParams(int width, int height, int x, int y, int alignment)
Creates a new set of layout parameters with the specified width, height and location.
            MapView.LayoutParams(Context c, AttributeSet attrs)
Creates a new set of layout parameters.
            MapView.LayoutParams(ViewGroup.LayoutParams source)

Defaults to mode MODE_VIEW and alignment TOP_LEFT.

Public Methods

          String  debug(String output)
Returns a String representation of this set of layout parameters.
Methods inherited from class android.view.ViewGroup.LayoutParams
Methods inherited from class java.lang.Object

Details

Constants

public static final int BOTTOM

Horizontal alignment: Align bottom.

See Also

Constant Value: 80 (0x00000050)

public static final int BOTTOM_CENTER

Alignment: Align to bottom vertically, center horizontally. This is useful for views that look like pins or cartoon speech balloons.

See Also

Constant Value: 81 (0x00000051)

public static final int CENTER

Alignment: Align center in both dimensions.

See Also

Constant Value: 17 (0x00000011)

public static final int CENTER_HORIZONTAL

Horizontal alignment: Align center horizontally.

See Also

Constant Value: 1 (0x00000001)

public static final int CENTER_VERTICAL

Vertical alignment: Align center vertically.

See Also

Constant Value: 16 (0x00000010)

public static final int LEFT

Horizontal alignment: Align left.

See Also

Constant Value: 3 (0x00000003)

public static final int MODE_MAP

Layout mode: map relative. The child view's position will change when the map scrolls or zooms.

See Also

Constant Value: 0 (0x00000000)

public static final int MODE_VIEW

Layout mode: map view relative. The child view's position will stay fixed relative to the parent view, and will not move when the map scrolls or zooms.

See Also

Constant Value: 1 (0x00000001)

public static final int RIGHT

Horizontal alignment: Align right.

See Also

Constant Value: 5 (0x00000005)

public static final int TOP

Vertical alignment: Align top.

See Also

Constant Value: 48 (0x00000030)

public static final int TOP_LEFT

Alignment: Align to top left. This is the way views are normally aligned, for example it's how they are aligned by (@link AbsoluteLayout}.

See Also

Constant Value: 51 (0x00000033)

Fields

public int alignment

Placement of child relative to the location. Similar to the Gravity class, except the alignment is relative to a point rather than an enclosing rectangle. You can or-together horizontal and vertical alignment to create a complete alignment specification, or you can use one of the predefined specifications TOP_LEFT , CENTER or BOTTOM_CENTER.

public int mode

The layout mode.

See Also

public GeoPoint point

The location of the child on the map. Used when mode == MODE_MAP.

public int x

The x location of the child relative to the view. Used when mode == MODE_VIEW

public int y

The y location of the child relative to the view. Used when mode == MODE_VIEW

Public Constructors

public MapView.LayoutParams(int width, int height, GeoPoint point, int alignment)

Creates a new set of layout parameters with the specified width, height and location. This constructor sets the mode member variable to (@link #MODE_MAP}, which means the child view will be laid out relative to the map that is displayed within the parent view.

Parameters

width The width, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels.
height The height, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels.
point The location of the child.
alignment The alignment to use.

See Also

public MapView.LayoutParams(int width, int height, GeoPoint point, int x, int y, int alignment)

Creates a new set of layout parameters with the specified width, height and location. This constructor sets the mode member variable to (@link #MODE_MAP}, which means the child view will be laid out relative to the map that is displayed within the parent view.

Parameters

width the width, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels
height the height, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels
point the location of the child on the map
x the offset of the child in pixels from point
y the offset of the child in pixels from point
alignment the alignment to use

See Also

public MapView.LayoutParams(int width, int height, int x, int y, int alignment)

Creates a new set of layout parameters with the specified width, height and location. This constructor sets the mode member variable to MODE_VIEW, which means the child view will be laid out relative to the parent view.

Parameters

width The width, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels.
height The height, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels.
x The location of the child relative to the view.
y The location of the child relative to the view.
alignment The alignment to use.

See Also

public MapView.LayoutParams(Context c, AttributeSet attrs)

Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context.

Due to a limitation of the UI framework, it is not possible to define our own XML attribute, so we are limited to supporting the standard XML attributes we inherit from our parent class.

The XML attributes mapped to this set of layout parameters are:

Parameters

c The application environment.
attrs The set of attributes from which to extract the layout parameters values.

public MapView.LayoutParams(ViewGroup.LayoutParams source)

Defaults to mode MODE_VIEW and alignment TOP_LEFT.

Public Methods

public String debug(String output)

Returns a String representation of this set of layout parameters.

Parameters

output the String to prepend to the internal representation

Returns

  • a String with the following format: output + "ViewGroup.LayoutParams={ width=WIDTH, height=HEIGHT }"
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56