Bug 6065279
The selection can be created programatically, and mEditor may be null
when it happens.
Make sure mEditor is created to display the selection highlight.
Change-Id: Idd66a5fd4ad327f9b390b539574e6878c794ba4a
Pre-focusable in touch mode ? cursor moves to tapped position.
or previous position when using d-pad/keyboard.
Change-Id: Iac725ff233bfeac2dc14e870118047a9a8418ff9
1. For accessibility purposes View may report a virtual tree
rooted at them to convey the logical structure they draw.
These are usually custom Views. Such views cannot have
children and this patch adds a check for that.
bug:6022217
Change-Id: I3795a613b4aef1a7ec5810db8584a11b648870f2
This does not actually change the framebuffer format. It merely
fakes this format to surfaceflinger so that when it creates
framebuffer surfaces it will use this format. It's really a giant
HACK to allow interworking with buggy gralloc+GPU driver
implementations. You should *NEVER* need to set this for shipping
devices.
Change-Id: I03eeb5b4d72838ef219df386ecc489fc20ab9cc7
Signed-off-by: Dima Zavin <dima@android.com>
All edit-specific data has been moved to an EditData inner class in TextView.
The instance of this class is created as soon as one of its fields is set to
a non-default value. Regular TextViews (buttons, checkboxes...) should never
have to instantiate the Editor, thus reducing their memory footprint.
Note: this is a debug version. The getEditor() method is here to track
possible problems and should be removed in the final version. Indentation
will be fixed then.
Next step is to extract more methods and classes into Editor and create a
dedicated class for it. mMovement may also be Editor specific.
Change-Id: Ic241953a2fb73213180f300c3609a9e6799aa884
Avoid using wp<>::unsafe_get() except in a log, and other specific cases
when it's known to be safe.
Use more specific subclass types for parameters to avoid down-casts.
When a constructor or method parameter is "this" of an object that is
currently being constructed, it's better to use a raw pointer rather
than either sp<> or wp<>.
Using the raw pointer is safe, provided either:
- it is "this" of an object being constructed (which has sp<> refcount of 0),
- or the caller already holds an sp<>
The raw pointer is simpler and faster, and it avoids the problem of the
sp<> reference count being incremented and then decremented to zero on
scope exit, which would cause the object's destructor to run while the
object is still being constructed.
Also removed some dead code per a review comment.
Change-Id: I7375f64da3aec11b928c33cb01faff186252ef5e