AsymmetricGridView
AsymmetricGridView copied to clipboard
Is it possible to remove the vertical white spaces between the items?
I would like to show no borders/dividers between items. By adding "android:divider="@android:color/transparent"", I get rid of the horizontal dividers, but how can I remove the vertical ones too?
are you try "@null"
Thanks, I tried it now but it still doesn't work. I keep getting the vertical white lines.
@mateusgrb To remove the dividers and the empty space, change the files AsymmetricGridViewAdapter and IcsLinearLayout below to:
AsymmetricGridViewAdapter.java
protected int getRowWidth(int columnSpan) {
final int rowWidth = listView.getColumnWidth() * columnSpan;
int value = rowWidth + listView.getRequestedHorizontalSpacing();
return Math.min(value, Utils.getScreenWidth(context));
}
IcsLinearLayout.java
public void setDividerDrawable(Drawable divider) {
if (divider == mDivider) {
return;
}
//Fix for issue #379
if (divider instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
divider = new IcsColorDrawable((ColorDrawable) divider);
}
mDivider = divider;
if (divider != null) {
mDividerWidth = 0;
mDividerHeight = 0;
} else {
mDividerWidth = 0;
mDividerHeight = 0;
}
setWillNotDraw(divider == null);
requestLayout();
}
Thanks @felipe-silvestre-movile for your answer. The solution I ended up with is here: https://github.com/mateusgrb/AsymmetricGridView/commit/bdc088460492c80a25654a7862b501bf765e15a9
I am having the same issue. I need to remove the white vertical divider. But I cannot find AdapterImpl.java file. I have added the library using grandle
@salvonos I had to fork this repo, make my changes, then add it manually to my project as a git submodule.
@mateusgrp Thanks I have done the same but instead of modify the java I have modified the color of the divider in the xml using a transparent color. Working fine now !
@salvonos please can you help me in changing the vertical border