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
and their getParent()
returns null.
A call to setParent()
would throw an exception.
Their getElement()
returns null
.
getStartOffset()
always returns 0.
getEndOffset()
returns length of the text
that they represent.
getContainer()
always returns null.
Modifier and Type | Interface and Description |
---|---|
static interface |
FlyView.Parent
Interface that views capable of maintaining flyweight views
as their children must implement.
|
Modifier and Type | Method and Description |
---|---|
FlyView |
flyInstance(View parent)
Create an instance of the view dependent on the context
given by the parent view.
|
CharSequence |
getText()
Get the text represented by this view.
|
View |
regularInstance(View parent,
int startOffset,
int endOffset)
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)
getText()
.
CharSequence getText()