Commit Graph

2655 Commits

Author SHA1 Message Date
Daniel Sandler
48200b6f3f Merge "Chronometer support in Notifications." 2012-04-04 17:49:24 -07:00
Fabrice Di Meglio
d779412c58 Merge "Add View textAlignment" 2012-04-04 14:17:22 -07:00
Daniel Sandler
a2985ed309 Chronometer support in Notifications.
@hidden for now while we experiment with it in Phone.

Change-Id: Ib6ca3a8262f676d49d81e081a30c6d994c732a6b
2012-04-04 15:35:44 -04:00
Fabrice Di Meglio
9da0f8a5c4 Add View textAlignment
- fix bug #6163772
- use bits field and pack them as much as possible
- take care of "supportsRtl" flag from Manifest
- add visual unit tests

CTS unit tests in another CL

Change-Id: Ib77c4eb423854209af130688c5ef9977401a9c1c
2012-04-04 12:20:45 -07:00
Gilles Debunne
935a15ebed Merge "Removed spurious log about blinking cursor" 2012-04-04 10:14:13 -07:00
Gilles Debunne
cfbf0e0296 Removed spurious log about blinking cursor
Change-Id: I940c3847bb6e461178575480c82e7dd6739277cf
2012-04-04 10:12:05 -07:00
Chet Haase
21aec19d30 Merge "Optimization of alpha with DisplayList properties" 2012-04-03 15:40:54 -07:00
Chet Haase
db8c9a6a4d Optimization of alpha with DisplayList properties
Some views (such as ImageView and TextView) handle non-opaque alpha
values directly. This was originally an optimization, but we can handle it faster
in many cases without this optimization when DisplayList properties are enabled.
Basically, if a view has non-overlapping rendering, we set the alpha value directly
on the renderer (the equivalent of setting it on the Paint object) and draw each
primitive with that alpha value. Doing it this way avoids re-creating DisplayLists
while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties.

Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
2012-04-03 14:02:17 -07:00
Svetoslav Ganov
1663565739 Merge "Polish the Number/Date/Pickers per UX request." 2012-04-03 11:38:47 -07:00
Svetoslav Ganov
fe41ce4ef9 Polish the Number/Date/Pickers per UX request.
1. Now the NumberPicker max height is a bit smaller.

2. The Time/Date picker add top and bottom margin to
   compensate for the shorter NumberPickers.

3. The Time/DatePicker dialogs have only "Done" button
   and tapping onside saves the current state.

bug:6277808

Change-Id: I4c5928debb1c3b7fe126d6cd6745e3c5eb980901
2012-04-02 21:20:14 -07:00
Adam Cohen
78e2c336de Merge "Only preload items if they are within the valid range (issue 6265338, 6194161)" 2012-04-02 15:50:52 -07:00
Adam Cohen
4c99498620 Only preload items if they are within the valid range (issue 6265338, 6194161)
Change-Id: Ic2713b41ad545a004df1e06e4be9946d7336c4b3
2012-04-02 15:38:18 -07:00
Gilles Debunne
d88876a72f Extracted text editing logic in a separate class
Editor specific method and fields are extracted to a dedicated Editor class.

Some private fields and methods had to be made package private so that the
Editor can see them. No change in the public API.

Other changes in this CL:
- The Blink class no longer has a WeakReference to the TextView
- EasyEditSpanController is no longer a field of ChangeWatcher.

Future work:
remove the getEditor() method in TextView and
clean whitespaces and indentation.
remove the EasyEditSpanController as a change watcher, fix spanWatcher

Change-Id: I1fbe0176b6bd27d90f556dc3a90469367f77437c
2012-03-30 11:10:36 -07:00
Gilles Debunne
59075643ac Merge "Handle non DynamicLayout in Editable draw method." 2012-03-28 11:11:48 -07:00
Gilles Debunne
0711047af7 Handle non DynamicLayout in Editable draw method.
An Editable text will use a BoringLayout when the text is empty.
Fallback on the regular layout draw text method when the layout
does not support the block optimisation.

Change-Id: Ie4bdb4381f2f58b71d7c35b2f5734e544e3115ea
2012-03-27 19:01:22 -07:00
Gilles Debunne
4cb85f6ad6 Moving focus on text should not create an Editor
Bug 6241159.

onCreateInputConnection should not create an Editor but instead
should return an input connection iff the text is editable.

Change-Id: Ie9ea55b2467f5a40e6243b36f9b44fa6dfab586f
2012-03-27 18:12:14 -07:00
Chet Haase
b85967b9af Re-enabling DisplayList properties
Several issues came up after DisplayList properties were enabled,
so they were disabled pending fixes. Those issues have been fixed, so
DisplayList properties are once again being enabled by default. This
CL both re-enables these properties (in View.java and DisplayListRenderer.h)
and fixes the various issues that enabling them caused the first time around.

