Create a large content grid in Android

I want to create a large grid for an Android phone application where the grid size may differ from, for example, From 10x10 to 300x300. The contents of each cell will be a test, and some background (the grid will eventually become skinnable).

I developed this earlier for iOS using UIScrollView and CATextLayers for shortcuts where the contents of the cells were loaded / unloaded based on their distance from the visible portion of the screen, so that from memory it was always within a decent range.

What is equivalent to this in Android apps? I will develop on 2.3 (and later on 4.0), and it should work on both phones and tablets.

+4
source share
1 answer

Some information before making a decision:

  • While in iOS UIScrollView goes in both directions, android ScrollView just goes in one direction.
  • In Android, you have a GridView , but again, I don’t think you can scroll both axes.
  • On Android, widgets that run as a UITableView require an Adapter that takes care of creating each of the views.

If I were you, I would start reading:

  • How androidbigimage project handles scrolling across the screen.
  • How the GridView positions its element in the grid and how it handles resizing the grid.

Once you get all this information, create a custom view that looks like a GridView , and start placing items using the Adapter .

PS: When you are done, make it open source :)

+4
source

Source: https://habr.com/ru/post/1383266/


All Articles