Page 1206 - 3-3
P. 1206
float lRoot_Width = 0;
float lRoot_Height = 0;
for(int tryi = 0 ; tryi < 3 ; tryi++) {
float lScale_Ratio_Pre = Math.min(lRoot_Width_Max / mScale_Root_Width,
lRoot_Height_Max / mScale_Root_Height);
// log(String.format("onMeasure 1 lScale_Ratio:%5.3f Scale_Ratio:(%5.3f,
%5.3f) Scale:(%5.3f, %5.3f)",
// lScale_Ratio_Pre, (lRoot_Width_Max/mScale_Root_Width),
(lRoot_Height_Max / mScale_Root_Height), mScale_Root_Width, mScale_Root_Height));
//////////////////////// Text Measure
// TODO english
// ScalableLayout 내의 TextView 중에 TextView_WrapContent_Direction 세팅되어 있을 경
우 ScalableLayout 의 Scale Size 와 이웃한 View 들의 Scalable LayoutParams 를 재계산
for (int i=0;i<getChildCount();i++) {
View lView = getChildAt(i);
if(lView instanceof TextView) {
updateTextViewSize((TextView)lView, lScale_Ratio_Pre);
}
}
// calculate final size of ScalableLayout
// ScalableLayout 의 최종적인 크기를 결정지음
float lScale_Ratio_Post = Math.min(lRoot_Width_Max / mScale_Root_Width,
lRoot_Height_Max / mScale_Root_Height);
{
lRoot_Width = mScale_Root_Width * lScale_Ratio_Post;
lRoot_Height = mScale_Root_Height * lScale_Ratio_Post;
}
{
// 최종적으로 배치 위치를 세팅하기 위해 각 자식 뷰들의 layoutparams 를 업데이트함
// update layoutparams of each child view to arrange finally
// log(" onMeasure ("+lRoot_Width+","+lRoot_Height+")
Ratio:"+mRatioOfWidthHeight+" lScale_TextViewMeasure_Post:"+lScale_Ratio_Post+"
lTopMarginFromWeight:"+lTopMarginFromWeight);
for (int i=0;i<getChildCount();i++) {
View lView = getChildAt(i);
ScalableLayout.LayoutParams lParams = getChildLayoutParams(lView);
- 1206 -