New GridLayout for Android 4 is good. Both in terms of code maintainability and performance.
I wanted help with backward compatibility for GridLayout for older version. Waiting for official compatibile package is taking too long. I know its possible and someone did mention that this could be done by copying the class from version 4 platform source.
Would be really great if anybody could guide me how to do this.
For reference please check this post on Google Plus https://plus.google.com/105051985738280261832/posts/KbqAxUQTzVf
GridLayout is also not deprecated.
Some of the most commonly used layouts are LinearLayout, Constraint Layout, RelativeLayout, and GridLayout. Suppose you need to display the elements linearly, whether horizontally or vertically; you can use LinearLayout.
GridView simply gives us a two-dimensional view to display the items on the screen, under ViewGroup. On the other hand, GridLayout is a layout manager that arranges the views in a grid.
android.widget.GridLayout. A layout that places its children in a rectangular grid. The grid is composed of a set of infinitely thin lines that separate the viewing area into cells. Throughout the API, grid lines are referenced by grid indices.
A better way of doing this is using Android Support Library. Since resource files are also involved it cannot be included as .jar library.
Update the android SDK and support files.
your-android-sdk\extras\android\support\v7\gridlayout
project to eclipse.To use gridlayout in XML use it like this
<android.support.v7.widget.GridLayout> </android.support.v7.widget.GridLayout>
Hope that was helpful.
Check out this project: https://github.com/dlew/android-gridlayout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With