2667 Commits

Author SHA1 Message Date
Deepanshu Gupta
a6671b7074 am 6461e054: Merge "Add image comparison to LayoutLib tests." into lmp-dev
* commit '6461e05420c6f42b0e70134a4e0d2a626161ab74':
  Add image comparison to LayoutLib tests.
2015-01-05 23:33:18 +00:00
Deepanshu Gupta
0db2524caa am b2ebb968: Merge "Remove Time from CreateInfo" into lmp-dev
* commit 'b2ebb9683fb5b21543b50772a0d4c646ced7764b':
  Remove Time from CreateInfo
2015-01-05 23:33:14 +00:00
Deepanshu Gupta
937db7a39e am 53f73a97: Merge "Add DatePicker, CalendarView to LayoutLib tests" into lmp-dev
* commit '53f73a97542c277a519b973060dfa217849b66de':
  Add DatePicker, CalendarView to LayoutLib tests
2015-01-05 23:33:10 +00:00
Deepanshu Gupta
e69e4f8b4d am f9bb0b5e: Merge "Fix DatePicker rendering." into lmp-dev
* commit 'f9bb0b5e133b0c364c3f87623f0fdff0fedc5226':
  Fix DatePicker rendering.
2015-01-05 23:33:06 +00:00
Deepanshu Gupta
8c686ddd54 am d20a518c: Merge "Make Preference-cookie map non static." into lmp-dev
* commit 'd20a518c82e5e33d33e3dc5d74bf3c17d807f7d7':
  Make Preference-cookie map non static.
2015-01-05 23:33:02 +00:00
Deepanshu Gupta
cec8e5a10d am f861c0ce: Merge "Fix default initial value for preferences" into lmp-dev
* commit 'f861c0ce3ff42550f3d5ede837e7bfb3855f5964':
  Fix default initial value for preferences
2015-01-05 23:32:58 +00:00
Deepanshu Gupta
7ed145493d am 7081a114: Merge "Add preferences rendering." into lmp-dev
* commit '7081a114d4ee190c746f337057b0f84928c162dd':
  Add preferences rendering.
2015-01-05 23:32:53 +00:00
Deepanshu Gupta
58df125bbc Add image comparison to LayoutLib tests.
The LayoutLib rendering tests now compares the rendered image with a
golden file from a previous execution. This will help catch any
unexpected changes in the final rendering.

Change-Id: I80251a778e89df7d7ec13863a8f299967f3d747d
2015-01-05 11:32:41 -08:00
Deepanshu Gupta
4022272a4f Remove Time from CreateInfo
Time_Delegate was removed in change with Change-Id:
Iae5ef65678f0e6c7c5af520c45bd15980ce3fa55. But the name wasn't removed
from CreateInfo. This didn't cause any problems at runtime, but caused
the layoutlib_create tests to fail.

Change-Id: I079b1e024b97d389eb07d4f088fd860efbb02eb3
2015-01-02 13:55:20 -08:00
Deepanshu Gupta
eae390a94e Add DatePicker, CalendarView to LayoutLib tests
Change-Id: Ice8c41ff90ccb0ffe90fcbfcccc91ea24225a3d9
2015-01-02 11:20:19 -08:00
Deepanshu Gupta
e64a5bd2fb Fix DatePicker rendering.
1. Return AccessibilityManager service from context.
2. Don't throw an exception if no style specifited in
obtainStyledAttributes. Specifying no style is valid and it's supposed
to use the default theme in that case.

Bug: http://b.android.com/82712 and http://b.android.com/79218
Change-Id: Iba7097f36996e4d6f1e9db778dc73294f2854c79
2014-12-29 12:29:16 -08:00
Deepanshu Gupta
0ff4568ca0 Make Preference-cookie map non static.
Moved the map from Preference to View Cookie to BridgeContext. This
means the map need not be static anymore.

NO_SQ: Depends on unsubmitted changes.
Change-Id: I662513def17bd6ec3a2646c3bec9bf4f9f89fc15
2014-12-23 12:04:30 -08:00
Deepanshu Gupta
dfeffd4c0a Fix default initial value for preferences
NO_SQ: Depends on unsubmitted changes.
Change-Id: I061cf71f6167d382e9ef060abeb4d5cff83c4104
2014-12-23 12:04:30 -08:00
Deepanshu Gupta
10bb1371dc Add preferences rendering.
NO_SQ: Depends on updating layoutlib-api-prebuilt.jar
Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
2014-12-23 12:04:30 -08:00
Deepanshu Gupta
6cbef4bd3e am 03af0c42: Merge "Ensure that RandomAccessFile is not leaked." into lmp-dev
* commit '03af0c42d80734c44198b96a99488bb94816ae97':
  Ensure that RandomAccessFile is not leaked.
2014-12-03 20:58:27 +00:00
Deepanshu Gupta
4628d51a0d am 141c7614: Merge "Fix AnalogClock rendering" into lmp-dev
* commit '141c7614fdef45d1a95ccb325da762a79412aae2':
  Fix AnalogClock rendering
