Loading core/java/com/android/internal/widget/WeightedLinearLayout.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,8 @@ public class WeightedLinearLayout extends LinearLayout { @Override @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); final boolean isPortrait = metrics.widthPixels < metrics.heightPixels; final int screenWidth = metrics.widthPixels; final boolean isPortrait = screenWidth < metrics.heightPixels; final int widthMode = getMode(widthMeasureSpec); final int widthMode = getMode(widthMeasureSpec); Loading @@ -62,14 +63,13 @@ public class WeightedLinearLayout extends LinearLayout { int height = getMeasuredHeight(); int height = getMeasuredHeight(); boolean measure = false; boolean measure = false; final int widthSize = getSize(widthMeasureSpec); widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, EXACTLY); final float widthWeight = isPortrait ? mMinorWeight : mMajorWeight; final float widthWeight = isPortrait ? mMinorWeight : mMajorWeight; if (widthMode == AT_MOST && widthWeight > 0.0f) { if (widthMode == AT_MOST && widthWeight > 0.0f) { if (width < (widthSize * widthWeight)) { if (width < (screenWidth * widthWeight)) { widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (widthSize * widthWeight), widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (screenWidth * widthWeight), EXACTLY); EXACTLY); measure = true; measure = true; } } Loading core/res/res/layout/alert_dialog.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -28,8 +28,8 @@ android:paddingBottom="3dip" android:paddingBottom="3dip" android:paddingLeft="3dip" android:paddingLeft="3dip" android:paddingRight="1dip" android:paddingRight="1dip" android:majorWeight="0.5" android:majorWeight="0.65" android:minorWeight="0.8"> android:minorWeight="0.9"> <LinearLayout android:id="@+id/topPanel" <LinearLayout android:id="@+id/topPanel" android:layout_width="match_parent" android:layout_width="match_parent" Loading Loading
core/java/com/android/internal/widget/WeightedLinearLayout.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,8 @@ public class WeightedLinearLayout extends LinearLayout { @Override @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); final boolean isPortrait = metrics.widthPixels < metrics.heightPixels; final int screenWidth = metrics.widthPixels; final boolean isPortrait = screenWidth < metrics.heightPixels; final int widthMode = getMode(widthMeasureSpec); final int widthMode = getMode(widthMeasureSpec); Loading @@ -62,14 +63,13 @@ public class WeightedLinearLayout extends LinearLayout { int height = getMeasuredHeight(); int height = getMeasuredHeight(); boolean measure = false; boolean measure = false; final int widthSize = getSize(widthMeasureSpec); widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, EXACTLY); final float widthWeight = isPortrait ? mMinorWeight : mMajorWeight; final float widthWeight = isPortrait ? mMinorWeight : mMajorWeight; if (widthMode == AT_MOST && widthWeight > 0.0f) { if (widthMode == AT_MOST && widthWeight > 0.0f) { if (width < (widthSize * widthWeight)) { if (width < (screenWidth * widthWeight)) { widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (widthSize * widthWeight), widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (screenWidth * widthWeight), EXACTLY); EXACTLY); measure = true; measure = true; } } Loading
core/res/res/layout/alert_dialog.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -28,8 +28,8 @@ android:paddingBottom="3dip" android:paddingBottom="3dip" android:paddingLeft="3dip" android:paddingLeft="3dip" android:paddingRight="1dip" android:paddingRight="1dip" android:majorWeight="0.5" android:majorWeight="0.65" android:minorWeight="0.8"> android:minorWeight="0.9"> <LinearLayout android:id="@+id/topPanel" <LinearLayout android:id="@+id/topPanel" android:layout_width="match_parent" android:layout_width="match_parent" Loading