1323 Commits

Author SHA1 Message Date
Deepanshu Gupta
908a4f9a43 am 4f133894: Exclude KXmlParser from LayoutLib.
* commit '4f133894a6e98d8d30557ea42cec92cfb21fa5c9':
  Exclude KXmlParser from LayoutLib.
2014-10-08 17:34:12 +00:00
Deepanshu Gupta
4f133894a6 Exclude KXmlParser from LayoutLib.
The class was incorrectly being included in the LayoutLib.

Change-Id: I3c86662efa068019fe9165f2fc49a00d0a1b7f2d
2014-10-08 10:12:11 -07:00
Deepanshu Gupta
11b14e3996 LayoutLib: Use ICU's line break algo. [DO NOT MERGE]
Change-Id: I7e5b0ab7423a72f5a4b0e1163d0a537f0b03ba07
(cherry picked from commit 760f6394d0f65fbb5365186e8e068d53c506b653)
2014-10-08 02:05:05 +00:00
Deepanshu Gupta
3c8140ab4b Minor style changes.
Addressing code review comments on previous change: 171804201dd

Change-Id: I2c9e0ce35e755c23d8292749828d15a87109d6dc
2014-10-02 11:45:07 -07:00
Deepanshu Gupta
409bd3d774 Resource resolution bug fix. [DO NOT MERGE]
Fix a bug where "?attr/foo" in framework resources wasn't resolved
properly.

Change-Id: I9a56974f526774fde79685f668f01021136d68f1
(cherry picked from commit 19c7842082d831ad432abe906f4c37c6ed08e414)
2014-10-01 12:45:26 -07:00
Deepanshu Gupta
fea51feb5c Fix Tests after cherry picks. [DO NOT MERGE]
1. Updated the intelliJ run configuration for the layoutlib_create tool.
2. Updated the code to search for the platform.dir.
3. Update tests to use AppTheme and Target SDK 19

Change-Id: I6f1cc6ff2a53e4474c746537029c7f89c6dd6dc1
(cherry picked from commit 8592eeafd01370d1a17e34602290becf7f611c75)
2014-10-01 12:44:24 -07:00
Deepanshu Gupta
98a03e771e Update intelliJ copyright profile [DO NOT MERGE]
Change-Id: Ib9386b686cb24e1f187d0b636b59b4b13d59bbcd
(cherry picked from commit 91fa62ac67a5e294124b5bfb70b35addc7687c34)
2014-10-01 12:44:14 -07:00
Deepanshu Gupta
039d5849ea Build layoutlib create tests as part of sdk build. [DO NOT MERGE]
LayoutLib Create tests are now built whenever LayoutLib create is built.

Change-Id: Id215e8690e435019579dba1734090a0d585f37e1
(cherry picked from commit 4efe6264f1251fa200427f54ea6f5dd4c4d03665)
2014-10-01 12:44:05 -07:00
Deepanshu Gupta
6fb5fdc233 Add layoutlib tests to DIST_DIR [DO NOT MERGE]
Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk
targets. These can be used for continuous testing on the build server.

Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f
(cherry picked from commit f9c749c9901c459f77ffc6f4fbbc15f4142c6e0a)
2014-10-01 12:43:52 -07:00
Deepanshu Gupta
bd4133133a Build layoutlib_create tests. [DO NOT MERGE]
Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61
(cherry picked from commit 2294f939bc79ce902a40db37def64cc28394d56b)
2014-10-01 12:43:43 -07:00
Deepanshu Gupta
3f0e467a06 Remove ANDROID_BUILD_TOP from intelliJ path variables. [DO NOT MERGE]
The variable is not actually needed and it makes working with different
API levels a lot easier since everything now depends on $PROJECT_DIR$.

This change also makes the tests more robust by improving the way it
tries to find the SDK.

Change-Id: I3502ad4a0ba85fd88b497e47964fddb2a89e520c
(cherry picked from commit 5377695d4ecf3cc6dc1abe59bbfca63f6137b722)
2014-10-01 12:43:32 -07:00
Deepanshu Gupta
2f3715aaaa Get filename from File faster [DO NOT MERGE]
Use the direct call from a File object to get the filename instead of
going through Path which depends on Java 7 making the LayoutLib tests
incompatible with Java 6.