Related issues (all currently marked as Fixed, though that was simply because
DL properties were disabled - this CL provides the real fixes now that
DL properties are enabled by default):
Issue #6198276 Text input broken
Issue #6198472 Native crash at pc 00076428 in many different apps in JRM80
Issue #6204173 Date/time picker isn't rendering all parts of UI
Issue #6203941 All Apps overscroll effect is rendered weirdly/has flickering
Issue #6200058 CAB rendering issue - not drawing items?
Issue #6198578 Front camera shows black screen after taking picture.
Issue #6232010 Layers not recreated when children change (DisplayList properties)

Change-Id: I8b5f9ec342208ecb20d3e6a60d26cf7c6112ec8b
2012-03-27 08:17:54 -07:00
Gilles Debunne
91889e2c86 Merge "Update to TextView#didTouchFocusSelect documentation" 2012-03-26 16:38:57 -07:00
Philip Milne
aac722a9c0 Fixes for bugs: 6104423, 6103563, 6103509, 6103807 & 6103253.
Add properties to Java API so as to better mirror the framework's XML API.

I'm not familiar with many of these areas so this CL is worth some scrutiny.

Change-Id: Iff63c43521305efaad5a2189c1b5556d2353cbd4
2012-03-26 13:46:33 -07:00
Daniel Sandler
820ba323f9 Add remotable methods for TextView's compound drawables.
Change-Id: I67445e5b1d4a571020dfcd551ab00bd83a8eb536
2012-03-24 09:56:10 -05:00
Adam Powell
3004cc50f2 Add SeekBar property accessors to match available style attributes
Bug 6103624

Change-Id: I7bc863250f3b156cf6663e484baab2c35a949db5
2012-03-21 17:51:30 -07:00
Adam Powell
0b7413d5d6 GridView attribute updates
Bring GridView's API in sync with its supported style attributes.

Bug 6103758

Change-Id: Ib2c4d4d48061d23a7d886364965f0cb50c239e5d
2012-03-21 15:35:39 -07:00
Gilles Debunne
a4a26053ea Disabled display lists in TextView
Bug 6198276, bug 6193544, bug 6199959

The activation of display list properties on Monday 19th
broke the editable text behovior.

Disabling display lists to fix the blocking rendering
issues.

Change-Id: I5bd0584d1a34c6bb0af79ef45499154e9004eac1
2012-03-20 15:52:57 -07:00
Romain Guy
e72cf7341a Put back invalidate optimization
Change-Id: I6407e452deb44e50a50632961e960cf0bd39b09d
2012-03-20 14:23:09 -07:00
Romain Guy
e979e62ac7 Code cleanup
Change-Id: I390e92b4a778bd9dcde6535178c1a6b204b29fe4
2012-03-20 13:50:27 -07:00
Svetoslav Ganov
d11e6151fe Revamp of the NumberPicker widget.
1. The number picker no longer shows up and down arrows, it
   has only three touch targets which are the currently selected number
   in the middle with a lesser one above and greater below, now what
   you touch is what you get, flingability and long press are still
   supported.

2. Removed the restriction for a View with an AccessibilityNodeProvider
   to not have any concrete children. If the View has a provider, then
   this provider is responsible for creating the AccessibilityNodeInfos
   for all its descendants, concrete and virtual. The number picker is
   a good example for such a case - it has a concrete input view and
   two virtual buttons as its children. This is a safe change since
   this behavior has not been released.

3. This patch also fixes bug where the number picker is stretched too
   much in the Theme theme.

bug:6177794
bug:5728294

Change-Id: I5fb370fe0b864a156f5f2aaf2de5f55f6b6d4e84
2012-03-20 12:13:06 -07:00
Gilles Debunne
590924e10a Merge "Multiple display lists for editable text" 2012-03-15 16:35:56 -07:00
Gilles Debunne
053c439824 Update to TextView#didTouchFocusSelect documentation
Bug 6171333

Related to https://android-git.corp.google.com/g/#/c/173335/

Change-Id: Ib4a83b6b0a03579b28d7319c9eb92a4bca09d209
2012-03-15 15:35:29 -07:00
Romain Guy
a8bfeaf4f4 Cleanup ListView glow's optimized invalidates
Change-Id: Ie9759fd95366866512ec55072aa482f972650d15
2012-03-15 13:14:14 -07:00
Gilles Debunne
33b7de85b6 Multiple display lists for editable text
Bug 5763685

Long text in a ScrollView (not when the View's internal
scroll is used) is cached as a unique display list when hardware
rendering is on.

As a result, each time the text is edited, the entire display
list has to be updated, which takes a significant amount of
time (up to 500ms for a few thousand lines), proportional to the
size of the text.

This CL splits the text into multiple display lists as the
text is edited. The boundaries of the display list are aligned
with paragraphs.

There is still an issue when the number of lines changes: onLayout()
is called which invalidates all the display list. When the source
of that change is line wrapping and not a change in the view's
dimensions, we should be able to simply shift down the previous DL
instead of re-creating everything.

