public interface FlyView
A view can be rendered differently in various rendering contexts. Rendering contexts can affect measurements done by the view. Therefore there are methods that can replicate the view into a new instance in a particular context.
Flyweight views cannot hold a reference to parent
getParent() returns null.
A call to
setParent() would throw an exception.
getStartOffset() always returns 0.
getEndOffset() returns length of the text
that they represent.
getContainer() always returns null.
|Modifier and Type||Interface and Description|
Interface that views capable of maintaining flyweight views as their children must implement.
|Modifier and Type||Method and Description|
Create an instance of the view dependent on the context given by the parent view.
Get the text represented by this view.
Create a regular instance that will act as a normal view.
FlyView flyInstance(View parent)
parent- instance of view that will act as parent for the view in the given context. The possibly created instance of the view can use the parent but it must not hold the reference to it permanently.
View regularInstance(View parent, int startOffset, int endOffset)