The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mportuesisf (2) [Avatar] Offline
#1
In the second edition draft, page 96, we read:

--
To summarize, the container is a ViewGroup, and a ViewGroup supports a particular type of LayoutParams. Child View elements are then added to the container and must fit into the layout specified by their parents. A key concept to grasp is that even though a child View has to lay itself out based on its parents’ LayoutParams, it can also specify a different layout for its own children.
--

The way I read this, it sounds like a ViewGroup has an instance of LayoutParams which apply to all its children.

But the Android javadocs for View state the following:

--
public ViewGroup.LayoutParams getLayoutParams ()

Get the LayoutParams associated with this view. All views should have layout parameters. These supply parameters to the parent of this view specifying how it should be arranged. There are many subclasses of ViewGroup.LayoutParams, and these correspond to the different subclasses of ViewGroup that are responsible for arranging their children.
--

So the text seems misleading (to me, at least) on this matter. Could we get a little bit of clarification on the LayoutParams, who owns them, and how they figure in the collaboration between ViewGroups and child Views?
mportuesisf (2) [Avatar] Offline
#2
Re: Question about LayoutParams
The second paragraph on pg. 96 also states:

--
The dimensions for a given view are dictated by the LayoutParms of its parent
--

which again, seem in contradiction to the Android javadocs which state that each view has LayoutParams which the parent inspects to determine how the child wants to be laid out.