0

The problem

I want to get a special UI, which resembles the Windows 8 Tiles UI, having cells of different sizes on top of each other.

Something like this:

AABB
AACC
AADD
AADD

each letter represents a part of its cell, so cell A is 2x4 , cell B and cell C take 2x1 each , and cell D is 2x2.

An good example would be Laucher 8.

I don't want to use grid layout.

I am using GridView and I am not being able to achieve above layout using GridView.

Question

1. I have a framelayout as the items in the adapter.
   Using Linear Layout instead of adapter supporting view will certainly 
   make it boring
   or
   May be I am wrong about Linear Layout.
2. Can such a layout be achieved through GridView.
3. How [Laucher 8][2]. is achieving that.

EDIT

My problem was solved using https://github.com/lucasr/twoway-view/ . Google's
staggeredViewGridLayoutManager didn't help may be because I didn't found
it's good usage documentation and I was not able to layout the items in the 
Layout in my desired location.
Mubin Shrestha
  • 398
  • 3
  • 22
  • 1
    "I don't want to use grid layout" -- why? It will help others give you better suggestions if you explain why an obvious choice is something that you do not want. "Can such a layout be achieved through GridView." -- no. `GridView` cells are of uniform size. "How [Laucher 8][1] is achieving that" -- use **`uiautomatorviewer`** and find out. Beyond that, what you are referring to is generally called a "staggered grid", and it is possible to create one using `RecyclerView` and various open source libraries. – CommonsWare Apr 07 '15 at 20:00
  • Thank you @CommonWare. GridLayout is very new Layout and Im afraid it will not run in old android versions. Didnt knew about uianimatorViewer. – Mubin Shrestha Apr 07 '15 at 20:05
  • "GridLayout is very new Layout" -- it has been around for four years. "Im afraid it will not run in old android versions" -- the `gridlayout-v7` backport supplied in the Android Support package works back to API Level 7, which covers 99+% of active Android devices. – CommonsWare Apr 07 '15 at 20:09
  • @CommansWare, Somewhere in internet I mistakenly read that Gridlayout supports API 17. My bad. If I use GridLayout, I will have to define each and every position and sizes of every tile. Also I am working with around 100+ tiles. Also my mobile API level is below 16 so, I was not able to use uiautomatorviewer. But I get the idea. – Mubin Shrestha Apr 07 '15 at 20:32
  • @dberm22 no its not duplicate. I do not want my layout as that of pinterest style. – Mubin Shrestha Apr 07 '15 at 20:34
  • @Computergodzilla Really? Because you copied and pasted much of his question. – dberm22 Apr 07 '15 at 20:38
  • @dbrem2, Yeah I did. :). Reusability.. But question is different. Thank you. I will edit my question. – Mubin Shrestha Apr 07 '15 at 20:42

1 Answers1

1

Try taking a look at StaggeredGridView. It's not exactly what you want, but you may be able to modify it to your needs.

Also possible, is this pinterest-style GridView

You might also want to reach out to the dev of this app. He might have some answers for you.

dberm22
  • 3,187
  • 1
  • 31
  • 46