Why a grid-style table?
from the CommonsWare Community archivesAt May 2, 2018, 4:39am, Shahood asked:
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)”?
At May 2, 2018, 10:46am, mmurphy replied:
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.
At May 3, 2018, 6:16pm, Shahood replied:
Thanks for the reply!