Change-Id: I815895eedbc10245ee09bdb53b11e5548b076aad
(cherry picked from commit 7dbf91fee96790fbeb9858740be1bb375f29ecb5)
2014-10-01 12:43:19 -07:00
Deepanshu Gupta
b6a37d897a Add testing framework to LayoutLib. [DO NOT MERGE]
This change adds an end to end test which loads the framework resources
and a test app and ensures that no exceptions or warnings are thrown.

The change also adds project configuration for intelliJ.

Change-Id: I7b67c0f1a2af2dac95df7f3231cab537b9826d7d
(cherry picked from commit a8e9517470869fa29946ae1fa1ceeb24c7970391)
2014-10-01 12:43:11 -07:00
Deepanshu Gupta
23f09423cb Add tests to the layoutlib eclipse project. [DO NOT MERGE]
Specify the test folder in the layoutlib/bridge eclipse project.

Also add the sourcepath for layoutlib-api-prebuilt.jar

Change-Id: I194ed182618e564388d6df645e2de7f59897fa1e
(cherry picked from commit 36acf8baebc9ab72b3b5fe75d865399ddf7b0132)
2014-10-01 12:42:49 -07:00
Deepanshu Gupta
171804201d Always resolve enum when resolving resources.
Enums were resolved only for integers and dimensions. This change
resolves enums for all resource types. Well, almost all. For color and
colorStateList, enums are still not referenced.

Bug: http://b.android.com/76091
Change-Id: Ie43bd1b54fb9877655d31773bdf71d9a6a65c473
2014-09-29 12:01:37 -07:00
Deepanshu Gupta
8d5a15b691 Update time in layout preview
Change-Id: Ic32a9cb1f20b472c6898a5f370d8578c011a09bf
2014-09-29 09:38:59 -07:00
Deepanshu Gupta
803a59cae7 Fix error when using list as actionBarNavMode. [DO NOT MERGE]
A bug in the framework leads to the wrong argument being passed to
defStyleRes when obtaining styled attributes. The framework however just
ignores the attribute in such a case. LayoutLib logs an error to help
developers find bugs in their code.

The bug was seen when using list as the actionBarNavMode.

This change ignores the attribute if it detects that it's the framework
bug. Also, we change the error to a warning.

Change-Id: I58e1fe4469de0329a27b577d75c0a59c48d0381b
2014-09-25 23:01:38 +00:00
Deepanshu Gupta
bc1944560c Merge "Build LayoutLib tests with Java 6" into lmp-dev 2014-09-16 18:16:21 +00:00
Deepanshu Gupta
0f6e5d2ab7 Build LayoutLib tests with Java 6
Build the layoutlib tests with Java 6, so that we can test LayoutLib on
Java 6 also.

Change-Id: I8ab344af29c880dafdc195d8b061a1d08e724e26
2014-09-16 11:11:36 -07:00
John Spurlock
8d4e6cb060 Saver: PowerManager call to set low power mode.
- Add an explicit power manager call to set the low power mode state,
  instead of trying manage everything around a single setting.
- When low-power mode is triggered by falling below the configured
  threshold, it does not update the setting.
- The "is-enabled" api returns setting || below configured trigger.
- Move the snooze management into the new api call.
- Callers (sysui + settings) updated to use the api instead of the
  setting.
- Handles the case where the level does an unpowered leap out of the
  low battery level. (Possible if powered in-between while the device
  is off)

Bug:17460535
Change-Id: Ic030504c9cad9868a7137abbe837b170da37852b
2014-09-14 14:07:23 -04:00
Deepanshu Gupta
820ce63cea Merge "LayoutLib: support font weights." into lmp-dev 2014-09-11 04:54:26 +00:00
Deepanshu Gupta
145bc2d067 LayoutLib: support font weights.
Also fixes a shader delegate method.