Change-Id: I7de49a1e5637cdfc9ef06b64b1ec4b61d9ea2415
2012-03-15 11:32:50 -07:00
Philip Milne
b269aaf860 Merge "Fix for bug 6170890." 2012-03-14 17:36:21 -07:00
Philip Milne
edd69518ff Fix for bug 6170890.
Also fix logic for consistency checking. Prior to this CL
GridLayout was causing Launcher to issue warnings to the logs
incorrectly.

Change-Id: I9d4017388e7c80c8bc5fa6cab97970835ff261fe
2012-03-14 17:27:26 -07:00
Romain Guy
9d849a2f63 Optimize invalidate calls in lists.
AbsListView was doing too many invalidates during scrolls/flings.
Some of them were also covering too large an area of the screen.

Change-Id: I68fe5dda3657bddd673996e7cf4f3c3672c66cfc
2012-03-14 17:19:35 -07:00
Philip Milne
1018fb42cb Fixes for bugs: #6103660, #6103957, #6104457 and #6104322.
Add getters and setters to the layout widgets so as to mirror their XML apis.

Change-Id: Ie2237fd55e1c3e4ec0d08b4f8154ea7e122c1e79
2012-03-13 15:22:07 -07:00
Chet Haase
a1cff5043d Handle view properties at the native level
Basic functionality of handling View properties (transforms,
left/right/top/bottom, and alpha) at the native DisplayList level.
This logic is disabled for now (via compile-time flags in View.java and
DisplayListRenderer.h) as we continue work on it (there is no advantage
to the new approach until we optimize invalidation and rendering paths
to use the new code path).

Change-Id: I370c8d21fbd291be415f55515ab8dced6f6d51a3
2012-03-12 15:41:48 -07:00
Adam Powell
48774533f1 Respect default styles when constructing GridViews with 1-arg constructor
Fixes public bug http://code.google.com/p/android/issues/detail?id=26757

Change-Id: If78b6210485558c5630445bdd4d6312386aaf2b5
2012-03-12 13:41:37 -07:00
Gilles Debunne
d122d8eb3e Merge "Re-use the display list valid flag, save a boolean" 2012-03-09 17:16:21 -08:00
Fabrice Di Meglio
73ba0df14f Merge "Make Drawable RTL APIs public" 2012-03-09 17:02:56 -08:00
Fabrice Di Meglio
06e1ec6462 Make Drawable RTL APIs public
- also optimize imports

Change-Id: I2649a539a5784293d09179981a5d57e900219246
2012-03-09 16:37:45 -08:00
Ken Wakasa
559c4841a6 Merge "Fix obvious typos under frameworks/base/core" 2012-03-09 15:52:06 -08:00
Svetoslav Ganov
977c9a5d3c Merge "Removing checked state description text for accessibility from some widgets." 2012-03-09 10:24:33 -08:00
Svetoslav Ganov
55249c8601 Removing checked state description text for accessibility from some widgets.
1. The framework was appending some text to convey the state of a
   a CheckedTextView or a RadioButton or a ToggleButton or a Switch
   but the checked property already conveys that information. It is
   responsibility of the screen reader developer to append the state
   text based on the checked property. This change is requested by a
   few screen reader developers.

bug:5951683

Change-Id: Ieba6797770201155c48e37147ae375dfcb5238aa
2012-03-09 10:17:16 -08:00
Ken Wakasa
f76a50ce8f Fix obvious typos under frameworks/base/core
Change-Id: Ia5fc3db1bb51824e7523885553be926bcc42d736
2012-03-09 22:48:43 +09:00
Adam Powell
dca510e026 Fix docs
Change-Id: Idea902ec3b6e540972650a070e8d224603a55c94
2012-03-08 20:06:39 -08:00
Adam Powell
d9c7be6cc7 Public API for android.widget.Spinner properties
Bug 6104467

Add properties that can be set/retrieved programmatically to match the
XML attributes available.

Also add resource ID versions of Drawable setters for Switch.

Change-Id: I198cfd9701189ab200c3190f61d18c459b7e4591
2012-03-08 19:49:39 -08:00
Adam Powell
787f2699f1 Merge "Public API for android.widget.Switch properties" 2012-03-08 17:18:10 -08:00
Adam Powell
6c86e1ba41 Public API for android.widget.Switch properties
Bug 6104562

Add properties that can be set/retrieved programmatically to match the
XML attributes available.

Change-Id: Ief28e5cad9ec3e6c2d12dd11ff9fa24f22eecec3
2012-03-08 15:12:48 -08:00
Romain Guy
583fcb9175 Merge "Dispatch screen state change events to Views Bug #6120957" 2012-03-08 15:06:50 -08:00
Romain Guy
bb9908b828 Dispatch screen state change events to Views
Bug #6120957

Using this new callback, views can interrupt and resume their
animations or other periodic tasks based on the current state
of the display.

Change-Id: I398f4abd421e9c5f207107bf1009a7b92cf45daa
2012-03-08 15:05:12 -08:00
Fabrice Di Meglio
bbd8226e97 Merge "More fixes about padding" 2012-03-08 12:26:22 -08:00