AndroidStaggeredGrid icon indicating copy to clipboard operation
AndroidStaggeredGrid copied to clipboard

Why are there two column count attributes?

Open ataulm opened this issue 11 years ago • 6 comments

There are two column count attributes - portrait and landscape. Are they needed?

I would expect only columnCount, and if I needed a different number for landscape, I'd include another layout in my layout-land directory which would have a different value for columnCount (if that was the only difference in my layout for landscape, I could use @integer/columnCount, so I'd have two resource files for integers instead).

It suggests that the view checks for device orientation; should that be the view's responsibility?

ataulm avatar Jan 18 '14 21:01 ataulm

This is discussed in #9.

We could add a columnCount property that works as you describe but removing the existing properties isn't an option.

Willing to contribute this change?

denizmveli avatar Jan 21 '14 17:01 denizmveli

Also see #26

denizmveli avatar Jan 21 '14 17:01 denizmveli

Why can't you remove the existing ones? 2.0.0 is calling!

JakeWharton avatar Jan 23 '14 09:01 JakeWharton

I read #9. I don't think you should make the public API suffer because someone is forced to handle configuration changes.

You could easily add the config change port/land column count handling in a subclass that's internal to your app.

JakeWharton avatar Jan 23 '14 09:01 JakeWharton

I'd agree that having it match the grid API more closely would make it an easier drop in replacement for the grid On Jan 23, 2014 3:13 AM, "Jake Wharton" [email protected] wrote:

I read #9 https://github.com/etsy/AndroidStaggeredGrid/issues/9. I don't think you should make the public API suffer because someone is forced to handle configuration changes.

You could easily add the config change port/land column count handling in a subclass that's internal to your app.

— Reply to this email directly or view it on GitHubhttps://github.com/etsy/AndroidStaggeredGrid/issues/32#issuecomment-33107604 .

KennyGoers avatar Jan 23 '14 13:01 KennyGoers

A new column_count attribute has been added that overrides orientation specific values. The sample and the README have been updated to reflect this as best practice.

I plan kill off the old values in v1.1.

denizmveli avatar Feb 22 '14 20:02 denizmveli