Skip to content

Commit

Permalink
fix(MD-3980): set padding to 50 dips like iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
vcellu authored and enell committed Mar 7, 2023
1 parent 58650fd commit 618ac1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public CustomHorizontalScrollView(Context context, TableView tableView) {
public int getOverScrollOffset() {
int scrollRange = computeHorizontalScrollRange();
int scrollX = computeHorizontalScrollOffset();
return scrollX + getMeasuredWidth() - scrollRange + (int) PixelUtils.dpToPx(25);
return scrollX + getMeasuredWidth() - scrollRange + TableTheme.HorizontalScrollViewPadding;
}

@Override
Expand All @@ -39,7 +39,7 @@ protected void onScrollChanged(int l, int t, int oldl, int oldt) {
return;
}

horizontalScrollBar.setContentWidth(scrollRange);
horizontalScrollBar.setContentWidth(scrollRange + TableTheme.HorizontalScrollViewPadding);
horizontalScrollBar.setScrollX(scrollX);

verticalScrollBar.setOverScrollOffset(getOverScrollOffset());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class TableTheme {

static int backgroundColor = Color.WHITE;

static int HorizontalScrollViewPadding = (int)PixelUtils.dpToPx(50);


static void updateFrom(ReadableMap theme) {
String headerBackgroundColorString = JsonUtils.getString(theme, "headerBackgroundColor", "#404040");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void setMockScrollLayouts() {
FrameLayout.LayoutParams horizontalFrameLayout = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, (int) PixelUtils.dpToPx(5));
horizontalFrameLayout.gravity = Gravity.BOTTOM;
horizontalFrameLayout.bottomMargin = TableTheme.DefaultRowHeight;
horizontalFrameLayout.rightMargin = (int) PixelUtils.dpToPx(25);
horizontalFrameLayout.rightMargin = TableTheme.HorizontalScrollViewPadding;

horizontalScrollView.setLayoutParams(horizontalFrameLayout);
}
Expand Down Expand Up @@ -170,7 +170,7 @@ protected void createScrollView() {

protected void createRootLayout() {
this.rootLayout = new RootLayout(context, columnWidths);
this.rootLayout.setPadding(0,0, (int) PixelUtils.dpToPx(25),0);
this.rootLayout.setPadding(0,0, TableTheme.HorizontalScrollViewPadding, 0);
this.rootLayout.addView(dragBox);
this.rootLayout.setZ(PixelUtils.dpToPx(1));

Expand Down

0 comments on commit 618ac1d

Please sign in to comment.