Loading packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java +13 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import com.android.printspooler.R; /** Loading Loading @@ -126,6 +127,7 @@ public final class PrintOptionsLayout extends ViewGroup { protected void onLayout(boolean changed, int l, int t, int r, int b) { final int childCount = getChildCount(); final int rowCount = childCount / mColumnCount + childCount % mColumnCount; final boolean isLayoutRtl = isLayoutRtl(); int cellStart = getPaddingStart(); int cellTop = getPaddingTop(); Loading @@ -134,7 +136,13 @@ public final class PrintOptionsLayout extends ViewGroup { int rowHeight = 0; for (int col = 0; col < mColumnCount; col++) { final int childIndex = row * mColumnCount + col; final int childIndex; if (isLayoutRtl) { // if RTL, layout the right most child first childIndex = row * mColumnCount + (mColumnCount - col - 1); } else { childIndex = row * mColumnCount + col; } if (childIndex >= childCount) { break; Loading @@ -148,14 +156,14 @@ public final class PrintOptionsLayout extends ViewGroup { MarginLayoutParams childParams = (MarginLayoutParams) child.getLayoutParams(); final int childLeft = cellStart + childParams.getMarginStart(); final int childStart = cellStart + childParams.getMarginStart(); final int childTop = cellTop + childParams.topMargin; final int childRight = childLeft + child.getMeasuredWidth(); final int childEnd = childStart + child.getMeasuredWidth(); final int childBottom = childTop + child.getMeasuredHeight(); child.layout(childLeft, childTop, childRight, childBottom); child.layout(childStart, childTop, childEnd, childBottom); cellStart = childRight + childParams.getMarginEnd(); cellStart = childEnd + childParams.getMarginEnd(); rowHeight = Math.max(rowHeight, child.getMeasuredHeight() + childParams.topMargin + childParams.bottomMargin); Loading Loading
packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java +13 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import com.android.printspooler.R; /** Loading Loading @@ -126,6 +127,7 @@ public final class PrintOptionsLayout extends ViewGroup { protected void onLayout(boolean changed, int l, int t, int r, int b) { final int childCount = getChildCount(); final int rowCount = childCount / mColumnCount + childCount % mColumnCount; final boolean isLayoutRtl = isLayoutRtl(); int cellStart = getPaddingStart(); int cellTop = getPaddingTop(); Loading @@ -134,7 +136,13 @@ public final class PrintOptionsLayout extends ViewGroup { int rowHeight = 0; for (int col = 0; col < mColumnCount; col++) { final int childIndex = row * mColumnCount + col; final int childIndex; if (isLayoutRtl) { // if RTL, layout the right most child first childIndex = row * mColumnCount + (mColumnCount - col - 1); } else { childIndex = row * mColumnCount + col; } if (childIndex >= childCount) { break; Loading @@ -148,14 +156,14 @@ public final class PrintOptionsLayout extends ViewGroup { MarginLayoutParams childParams = (MarginLayoutParams) child.getLayoutParams(); final int childLeft = cellStart + childParams.getMarginStart(); final int childStart = cellStart + childParams.getMarginStart(); final int childTop = cellTop + childParams.topMargin; final int childRight = childLeft + child.getMeasuredWidth(); final int childEnd = childStart + child.getMeasuredWidth(); final int childBottom = childTop + child.getMeasuredHeight(); child.layout(childLeft, childTop, childRight, childBottom); child.layout(childStart, childTop, childEnd, childBottom); cellStart = childRight + childParams.getMarginEnd(); cellStart = childEnd + childParams.getMarginEnd(); rowHeight = Math.max(rowHeight, child.getMeasuredHeight() + childParams.topMargin + childParams.bottomMargin); Loading