2

So I want to display a Matrix that its dimension is given as an input. the cells only have to be painted by colors, and hold nothing else.. dimension can be very large - 1000x1000 matrix, while the screen only shows about 20X30 cells of the matrix. When I tried using a LinearLayout and placed it inside both horizontal and vertical scroll views, it worked great with smaller matrixes but couldn't load a 300x300 matrix.

I tried using a recyclerView inside a horizontal scroll view but than, in a 500x500 matrix, when I scroll down, every new row that appears on the screen generates 500 new itemHolders - cells, not only the scrolling is slow - the app still crashes on the bigger dimension matrixes..

so I want to know if it is possible to make a recycledView that works both horizontally and vertically so when I scroll horizontally, only the cells that appear on screen will be generated, both when scrolling horizontally and vertically.. thanks!

Uri Molcho
  • 21
  • 1
  • Does this help? https://stackoverflow.com/questions/40587168/simple-android-grid-example-using-recyclerview-with-gridlayoutmanager-like-the – Rander Gabriel Aug 15 '20 at 14:15
  • Not really, I need the act of recycling to work both when scrolling left or right.. or maybe I could use a different view\layout if anyone knows of a relevant one.. – Uri Molcho Aug 15 '20 at 14:22
  • 1
    what about using WebView? Is it possible the view is generated on the webpage so that creating 1000 text views per row can be avoided (1000 items per row are huge resource allocation I think) and the functionality comes from the web page for specifically this matrix. – Mihodi Lushan Aug 15 '20 at 18:12

0 Answers0