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
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. |
1 |
0x00000001 |
int |
CENTER_VERTICAL |
Vertical alignment: Align center vertically. |
16 |
0x00000010 |
int |
LEFT |
Horizontal alignment: Align left. |
3 |
0x00000003 |
int |
MODE_MAP |
Layout mode: map relative. |
0 |
0x00000000 |
int |
MODE_VIEW |
Layout mode: map view relative. |
1 |
0x00000001 |
int |
RIGHT |
Horizontal alignment: Align right. |
5 |
0x00000005 |
int |
TOP |
Vertical alignment: Align top. |
48 |
0x00000030 |
int |
TOP_LEFT |
Alignment: Align to top left. |
51 |
0x00000033 |
|
|
|
Value |
|
int |
FILL_PARENT |
Special value for the height or width requested by a View. |
-1 |
0xffffffff |
int |
WRAP_CONTENT |
Special value for the height or width requested by a View. |
-2 |
0xfffffffe |
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. |
Public Constructors
|
|
|
|
|
|
MapView.LayoutParams(int width, int height, GeoPoint point, int alignment) |
|
|
|
|
|
|
MapView.LayoutParams(int width, int height, GeoPoint point, int x, int y, int alignment) |
|
|
|
|
|
|
MapView.LayoutParams(int width, int height, int x, int y, int alignment) |
|
|
|
|
|
|
MapView.LayoutParams(Context c, AttributeSet attrs) |
|
|
|
|
|
|
MapView.LayoutParams(ViewGroup.LayoutParams source) |
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
int
BOTTOM
Horizontal alignment: Align bottom.
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.
Constant Value:
81
(0x00000051)
public
static
final
int
CENTER
Alignment: Align center in both dimensions.
Constant Value:
17
(0x00000011)
public
static
final
int
CENTER_HORIZONTAL
Horizontal alignment: Align center horizontally.
Constant Value:
1
(0x00000001)
public
static
final
int
CENTER_VERTICAL
Vertical alignment: Align center vertically.
Constant Value:
16
(0x00000010)
public
static
final
int
LEFT
Horizontal alignment: Align left.
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.
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.
Constant Value:
1
(0x00000001)
public
static
final
int
RIGHT
Horizontal alignment: Align right.
Constant Value:
5
(0x00000005)
public
static
final
int
TOP
Vertical alignment: Align top.
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}.
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.
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.
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 |
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. |
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 Methods
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 }"