94 Commits

Author SHA1 Message Date
Dianne Hackborn
e36d6e277e Work on issue #2263557: PMF3000 showing hybrid of portrait and landscape modes
This is a bunch of reworking of how configuration changes are handled:

- When orientation is changing (for whatever reason), the window manager no
  longer tries to pre-emptively compute a new configuration.  Instead, it
  just determines  change is happening and tells the window manager.
- The activity manager is now responsible for giving the window manager the
  final configuration it is using.  This is both so it knows whem the
  activity manager is done with its configuration updates, and so the window
  manager can use the "real" configuration.
- When an orientation or other configuration change is happening, freeze the
  screen and keep it frozen until the activity manager has given us the
  final configuration.
- The window manager can now send new configurations to its clients during
  its layout pass, as part of a resize, if it has determined that it has
  changed.  This allows for a new View.onConfigurationChanged() API for any
  view to easily find out when the configuration has changed.
- ViewRoot now also works with the activity thread to make sure the process's
  current resources are updated to the new configuration when it receives one
  from a window.  This ensures that at the time onConfigurationChanged() and
  other view callbacks are happening, the correct configuration is in force.
- There is now a sequence number associated with Configuration, which
  ActivityThread uses to avoid using stale configurations.  This is needed now
  that it can receive configurations asynchronously from both the window
  manager and activity manager.
- The hack for keeping the locale has been removed, and underlying problem
  fixed by having Configuration initialize its locale to "unknown" instead of
  a valid default value.
2010-02-18 15:47:34 -08:00
Xavier Ducrohet
99e1cdae99 Fix in layoutlib due to some changes in the frameworks.
Some methods disappear or became abstract in the base class
(breaking @Override)

Change-Id: Id4d298ee84ba008ac97ecaaf90b19003ac09f104
2010-02-11 15:37:31 -08:00
Tobias Haamel
27b28b3f62 Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2010-02-11 21:25:58 +01:00
Dianne Hackborn
e83cefcef0 New external storage APIs.
This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.

Also includes package manager support for removing app private
files from external storage when the application is uninstalled.

For the new APIs and paths, the main place to look is Environment
and Context.
2010-02-09 14:20:55 -08:00
Xavier Ducrohet
264ce38258 am 3bd6dc65: am b44051ee: Merge "ADT/Layoutlib: implement sweep gradient." into eclair
Merge commit '3bd6dc653521281db25df77f055b3ec0b4659454'

* commit '3bd6dc653521281db25df77f055b3ec0b4659454':
  ADT/Layoutlib: implement sweep gradient.
2010-01-22 12:36:26 -08:00
Xavier Ducrohet
28d9c60ee2 am 60e3c09e: am 6866daee: Merge "ADT/Layoutlib: implement radial gradient." into eclair
Merge commit '60e3c09ec0fa73a3e650f4aec89c763599c2e0b7'

* commit '60e3c09ec0fa73a3e650f4aec89c763599c2e0b7':
  ADT/Layoutlib: implement radial gradient.
2010-01-22 09:45:49 -08:00
Xavier Ducrohet
c22b3ca198 am da84d6a1: am 908a8111: Merge "ADT/Layoutlib: Add dash support to stroke." into eclair
Merge commit 'da84d6a1b1c37376d48f92ae59b76f1c891772f6'

* commit 'da84d6a1b1c37376d48f92ae59b76f1c891772f6':
  ADT/Layoutlib: Add dash support to stroke.
2010-01-21 17:55:40 -08:00
Xavier Ducrohet
4e8e87d905 am c0ea805c: am 2b30a4a5: Merge "ADT/Layoutlib: properly handle stroke information." into eclair
Merge commit 'c0ea805c649666b55d4dde09eb72dcccfa8bccc3'

* commit 'c0ea805c649666b55d4dde09eb72dcccfa8bccc3':
  ADT/Layoutlib: properly handle stroke information.
2010-01-21 17:55:17 -08:00
Xavier Ducrohet
18d21ef83e am 20cc5570: am 79f05bb4: Merge "ADT/Layoutlib: improved gradient drawing for perf." into eclair
Merge commit '20cc55703348827fbd80ff0410777a537f01e10e'

