felipecsl / AsymmetricGridView

Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span
http://felipecsl.com/AsymmetricGridView
MIT License
1.84k stars 431 forks source link

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

Open mateusgrb opened 8 years ago

mateusgrb commented 8 years ago

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?

pishguy commented 8 years ago

are you try "@null"

mateusgrb commented 8 years ago

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

felipe-silvestre-morais commented 8 years ago

@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();
  }
mateusgrb commented 8 years ago

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

salvonos commented 7 years ago

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

mateusgrb commented 7 years ago

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

salvonos commented 7 years ago

@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 !

huzaima12297 commented 3 years ago

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