Change-Id: I86be80ab55d04760084d5bf39235f2ee4de7be23
2014-09-10 17:01:16 -07:00
Dianne Hackborn
f5cc3644f6 Fix build.
Change-Id: I92eabc35168acfe58641917179be0d90a14f2f11
2014-09-09 17:38:34 -07:00
Deepanshu Gupta
8f92d92a09 Build layoutlib create tests as part of sdk build.
LayoutLib Create tests are now built whenever LayoutLib create is built.

Change-Id: Id215e8690e435019579dba1734090a0d585f37e1
2014-09-08 18:38:57 -07:00
Deepanshu Gupta
8d29a06ad7 Merge "Update IntelliJ project file for IntelliJ 14" into lmp-dev 2014-09-09 00:31:03 +00:00
Deepanshu Gupta
93b828de58 Merge "Add layoutlib tests to DIST_DIR" into lmp-dev 2014-09-09 00:30:24 +00:00
Deepanshu Gupta
fa4e214814 Merge "Remove warning for null entries in resource array." into lmp-dev 2014-09-09 00:30:08 +00:00
Deepanshu Gupta
8c766fea93 Update IntelliJ project file for IntelliJ 14
IntelliJ keeps reordering the options this way each time the project is
opened.

Change-Id: I0e19b5b0a858b3fa9a1134b883ed5180c4ef146e
2014-09-08 14:49:49 -07:00
Winson Chung
2e7f3bdcc9 Removing unnecessary delays, ensuring transition thumbnail is the size of the header. (Bug. 16987565)
Change-Id: Ic104876c5fe16997eca00e0a2b3d8644c927120c
2014-09-07 20:08:40 +00:00
Deepanshu Gupta
a0904bf7aa Add layoutlib tests to DIST_DIR
Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk
targets. These can be used for continuous testing on the build server.

Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f
2014-09-05 14:01:27 -07:00
Deepanshu Gupta
cd0bb17d30 Remove warning for null entries in resource array.
Change-Id: I32e0b8129e29f3e1e5a472b26e16f3fd06d4b91b
2014-09-04 12:54:26 -07:00
Deepanshu Gupta
a780eee462 Merge "Resolve color xml attributes properly. [DO NOT MERGE]" into klp-modular-dev 2014-09-04 01:53:38 +00:00
Deepanshu Gupta
708df7bc45 Merge "Remove ANDROID_BUILD_TOP from intelliJ path variables." into lmp-dev 2014-09-04 01:51:55 +00:00
Deepanshu Gupta
db0b8a1997 Merge "enums in dimension attributes." into lmp-dev 2014-09-04 01:48:24 +00:00
Deepanshu Gupta
351ed32961 Merge "Null out "@null" attributes." into lmp-dev 2014-09-04 01:48:14 +00:00
Deepanshu Gupta
bcbe8fcdb1 Merge "LayoutLib: Fix warnings in ResourceHelper." into lmp-dev 2014-09-04 01:46:58 +00:00
Deepanshu Gupta
a7c2419ec9 Merge "LayoutLib: Allow '+' in float attributes." into lmp-dev 2014-09-04 01:46:42 +00:00
Deepanshu Gupta
d75edc41a6 Merge "Fix invalid conditional check." into lmp-dev 2014-09-04 01:46:14 +00:00
Deepanshu Gupta
b988c8fa66 Build layoutlib_create tests.
Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61
2014-09-03 12:57:12 -07:00
Deepanshu Gupta
1a12b80569 LayoutLib: Fix warnings in ResourceHelper.
Fix intelliJ warnings in ResourceHelper. Most of them just change
boolean checks "x == false" with "!x".

Change-Id: I278645e2807affd8b3183a4a6f5e4fa2ab7b3d21
2014-09-03 11:59:33 -07:00
Deepanshu Gupta
458f2a7bbb LayoutLib: Allow '+' in float attributes.
Earlier change to fix the invalid conditional check inadvertedly
disallowed '+'.

Change-Id: I75a37926681fe3a496482d6fb75161ac75326109
2014-09-03 11:59:22 -07:00
Deepanshu Gupta
ca22ba9eaf Fix invalid conditional check.
The check was always false. This wasn't really a problem since the regex
check later took care of it. But it's just wrong to leave such mistakes
in the code once they are noticed.