2014-12-03 20:58:23 +00:00
Deepanshu Gupta
fb30a783d3 am 7e55c292: Merge "Fix typos in previous bugfixes." into lmp-dev
* commit '7e55c29281f8a62154451e87b45d95ec5f97c5ac':
  Fix typos in previous bugfixes.
2014-12-03 20:58:19 +00:00
Deepanshu Gupta
5ceb7f6431 Ensure that RandomAccessFile is not leaked.
This change ensures that RandomAccessFile is always closed. Also, it
changes the BufferIterator implementation to delegate to the byte buffer
directly instead of mainitaining the position itself.

Change-Id: I8f93e80c91a7c35e6a7fb015185b8b11e36b6286
2014-12-02 14:24:36 +05:30
Deepanshu Gupta
17a6170c62 Fix AnalogClock rendering
1. Change calls to java.lang.System.log* since they don't exist on the
host.
2. Clean up method rewrite mechanism in ReplaceMethodCallsAdapter.
3. Stub out creation of uninitialized GregorianCalendar.
4. Memory map the time zone data base file and provide a custom
implementation of BufferIterator for use by ZoneInfoDB
5. Delete unused Time_Delegate

Also fixed a comment in BridgeAssetManager and an error message in
FontFamily_Delegate.

Bug: http://b.android.com/79160
Change-Id: Iae5ef65678f0e6c7c5af520c45bd15980ce3fa55
2014-11-26 12:03:39 +00:00
Deepanshu Gupta
cb09bc45c5 Fix typos in previous bugfixes.
The commits 2c9fbdd and 12b6d29 introduced minor bugs. This change fixes
them.
2014-11-20 13:35:47 +00:00
Deepanshu Gupta
ddc83dfa8f am 4104abf8: Merge "Fix setTextAppearance for styles with dots." into lmp-dev
* commit '4104abf875e16ad54c248ce602e573d2144732dd':
  Fix setTextAppearance for styles with dots.
2014-11-19 23:00:43 +00:00
Deepanshu Gupta
a0bc2e7e3c am 455654cf: Merge "LayoutLib: Stub AM/PM keycodes in Time Picker." into lmp-dev
* commit '455654cffdaebcbbd4fa33de5bb18fa2752d6c9a':
  LayoutLib: Stub AM/PM keycodes in Time Picker.
2014-11-19 23:00:39 +00:00
Deepanshu Gupta
4104abf875 Merge "Fix setTextAppearance for styles with dots." into lmp-dev 2014-11-19 22:30:20 +00:00
Deepanshu Gupta
2c9fbdd29c Fix setTextAppearance for styles with dots.
Bug: http://b.android.com/78842
Change-Id: I65923134b2d3812030e2b7dd8ab96363b0647c1f
2014-11-18 22:52:10 +00:00
Deepanshu Gupta
12b6d29b7b LayoutLib: Stub AM/PM keycodes in Time Picker.
TimePickerSpinnerDelegate doesn't need to deal with input when running
inside LayoutLib. So, we just return the keycodes as if it's running in
English locale.

Bug: http://b.android.com/79189
Change-Id: Ife0ae91a1e34a8dac379bc1dda1c1c8ed461c164
2014-11-18 22:02:40 +00:00
Deepanshu Gupta
5ad9b395db am a44fdb9e: Merge "Don\'t skip loading object animator." into lmp-dev
* commit 'a44fdb9e216810ba62f20c1b4571ebc240931efa':
  Don't skip loading object animator.
2014-11-11 17:17:02 +00:00
Deepanshu Gupta
2c5cddbd07 Don't skip loading object animator.
This is used by Buttons as part of StateListAnimator.

Change-Id: Id370869e71898d46e11bbd17ad31169c9f9f5274
2014-11-11 15:21:19 +00:00
Deepanshu Gupta
4c0f0e6c85 Merge "Fix setting styles in custom views." into lmp-dev
automerge: 5c22a79

* commit '5c22a79baf81727b56a85a194d678c18449b5150':
  Fix setting styles in custom views.
2014-11-10 21:00:43 +00:00
Deepanshu Gupta
3cf0640d94 Merge "Add primitive shadows support to LayoutLib" into lmp-dev
automerge: 97c04ac

* commit '97c04ac7ed4f34ca0cfb75646cc00687fb0954d4':
  Add primitive shadows support to LayoutLib
2014-11-10 20:58:58 +00:00
Deepanshu Gupta
0e3925dfb3 Merge "Remove needlessly thrown IOException." into lmp-dev
automerge: f305d2c

* commit 'f305d2c4a80af9e2011824349adc6f133cd8822c':
  Remove needlessly thrown IOException.
2014-11-10 20:56:36 +00:00
Deepanshu Gupta
8657baa06d Fix setting styles in custom views.
Bug: http://b.android.com/78842
Change-Id: I5d4571d94d96b00419acc258c9e2b519367b689d
2014-11-10 20:10:55 +00:00
Deepanshu Gupta
796e9b7f99 Add primitive shadows support to LayoutLib
The shadows rendered are not the same as rendered by the framework. The
main purpose of the shadows here is let the user know when shadows will
be cast.

