Why a grid-style table?


#1

Hi,
This page is from sub section named “A Grid-Style Table” of the chapter named “RecyclerView”.
I’m trying to find out why we need to implement a grid style table. If it is for giving the user the option to click any of the cells, can’t this be done by setting an OnClickListener on each of the child view even if we use a LinearLayoutManager with rows containing a horizontal LinearLayout and all the child views inside it?

Also, can u pl explain what u meant by “(or selected via a five-way navigation option, like a trackball)”?


#2

I’m trying to find out why we need to implement a grid style table

You do not “need” to do anything. It is an option, nothing more.

If it is for giving the user the option to click any of the cells, can’t this be done by setting an OnClickListener on each of the child view even if we use a LinearLayoutManager with rows containing a horizontal LinearLayout and all the child views inside it?

A GridLayoutManager is for showing things in a grid structure. That may or may not be able to be replicated readily using independent LinearLayoutManager instances.

can u pl explain what u meant by “(or selected via a five-way navigation option, like a trackball)”?

Some Android devices have a five-way navigation option. While I mention a trackball there, the most common form today probably is a remote control for an Android TV device (or similar devices). The user will expect to be able to navigate your UI with that remove control, including “selection” events by clicking the center button of the D-pad, or clicking the trackball, etc.


#3

Thanks for the reply!