Skip to content

Commit

Permalink
[ButtonToggleGroup] Fixed a bug of setting inner buttons in vertical …
Browse files Browse the repository at this point in the history
…layout.

PiperOrigin-RevId: 631588360
  • Loading branch information
pekingme authored and dsn5ft committed May 9, 2024
1 parent 9da9993 commit 7c9f372
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,13 @@ private void adjustChildMarginsAndUpdateLayout() {

LayoutParams params = buildLayoutParams(currentButton);
if (getOrientation() == HORIZONTAL) {
MarginLayoutParamsCompat.setMarginEnd(params, 0);
MarginLayoutParamsCompat.setMarginStart(params, spacing - smallestStrokeWidth);
params.setMarginEnd(0);
params.setMarginStart(spacing - smallestStrokeWidth);
params.topMargin = 0;
} else {
params.bottomMargin = 0;
params.topMargin = spacing - smallestStrokeWidth;
MarginLayoutParamsCompat.setMarginEnd(params, 0);
params.setMarginStart(0);
}

currentButton.setLayoutParams(params);
Expand Down

0 comments on commit 7c9f372

Please sign in to comment.