* commit '20cc55703348827fbd80ff0410777a537f01e10e':
  ADT/Layoutlib: improved gradient drawing for perf.
2010-01-21 14:31:11 -08:00
Xavier Ducrohet
beb0993c6a am 38fa9eee: am 89d538dc: ADT/Layoutlib: don\'t draw 0-sized rectangle, AWT doesn\'t like that.
Merge commit '38fa9eee9324b2355f28372e80dba12c1d7cc105'

* commit '38fa9eee9324b2355f28372e80dba12c1d7cc105':
  ADT/Layoutlib: don't draw 0-sized rectangle, AWT doesn't like that.
2010-01-21 14:30:48 -08:00
Xavier Ducrohet
900399f3e8 am 895c92a4: am 240298f9: Merge "ADT/Layoutlib: always use custom gradient (java) Paint." into eclair
Merge commit '895c92a44b8bcf0aec7066c061293cafe12a76c2'

* commit '895c92a44b8bcf0aec7066c061293cafe12a76c2':
  ADT/Layoutlib: always use custom gradient (java) Paint.
2010-01-21 14:30:17 -08:00
Xavier Ducrohet
7fa53aa5df am 31ef2e77: am b847fbf2: Merge "ADT/Layout: support for 3+ color in linear gradients" into eclair
Merge commit '31ef2e77c50485ad6ed410a5d341754d6787b8e1'

* commit '31ef2e77c50485ad6ed410a5d341754d6787b8e1':
  ADT/Layout: support for 3+ color in linear gradients
2010-01-21 14:29:02 -08:00
Xavier Ducrohet
3330927bdd ADT/Layoutlib: implement sweep gradient.
Change-Id: I2d460decff82f5f64b0a5cfeaa68156aad4fb3e6
2010-01-19 18:51:06 -08:00
Xavier Ducrohet
ef5506c817 am f95e3dd2: am 5e083024: ADT/Layoutlib: shader clean-up.
Merge commit 'f95e3dd23cb6cbd7a86dece3c4bafff71307721a'

* commit 'f95e3dd23cb6cbd7a86dece3c4bafff71307721a':
  ADT/Layoutlib: shader clean-up.
2010-01-19 16:34:48 -08:00
Xavier Ducrohet
691b47e154 am e1a99147: am d3026e16: Merge "ADT/Layoutlib: 2 color, linear gradient support." into eclair
Merge commit 'e1a991476365cf1a8249c842e2b936db6940b0a7'

* commit 'e1a991476365cf1a8249c842e2b936db6940b0a7':
  ADT/Layoutlib: 2 color, linear gradient support.
2010-01-19 16:34:32 -08:00
Xavier Ducrohet
45a7c28598 ADT/Layoutlib: implement radial gradient.
Also refactored some parts of LinearGradient to reuse them
in the radial gradient

Change-Id: I2ec69bd60190bd014217d989177dcc7269188dea
2010-01-19 14:03:31 -08:00
Xavier Ducrohet
28039a6f74 am 1da2735c: am f73bd14a: Merge "ADT/Layoutlib: implement Canvas.concat(Matrix)" into eclair
Merge commit '1da2735c5862d48712706c2052a34e10e3dea43b'

* commit '1da2735c5862d48712706c2052a34e10e3dea43b':
  ADT/Layoutlib: implement Canvas.concat(Matrix)
2010-01-19 00:02:15 -08:00
Xavier Ducrohet
05bc8d7397 am cff6c845: am ae4bd059: ADT/Layoutlib: Reimplement parts of BitmapFactory
Merge commit 'cff6c8459ca05f3fee2d2999989d07a7176f955c'

* commit 'cff6c8459ca05f3fee2d2999989d07a7176f955c':
  ADT/Layoutlib: Reimplement parts of BitmapFactory