Change-Id: I84270a96141428bf15949ce8c881d2e4a2aa95f6
2014-08-26 16:33:14 -07:00
Deepanshu Gupta
bc34eb11f6 enums in dimension attributes.
enums in resources were only read for integer attributes. This change
parses the enums for dimension resources also. This also means that we
don't have to hardcode the resolution for match_parent and wrap_content.

TODO: Fix this for all resource types.

Bug: http://b.android.com/75285
Change-Id: I86752b2322ea017499942a87568ba5c54b8654e4
2014-08-26 14:02:25 -07:00
Deepanshu Gupta
d4cf391c61 Null out "@null" attributes.
Remove references to the  resourceValue for "@null". This saves needless
checking for "@null" every time an attribute is requested.

Change-Id: I816e78619fa0b1ddcacd1ef5ac90765e30a9a44c
2014-08-25 21:04:10 -07:00
Winson Chung
a4ccb86ddc Multiple performance changes to speed recents invocation/app launching time. (Bug 16987565)
- Reverting changes to the existing thumbnail transition to prevent breaking applications
  that currently depend on that transition.  As a result, we need to create a new, hidden,
  aspect-scaled thumbnail transition, and instead use that thumbnail to animate the
  recents header so that we don't have to wait to do that inside the Recents activity.

  In order for this to work, we also have to ensure that the thumbnail surface destruction
  is synchronized with the application that is currently closing (when going down to
  recents) or opening (when coming back up).  The current thumbnail is destroyed when the
  animation ends, but that can be at least 1 frame before the surface for the animating
  window is destroyed.  We change this by deferring destruction of this thumbnail window
  to the animation that is being closed.

  Especially on the way up, not having to wait for us to hide the header before doing the
  transition up can save us the duration of that first animation (> 100ms).

- Other optimizations:
  * No longer creating a new stack view on each transition to calculate the target rect
  * Removing unnecessary call to get the thumbnail when transitioning up/down (the actual
    window does its own animation.
  * We reduced numerous system calls per task by adding a flag to ignore home-stack tasks
    and caching the activity label and icon (and task description icon).  These caches
    follow the same eviction schemes as the thumbnail and icon cache.

- Also tweaked the touch slop for the nav bar swiping gesture to prevent conflicting with
  tapping on home (Bug 17109581)

Change-Id: Ica697aad788051a9203edd9351c583e1cb038a71
2014-08-25 18:52:32 -07:00
Deepanshu Gupta
ffee9b2740 Fix "@null" resource values in LayoutLib. [DO NOT MERGE]
Bug: http://b.android.com/74072
Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542
(cherry picked from commit c9cd725f1013bed27e6f6594b176c10a6a4c0f16)
2014-08-26 00:48:18 +00:00
Deepanshu Gupta
cc7ccc3fc1 Resolve color xml attributes properly. [DO NOT MERGE]
Color attributes were not being converted to int properly. The
conversion to int was a simple string to int using base 16. This change
resolves the colors as per #RGB, #ARGB, #RRGGBB or #AARRGGBB format
depending on the length of the attribute. All values that begin with '#'
are treated as colors.

Bug: http://b.android.com/73845
Change-Id: I8ad089b821af1e290b9b95771b50213fe2fdd784
(cherry picked from commit 81564dfe60020fa977d39d168f682e9d61825660)
2014-08-26 00:26:56 +00:00
Deepanshu Gupta
0774bc4605 Remove ANDROID_BUILD_TOP from intelliJ path variables.
The variable is not actually needed and it makes working with different
API levels a lot easier since everything now depends on $PROJECT_DIR$.

This change also makes the tests more robust by improving the way it
tries to find the SDK.

Change-Id: I3502ad4a0ba85fd88b497e47964fddb2a89e520c
2014-08-25 15:47:28 -07:00
Deepanshu Gupta
151b68ddc2 Fix "@null" resource values in LayoutLib.
Bug: http://b.android.com/74072
Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542
2014-08-19 17:16:48 -07:00
Deepanshu Gupta
553a4e9138 Add time to status bar and fix wifi icon.
Add vector drawable for wifi icon. Also add time to the status bar.

Change-Id: I01da833087a607e9bb6ff085929e3844990179f8
2014-08-18 16:46:29 -07:00