Currently rectangular shadows are available in only two intensities. Any
elevation below 10dp uses one shadow and any elevation over 10 dp uses
the other.

Also, even though the code for arbitrary shapes exist, it doesn't quite
work yet. No shadows are visible when that code is run.

Change-Id: Ie8235ffccf1d3809713f5d8f82afde434817d6b2
2014-11-07 22:26:11 +00:00
Deepanshu Gupta
9173c8a2e9 Remove needlessly thrown IOException.
Change-Id: If34986367554c98f96f6f9a1088f5e25077a1be1
2014-11-06 11:43:37 -08:00
Deepanshu Gupta
0a2e42d4af Merge "Fix BridgeContext.get*ResourceValue()" into lmp-dev
automerge: 9b64954

* commit '9b64954cb5b30b03abaae0b24132e1b1876f8af1':
  Fix BridgeContext.get*ResourceValue()
2014-11-04 00:51:51 +00:00
Deepanshu Gupta
33996b9878 Merge "Support framework menus in ActionBar" into lmp-dev
automerge: c23487a

* commit 'c23487aa18a9882cb9c8c800c7c44ccb93ce60b9':
  Support framework menus in ActionBar
2014-11-04 00:50:48 +00:00
Deepanshu Gupta
cd5f3bab37 Merge "Use the right layout for inflating Action Bar." into lmp-dev
automerge: 84a89ed

* commit '84a89ed0f56d4c35cde5a1451a22a6edb59db06a':
  Use the right layout for inflating Action Bar.
2014-11-04 00:49:43 +00:00
Deepanshu Gupta
9b64954cb5 Merge "Fix BridgeContext.get*ResourceValue()" into lmp-dev 2014-11-03 23:15:03 +00:00
Deepanshu Gupta
c23487aa18 Merge "Support framework menus in ActionBar" into lmp-dev 2014-11-03 23:14:46 +00:00
Deepanshu Gupta
84a89ed0f5 Merge "Use the right layout for inflating Action Bar." into lmp-dev 2014-11-03 23:13:15 +00:00
Jeff Brown
e333e674a7 Add a function to boost screen brightness temporarily.
When PowerManager.boostScreenBrightness() is called, the screen
brightness is set to maximum for 5 seconds.  This action is
also considered to be user activity.

Bug: 17934954
Change-Id: I1cb4a03a60705c6c1c5cc9ff84b1c5dbd2932fcd
2014-10-31 18:45:11 -07:00
Deepanshu Gupta
9fa48b09ad Fix BridgeContext.get*ResourceValue()
getFrameworkResourceValue() and getProjectResourceValue() never really
returned the defValue passed to them, instead creating a new id for
non-existent resources. We now checks for the existence of the resources
before trying to obtain the id.

Change-Id: Ie3103ba32af6186651a5f77c27d1efc33dc2bcc7
2014-10-30 12:18:56 -07:00
Deepanshu Gupta
df0ebab0f9 Support framework menus in ActionBar
Add support for adding menus in the framework namespace to the ActionBar
preview. If a menu id name begins with the android namespace prefix
(android:) we find the framework menu and render it.

Change-Id: If52910b46154591883af2b2f357e72eea6f84235
2014-10-30 11:58:37 -07:00
Deepanshu Gupta
0bffc736e1 Use the right layout for inflating Action Bar.
The choice of Action Bar layout depends on the theme. This also affects
the widget used to render the Action Bar.

Bug: http://b.android.com/77853
Change-Id: I6219a02853b4cd207a6125a5ed96fa5d16699460
2014-10-30 11:58:37 -07:00
Deepanshu Gupta
617e809731 Add missing delegate for AnimatorInflater.
Change-Id: I96ef2b1085dadfae280df6740aebc10f57e3b949
2014-10-28 18:47:28 -07:00
Deepanshu Gupta
75bf1b1c6a Merge "Skip loading animations." into lmp-dev 2014-10-29 00:13:54 +00:00
Deepanshu Gupta
c55eb170cc Merge "Fix multiple styles case in resource resolution." into lmp-dev 2014-10-29 00:07:59 +00:00
Deepanshu Gupta
92a52142fd Merge "Use right theme for drawable inflation." into lmp-dev 2014-10-29 00:07:42 +00:00
Deepanshu Gupta
0b42936d86 Skip loading animations.
This is a temporary fix until Path.approximate() is supported.

Bug: http://b.android.com/77865
Change-Id: I28739e58f51fabaaf1dcc1c9be61cd0b17e84eec
2014-10-28 15:07:25 -07:00
Deepanshu Gupta
b6444c4309 Fix multiple styles case in resource resolution.
When multiple styles are applied to a theme, we only remembered the last
one. This change fixes the issue.

Change-Id: I46490e882edc3eabe522a641c83366234b5bb25d
2014-10-28 11:11:10 -07:00
Deepanshu Gupta
4a605c6fa0 Use right theme for drawable inflation.
The theme information was lost when inflating drawables. As a result,
drawables inflated in the ActionBar did not have the right tint.

Change-Id: I13d5c78039e35085ed4902289fcb735bb15d972e
2014-10-28 11:11:09 -07:00