2010-01-19 00:01:32 -08:00
Xavier Ducrohet
36ab1284d8 ADT/Layoutlib: Add dash support to stroke.
Change-Id: I09a7e84948be013cbb11f6d9774ab81df897b424
2010-01-15 11:24:44 -08:00
Xavier Ducrohet
5ac8f409f5 ADT/Layoutlib: properly handle stroke information.
Change-Id: Iec9284d0e65d1313739e361d1fd5a522646fd1fd
2010-01-14 19:43:54 -08:00
Xavier Ducrohet
79f05bb4a5 Merge "ADT/Layoutlib: improved gradient drawing for perf." into eclair 2010-01-14 19:10:44 -08:00
Xavier Ducrohet
e8f4d7deab ADT/Layoutlib: improved gradient drawing for perf.
Change-Id: I79b909d7787e4442e7cfdf196de1ac0c077da7f8
2010-01-14 18:45:04 -08:00
Xavier Ducrohet
89d538dcca ADT/Layoutlib: don't draw 0-sized rectangle, AWT doesn't like that.
Change-Id: I298d00208ace2421478c5864cc5a66a508b2b411
2010-01-14 18:38:06 -08:00
Xavier Ducrohet
2dbb923aa0 ADT/Layoutlib: always use custom gradient (java) Paint.
The normal linear paint from AWT does not support our TileModes.

Change-Id: I24667671dabdf1a5dffa342e4de9cc69487db0b6
2010-01-14 17:17:25 -08:00
Xavier Ducrohet
374abf0b95 ADT/Layout: support for 3+ color in linear gradients
Change-Id: I14c6a5a1de41470c6f1c66d490492ecc727302f2
2010-01-14 15:15:35 -08:00
Xavier Ducrohet
5e08302426 ADT/Layoutlib: shader clean-up.
Change-Id: I0a200f438b7ccde2bfc19fd23614a647cb19d312
2010-01-14 10:37:13 -08:00
Xavier Ducrohet
63b2e61627 ADT/Layoutlib: 2 color, linear gradient support.
Change-Id: Ifaafa4fc42a22f4851449a7c35a5b82e211aafe7
2010-01-13 20:30:26 -08:00
Xavier Ducrohet
608cd11cdc ADT/Layoutlib: implement Canvas.concat(Matrix)
This prevented ImageView from making proper use of ScaleType.

Also fixed Canvas.getSaveCount() that returned the wrong
value and Matrix.getTransform() which used the wrong order
for the AffineTransform constructor!!

Bug: 2364564

Change-Id: I78babf4aa6689440e52ad06b1473f75b20eb66da
2010-01-13 18:17:59 -08:00
Xavier Ducrohet
ae4bd059ca ADT/Layoutlib: Reimplement parts of BitmapFactory
The original bitmap factory is mostly done in native and deals
with the normal android Bitmap class which has been replaced
in the layoutlib by a bitmap that is merely a wrapper around
an AWT BufferedImage.

This new BitmapFactory creates the layoutlib version of
Bitmap all in Java.

Change-Id: Ice8b5d19141a9a43f83349c159201bf85604b3b0
2010-01-13 16:43:07 -08:00
Xavier Ducrohet
6d40ee33f5 am f5a84f8a: am dfe25b0e: Merge "LayoutLib: support for custom styles." into eclair
Merge commit 'f5a84f8a7f91422f698ffbea3fabf77f2f7f77c8'

* commit 'f5a84f8a7f91422f698ffbea3fabf77f2f7f77c8':
  LayoutLib: support for custom styles.
2010-01-11 15:30:29 -08:00
Xavier Ducrohet
9ce3b775f5 LayoutLib: support for custom styles.
Change-Id: Ic6c2ef234589f45db15024261d698066aa6e2f4e
2010-01-11 14:28:03 -08:00
Romain Guy
2924a51fd0 Fix duplicate constant in layoutbridge. 2010-01-08 15:57:54 -08:00
Romain Guy
980a938c1c Deprecate fill_parent and introduce match_parent.
Bug: #2361749.
2010-01-08 15:11:38 -08:00
Tom Taylor
d4a4729c0c Update imports to android-common
Several files were moved to android-common. Update all the references
to import those files from the new location.
2009-12-21 13:59:18 -08:00
Dianne Hackborn
9ddb7df88a Fix build.
Change-Id: I70c86738e2894d7f8c51034aea8fda1585a6fcb3
2009-11-16 17:59:32 -08:00
Xavier Ducrohet
0da2676ea8 Minor fix for the parent style computation in the layoutlib.
This is an SDK change only.

