AsymmetricGridView icon indicating copy to clipboard operation
AsymmetricGridView copied to clipboard

Is it possible to remove the vertical white spaces between the items?

Open mateusgrb opened this issue 10 years ago • 8 comments

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?

mateusgrb avatar Oct 16 '15 21:10 mateusgrb

are you try "@null"

pishguy avatar Oct 18 '15 08:10 pishguy

Thanks, I tried it now but it still doesn't work. I keep getting the vertical white lines.

mateusgrb avatar Oct 19 '15 10:10 mateusgrb

@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();
  }

felipe-silvestre-morais avatar Dec 10 '15 13:12 felipe-silvestre-morais

Thanks @felipe-silvestre-movile for your answer. The solution I ended up with is here: https://github.com/mateusgrb/AsymmetricGridView/commit/bdc088460492c80a25654a7862b501bf765e15a9

mateusgrb avatar Dec 10 '15 13:12 mateusgrb

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 avatar Jan 04 '17 14:01 salvonos

@salvonos I had to fork this repo, make my changes, then add it manually to my project as a git submodule.

mateusgrb avatar Jan 04 '17 14:01 mateusgrb

@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 avatar Jan 04 '17 16:01 salvonos

@salvonos please can you help me in changing the vertical border

huzaima12297 avatar Apr 26 '21 21:04 huzaima12297