Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing row & resize behaviour #169

Merged
merged 1 commit into from Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -137,13 +137,11 @@ public boolean updateWidth(float deltaWidth, int column) {
int currentWidth = dataProvider.dataColumns.get(column).width;
float newWidth = currentWidth + deltaWidth;

if(newWidth < dataProvider.minWidth) {
if(newWidth < DataProvider.minWidth) {
return false;
}

if (!updateNeighbour(deltaWidth, column)) {
return false;
}
updateNeighbour(deltaWidth, column);
ViewGroup.LayoutParams params = view.getLayoutParams();
params.width = (int) newWidth;
view.setLayoutParams(params);
Expand Down
Expand Up @@ -99,13 +99,21 @@ private void setMockScrollLayouts() {
FrameLayout.LayoutParams verticalFrameLayout = new FrameLayout.LayoutParams((int) PixelUtils.dpToPx(5), FrameLayout.LayoutParams.MATCH_PARENT);
verticalFrameLayout.gravity = Gravity.RIGHT;
int headerHeight = headerView.getMeasuredHeight() > 0 ? headerView.getMeasuredHeight() : tableView.headerHeight;
verticalFrameLayout.topMargin = headerHeight + extraTopMargin;
verticalFrameLayout.bottomMargin = TableTheme.DefaultRowHeight + extraBottomMargin;
int extraTop = 0;
int extraBottom = 0;
if (tableView.totalsPosition.equals("top")) {
extraTop = tableView.totalsHeight;
} else if(tableView.totalsPosition.equals("bottom")) {
extraBottom = tableView.totalsHeight;
}

verticalFrameLayout.topMargin = headerHeight + extraTop;
verticalFrameLayout.bottomMargin = TableTheme.DefaultRowHeight + extraBottom;
verticalScrollBar.setLayoutParams(verticalFrameLayout);

FrameLayout.LayoutParams horizontalFrameLayout = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, (int) PixelUtils.dpToPx(5));
horizontalFrameLayout.gravity = Gravity.BOTTOM;
horizontalFrameLayout.bottomMargin = TableTheme.DefaultRowHeight;
horizontalFrameLayout.bottomMargin = tableView.totalsHeight;
horizontalFrameLayout.rightMargin = (int) PixelUtils.dpToPx(25);

horizontalScrollView.setLayoutParams(horizontalFrameLayout);
Expand Down Expand Up @@ -172,7 +180,6 @@ protected void createRecyclerViews() {
CustomLinearLayoutManger linearLayout = new CustomLinearLayoutManger(context);
coupledRecyclerView = new CustomRecyclerView(context, false, dataProvider, tableView, linearLayout, dragBox, firstColumnDragBox);
FrameLayout.LayoutParams recyclerViewLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
coupledRecyclerView.setLayoutParams(recyclerViewLayoutParams);
CustomLinearLayoutManger firstColumnLinearLayout = new CustomLinearLayoutManger(context);
firstColumnRecyclerView = new CustomRecyclerView(context, true, dataProvider, tableView, firstColumnLinearLayout, dragBox, firstColumnDragBox);
coupledRecyclerView.setZ(0);
Expand All @@ -185,6 +192,7 @@ protected void createRecyclerViews() {
coupledRecyclerView.setAdapter(dataProvider);

recyclerViewLayoutParams.topMargin = marginTop;
coupledRecyclerView.setLayoutParams(recyclerViewLayoutParams);
rootLayout.addView(coupledRecyclerView, recyclerViewLayoutParams);

firstColumnLinearLayout.recyclerView = firstColumnRecyclerView;
Expand Down Expand Up @@ -387,8 +395,11 @@ public void updateHeaderViewLineCount() {
headerView.setLayoutParams(params);
FrameLayout.LayoutParams recyclerParams = (FrameLayout.LayoutParams) coupledRecyclerView.getLayoutParams();
recyclerParams.topMargin = headerHeight;

if(headerViewFactory.topPosition && totalsView != null) {
recyclerParams.topMargin += tableView.totalsHeight;
} else if(!headerViewFactory.topPosition && totalsView != null) {
recyclerParams.bottomMargin = tableView.totalsHeight;
}
coupledRecyclerView.setLayoutParams(recyclerParams);

Expand Down