Change-Id: Iae493184ae76b2e21200dd6bb48795ff74f79ab3
2009-11-15 16:15:33 -08:00
Xavier Ducrohet
76410f1eb3 Properly implement Paint.breakText for layoutlib.
BUG 2260400

Change-Id: I7082e366b65da0b5de2a6dbb547f66e05e0b78e0
2009-11-13 14:10:20 -08:00
Marco Nelissen
bf6956b1d9 Add a way for wallpapers to know the delta between virtual screens. 2009-11-09 17:39:33 -08:00
Xavier Ducrohet
9a4593ffcc Support for fallback fonts in layoutlib.
BUG 2041229

Change-Id: Ib12bcb7f6d8f0e4c2b51871f8129ecf51fa938ee
2009-11-09 14:55:08 -08:00
Brett Chabot
a86f28494c Fix layoutlib tests so they pas when run from Eclipse workbench.
Bug 2222616
2009-11-03 10:31:31 -08:00
Dianne Hackborn
7580493b01 Implement feature #2117336: Create event communication APIs for live wallpaper
Note: currently only implements an async version (no result), and not yet
actually tested.

Change-Id: Id47ed045a4b0eb309ea8c58daf41a0e03eff1d3a
2009-10-22 20:10:53 -07:00
Xavier Ducrohet
5f9d4bae03 layout lib tests cleanup
- Move test files to their own package for easy binary inclusion
  in adt-test
- fix some tests and remove obsolete ones.

Change-Id: I5b967f29074fdad74073f9b37d903eabe8dc29e6
2009-10-06 15:14:09 -07:00
Xavier Ducrohet
0a9d46b7e7 Add a test to make sure the replaced classes in layoutlib are correct.
Change-Id: I9641635153c12e2c0a23583f7d094767533fc683
2009-10-06 15:13:58 -07:00
Xavier Ducrohet
9f751ab3fc Reimplement all the method of Paint for layoutlib
There were a few missing methods that should have been reimplmented
(because they were native).

Others have been added just to be sure so that we can test whether methods
are missing or not (test coming soon).

Change-Id: I24895c353e38545e9b1abe28d41224fdc78cadb1
2009-10-05 19:10:04 -07:00
Xavier Ducrohet
8c739671d2 Fix the layoutlib test to run from adt-tests.
Change-Id: I34f513429593dce9f781ed8a08c4664a5d6f9aa8
2009-10-05 15:36:53 -07:00
Xavier Ducrohet
f18ccc13a6 Fix a warning output.
This was introduced by the dpi work.

Change-Id: I7c7b1596085f70532b8279139c287a2a58f57046
2009-09-28 12:59:33 -07:00
Dianne Hackborn
ffa424800d Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off
Lot of infrastructure for more things to go away when "clear system dialogs"
happens, and now do this when we turn on the lock screen.

Change-Id: I567130296fe47ce82df065ed58ef21b37416ceaf
2009-09-23 23:17:07 -07:00
Xavier Ducrohet
56a92e3ba0 Add density support to layoutlib so that bitmap are scaled if needed.
Change-Id: I00204bb136ccaa44deeafbe0ea8746fea9903341
2009-09-23 16:38:57 -07:00
Dianne Hackborn
de0dfb7b65 Fix issue #2125720 Weather Forecast Widget - graphics do not scale
I forgot to add the new density field to the Bitmaps' parcelable data.

Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
2009-09-23 14:26:02 -07:00
Dianne Hackborn
efa199f016 Add API to send an ordered sticky broadcast.
Change-Id: Ida7081204e226db0cd07ff618c08e308a909ec0c
2009-09-19 12:05:25 -07:00