Android Open Source Control Viewflow Learning
Here's a quick introduction: Throw IllegalStateException:
"Viewflow can only is used in exactly mode."
First of all to clarify the advantages of Viewflow: (1). Viewflow is more suitable for dynamic size, the number of slices from the background, how much to show how much, this is not very suitable for viewpager.
(2) The rotation of the viewflow is very smooth, the transition is very friendly, and the loop is supported.
When using Viewflow, it is only possible to use the "Viewflow can only is used in exactly mode" for the size-determined pattern.
At this point, if your own layout is indeterminate size, there may be an error, there is a not good workaround is to set a wide padding parent control, set a fixed value height.
If there is a problem: You can make the following modifications in the Onmeasure () method: (for reference only)
Modify the following code:
if (heightmode! = measurespec.exactly &&!isineditmode ()) {throw new IllegalStateException ("Viewflow can only is U Sed in exactly mode. ");
Shield off the first sentence: Super.onmeasure (Widthmeasurespec, Heightmeasurespec);
The modified if is judged as follows:
Heightmeasurespec = Measurespec.makemeasurespec (commonutil.dip2px (Mcontext), measurespec.exactly); Super.onmeasure (Widthmeasurespec, Heightmeasurespec);
The mode setting for height is set to: Exactly, the size is set by itself. The Makemeasurespec parameter, the first bit is the size.
Other places can be modified on the basis of reading code.
Here is Viewflow source code: Viewflow Source
Android Open Source Control Viewflow Learning Notes "included"--(Original-20150407)