正文
getVisibility
()
!=
GONE
)
{
LayoutParams
params
=
(
LayoutParams
)
child
.
getLayoutParams
();
applyVerticalSizeRules
(
params
,
myHeight
);
measureChild
(
child
,
params
,
myWidth
,
myHeight
);
if
(
positionChildVertical
(
child
,
params
,
myHeight
,
isWrapContentHeight
))
{
offsetVerticalAxis
=
true
;
}
if
(
isWrapContentWidth
)
{
if
(
isLayoutRtl
())
{
if
(
targetSdkVersion
Build
.
VERSION_CODES
.
KITKAT
)
{
width
=
Math
.
max
(
width
,
myWidth
-
params
.
mLeft
);
}
else
{
width
=
Math
.
max
(
width
,
myWidth
-
params
.
mLeft
-
params
.
leftMargin
);
}
}
else
{
if
(
targetSdkVersion
Build
.
VERSION_CODES
.
KITKAT
)
{
width
=
Math
.
max
(
width
,
params
.
mRight
);
}
else
{
width
=
Math
.
max
(
width
,
params
.
mRight
+
params
.
rightMargin
);
}
}
}
if
(
isWrapContentHeight
)
{
if
(
targetSdkVersion
Build
.
VERSION_CODES
.
KITKAT
)
{
height
=
Math
.
max