582 Commits

Author SHA1 Message Date
Deepanshu Gupta
7f56beb840 Support actionProviderClass attribute for menus [DO NOT MERGE]
The change adds support for view cookies for actionProviderClasses (for
example, ShareActionProvider) in the action bar menus.

This also provides a more robust search for the overflowMenuButton.

Change-Id: I316c8b9a69e2e337b41ba0fe4e61af9fe850f750
(cherry picked from commit 28fa661f79e18fc9fc46bf112edded9c0d07696f)
2014-05-02 18:01:11 -07:00
Deepanshu Gupta
f61bd00206 Fix class name for OverflowMenuButton [DO NOT MERGE]
Change-Id: Ie3e709e7aadb2193397df8befef0c55624d7e4e3
(cherry picked from commit 4b5fa4d318e7efaffdc678e0cb8953ffc78c2b1e)
2014-05-02 17:52:04 -07:00
Deepanshu Gupta
d558ebdb43 Add special system view cookie to OverflowButton. [DO NOT MERGE]
Add a special view cookie to enable the IDE to identify the overflow
menu button in the Action Bar.

Change-Id: Ida3ed776afb8c9fa8af23b73d4cf6d47eef0ab87
(cherry picked from commit c967d8dc62c429ecf3e27bf3714a953636e75cbf)
2014-05-02 17:43:25 -07:00
Deepanshu Gupta
a98121ef52 Fix style warnings in RenderSessionImpl [DO NOT MERGE]
Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit fbfeb1a90b6f8f3966c60a69d50ce8f608d9d861)
2014-05-02 17:34:00 -07:00
Deepanshu Gupta
7704837947 Add view cookies for action bar menus. [DO NOT MERGE]
The change adds the view cookies for the menus rendered in the action
bar. This enables the IDE to map the menu to the relevant XML Tag in the
menu xml and show the highlighting accordingly.

The change also contains a bugfix where a method wasn't renamed
properly.

Change-Id: Idcfc263a8ebe0a4f25afa3a1eb085fa628fd03ca
(cherry-picked from commit 5ba2f230faa355eb9bc1e90f6c48eeeb437f390c)
2014-05-02 17:33:05 -07:00
Deepanshu Gupta
b5cdfd97a5 Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]
In addition to the cherrypicked changes, appropriate changes due to
changes to com.android.internal.widget.ActionBarView are made.

The icon used in the Action Bar may not always be the right one due to
the above resolution.

Change-Id: Ib7cc314079099c010f7d53849e204db36c410357
(cherry-picked from commit 1b87390c9426c4bc9119829e9375d712dfde11c3)
2014-04-25 19:45:33 -07:00
Deepanshu Gupta
20e0695b55 Action bar rendering in layoutlib [DO NOT MERGE]
This also makes a couple of changes to the framework:
1. ShareActionProvider - Use edit mode to execute activity chooser code.
2. ActionBarImpl - add a new constructor for use by layoutlib.

This also relies on some changes to the plugin to pass the correct params.

Change-Id: Ia30fef816afd91ec1e439734d56b59b1323bfee2
(cherry-picked from 4ccc4bd54f85d86818f61d728c6361d2003ddd8e)
2014-04-25 19:22:14 -07:00
Deepanshu Gupta
3c00b28bf6 Fix theme/style resolution in Layoutlib [DO NOT MERGE]
Cherry picked from klp-dev from
Change-Id: If1e7187645f0b0388f7b97d742395efd228b347a which was
cherrypicked from master with the following

Change-Id: Icfb91e566666408802dadc0e2070991151b16b9d
(cherry picked from commit f1e7187645f0b0388f7b97d742395efd228b347a)
2014-04-25 18:58:15 -07:00
Deepanshu Gupta
b85d30a2c8 Add missing dependency in layoutlib build file [DO NOT MERGE]
Add missing dependency on built_ext_data

Change-Id: I4e7cca7f6cbc7f5b7416ac9b85a9aec01e61ecd4
(cherry-picked from commit e345507ca4b7b83c6e0446788f4404eb697f945b)
2014-04-25 18:55:47 -07:00
Deepanshu Gupta
f8144032d1 Fix visitFieldInsn in layoutlib_create. [DO NOT MERGE]
The bug caused some classes to be missed when computing the dependencies
of the existing classes.

Change-Id: I7285ff67e016ce5d73a8550501f49acc73cfadfa
(cherry-picked from 6f9baea47757fef4745de434e09bd552fddc1f03)
2014-04-25 18:53:38 -07:00
Deepanshu Gupta
89fdc0c556 Layoutlib tests now check methods return value [DO NOT MERGE]
The change is a cherry-pick from klp-dev.

The change also fixes the errors found by fixing the tests.

Change-Id: I87cef323c4eaee4e9f60475f01156b276593fa50
(cherry-picked from commit bdd0ad79b9b027280bd371c7b6795b04ed89ac8f)
2014-04-25 18:50:39 -07:00
Deepanshu Gupta
d4f0073f48 Remove references to java package class Objects. [DO NOT MERGE]
Remove references to Java 7 class java.util.Objects and replace it with
a new class that can be loaded on Java 6.

Change-Id: Ibbd9b20b8bc89e247f1d0c48d743d06d1a4f0704
(cherry-picked from commit 45f5cd49fa898a59484edfd8e291dbe10df82db2)
2014-04-25 18:49:40 -07:00
Deepanshu Gupta
5a1250532f Merge changes I66792c4d,I203b6783 into jb-mr2-dev
* changes:
  Improve text rendering and measurement. [DO NOT MERGE]
  Fix the measurement of text bounds. [DO NOT MERGE]
2014-04-16 18:34:12 +00:00
Deepanshu Gupta
04b4f8d114 Merge "Set default text style in layoutlib as NORMAL [DO NOT MERGE]" into jb-mr2-dev 2014-04-16 18:34:04 +00:00
Deepanshu Gupta
fb120acd84 Merge "Add methods for Time_Delegate [DO NOT MERGE]" into jb-mr2-dev 2014-04-16 18:33:47 +00:00
Deepanshu Gupta
b7fd631532 Merge "Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]" into jb-mr2-dev 2014-04-16 18:33:32 +00:00
Deepanshu Gupta
f14cbb26ed Merge "Optimize layout rendering in layoutlib [DO NOT MERGE]" into jb-mr2-dev 2014-04-16 18:33:11 +00:00
Deepanshu Gupta
c07a48bed2 Merge "Fix a bug in Nine Patch library. [DO NOT MERGE]" into jb-mr2-dev 2014-04-04 00:45:45 +00:00
Deepanshu Gupta
70dfe86501 Merge "Add missing files to fix libphonenumber for layoutlib. [DO NOT MERGE]" into jb-mr2-dev 2014-04-04 00:45:29 +00:00
Deepanshu Gupta
2eb5f9e5b2 Merge "Add libphonenumber to layoutlib.jar. [DO NOT MERGE]" into jb-mr2-dev 2014-04-04 00:45:13 +00:00
Deepanshu Gupta
b6588c5224 Merge "Fix NPE in layoutlib. [DO NOT MERGE]" into jb-mr2-dev 2014-04-04 00:44:02 +00:00
Deepanshu Gupta
3bc5b23f8d Merge "Fix layoutlib [DO NOT MERGE]" into jb-mr2-dev 2014-04-04 00:43:48 +00:00
Deepanshu Gupta
c63e87d53d Set default text style in layoutlib as NORMAL [DO NOT MERGE]
If a style doesn't specify text style (normal/bold/italic/bold-italic)
then default to normal instead of throwing an error.

Bug: http://b.android.com/61358
Change-Id: I0138c73807a5ff6e4d938a99ece3044333110aa1
(cherry-picked from 0acfb16dcd95468fe032204f54618e86becfd1eb)
2014-03-28 15:00:25 -07:00
Deepanshu Gupta
5fb41528a6 Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
For these font families, text was always rendered as italic. This
changeset fixes the issue.

Bug: http://b.android.com/57221
Change-Id: Ic8a299bd1e555f5bb914cd3d2fe72917ec7f471a
(cherry-picked from e327212adde1136807bbdf052e8cc3861f8a6aba)
2014-03-28 14:55:03 -07:00
Deepanshu Gupta
88301948c9 Improve text rendering and measurement. [DO NOT MERGE]
1. Fix a bug where baseline of the run was modified while rendering
resulting in crooked text in some cases.

2. Use GlyphVector.getLogicalBounds() for text measurement which is more
accurate than getVisualBounds().

3. This change also optimizes text rendering by not computing the advances
for individual glyphs when not needed.

Change-Id: I66792c4d8f50eaf29afa70bccca1e6c812a3fa28
(cherry-picked from 45dbfcc781a3926d22571b6ccfa3f27ec896f119)
2014-03-28 14:46:51 -07:00
Deepanshu Gupta
ddb7f3273c Add methods for Time_Delegate [DO NOT MERGE]
Bug: http://b.android.com/65359
Change-Id: I7c2d09286d6bcd9899444aaa5a4a5a342e39d923
(cherry-picked from eb3c5459eb893061779b102236a81069efdbef73)
2014-03-28 14:44:50 -07:00
Deepanshu Gupta
9e5e993c79 Optimize layout rendering in layoutlib [DO NOT MERGE]
The height of a layout should be zero if it is assigned a layout_weight.
This way, the layout is measured only once and prevents spurious errors.

Bug: https://code.google.com/p/android/issues/detail?id=58398
Change-Id: If49a7480e5eb82cb86780e00f2f5b65ee053fc2a
(cherry-picked from 35d56c0d67537e56fafebd8edf790026644fe8de)
2014-03-28 14:21:10 -07:00
Deepanshu Gupta
eb1fae940d Fix the measurement of text bounds. [DO NOT MERGE]
Bug: 12366230
Change-Id: I203b678363dc7b688c744503ee10216baca658a9
(cherry-picked from 5ad7c183f39df43562c69aba21ea422ad69bdae0)
2014-03-28 14:08:02 -07:00
Deepanshu Gupta
ee1187a94f Fix a bug in Nine Patch library. [DO NOT MERGE]
The nine patches were not drawn correctly if they were not positioned at
the top left corner of the canvas.

Bug: http://b.android.com/29959
Change-Id: Icfed522ea07322a3ee9f3955067d3da26c4b0b5b
(cherry-picked from 8a892279bd1b212311f4200f306a317985463918)
2014-03-27 19:00:28 -07:00
Deepanshu Gupta
8a16f8e29a Add missing files to fix libphonenumber for layoutlib. [DO NOT MERGE]
Change-Id: I8102da6c1c4625e887293a8823770d199521c53f
(cherry-picked from 58037a4404e639d28695a0f1c17053b53b96b970)
2014-03-27 18:44:53 -07:00
Deepanshu Gupta
317f304893 Add libphonenumber to layoutlib.jar. [DO NOT MERGE]
Issue: http://b.android.com/59497
Change-Id: Ief11e602703b6041db66241f1699cc1de72e65a5
(cherry-picked from 1f92d7fc0ffa72d7db93244c29a1a6575bb4b318)
2014-03-27 18:44:44 -07:00
Deepanshu Gupta
80c55109b6 Fix NPE in layoutlib. [DO NOT MERGE]
Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry-picked from d0581d271e814670d81a6550aa7b1e86864d5710)
2014-03-27 16:02:52 -07:00
Deepanshu Gupta
28873c1f00 Fix layoutlib [DO NOT MERGE]
Fix a NPE, and update an ICU method to return the right value as
required by DatePicker widget.

The cherry-pick differs slightly from the original to remove changes not
relevant to the current branch.

Bug: 11140701
Change-Id: Id92fc5359acf6dde1bcdbc781aaf637fdb6eecbf
(cherry-picked from 39e75835399f4d979cf82069dae2bd1ec496fb81)
2014-03-27 15:25:04 -07:00
Deepanshu Gupta
0b7d80765c Fix text size in Fake Action Bar. [DO NOT MERGE]
The density multiplier was being applied twice to the title text in
the fake action bar.

Bug: 11436018
Change-Id: Id74c11037cb43d01f6cd79126623c84edfc37aaf
(cherry-picked from f4800bc3b122828d61a34caecbf782eee170ae59)
2014-03-27 15:09:45 -07:00
Deepanshu Gupta
a49c358576 Merge "Fix CalendarView to show the right month and year label." into jb-mr2-dev 2013-10-17 16:01:08 +00:00
Deepanshu Gupta
ec55590216 Merge "Layoutlib: Update the wifi icon in the status bar." into jb-mr2-dev 2013-10-17 16:00:57 +00:00
Deepanshu Gupta
083e3caf66 Fix CalendarView to show the right month and year label.
Change-Id: I95431f1054678d4192bd1621c1f69b29268f55e9
2013-10-16 15:09:52 -07:00
Deepanshu Gupta
81f74f4bc9 Fix DatePicker and Calendar widget in layoutlib.
Issue: https://code.google.com/p/android/issues/detail?id=59732
Change-Id: I281b3fdad88c591281a3645592c84f3e2cb61d09
2013-10-16 15:09:52 -07:00
Deepanshu Gupta
1cf5df38f4 Layoutlib Create: Remove references to non-std Java classes.
Do not add the non-standard Java classes. Updates the references to all
non-standard classes to new classes in
com.android.tools.layoulib.create package. This also treats
java.lang.AutoCloseable which is part of Java 7 similarly so that we can
still run on Java 6.

Change-Id: Iac5b272652e2780c9bb72d19f415d150948ca589
2013-10-16 15:09:50 -07:00
Deepanshu Gupta
9cb5f5b523 Layoutlib: Update the wifi icon in the status bar.
Issue: https://code.google.com/p/android/issues/detail?id=60993

Change-Id: Ia43ed40b42c79f67dcd5809b827d4fecbc823c25
2013-10-14 10:35:46 -07:00
Deepanshu Gupta
54d88f7678 Fix ClassCastException when rendering ListView
Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
2013-09-10 18:38:41 -07:00
Deepanshu Gupta
0d9c922c96 Fix text rendering
There are still some errors
1. Little vertical clippping for extra tall glyphs.
2. Breaking into scripts isn't perfect which results in incorrect layout
of text.

Change-Id: I54de3c05eca5e8affb1135c120eea24c3afe8a47
2013-09-05 10:58:10 -07:00
Deepanshu Gupta
88db0ee2af Fix layout rendering for RTL locales
This changeset adds the framework resources for RTL locales and mirrors
the layout if the application is RTL aware.

Use ICU to check the character orientation of the locale - right to left
or left to right. Set the layout direction on the top level layout
accordingly. Also, load the RTL resources for Nav Bar when the locale is
RTL.

Change-Id: I1ed0d516ab64120a0abca413ba678036661508f8
2013-09-04 14:23:53 -07:00
Deepanshu Gupta
d97d60c0fa Add orientation to configuration for layoutlib.
Update the configuration with the device orientation before rendering.

Change-Id: Icd40901204fd13f90b18353e53a15e25e5b2176c
2013-07-12 15:54:08 -07:00
Deepanshu Gupta
279c00e8e0 Add missing native methods.
Change-Id: I7b34e2ec0164520efc658053a80f307791a992b1
2013-05-23 16:44:01 -07:00
Jeff Brown
f9e989d5f0 Queues, queues, queues and input.
Redesigned how ViewRootImpl delivers input events to views,
the IME and to native activities to fix several issues.

The prior change to make IME input event delegation use
InputChannels failed to take into account that InputMethodManager
is a singleton attached to the main looper whereas UI may be
attached to any looper.  Consequently interactions with the
InputChannel might occur on the wrong thread.  Fixed this
problem by checking the current thread and posting input
events or callbacks to the correct looper when necessary.

NativeActivity has also been broken for a while because the
default event handling logic for joysticks and touch navigation
was unable to dispatch events back into the native activity.
In particular, this meant that DPad synthesis from touch navigation
would not work in any native activity.  The plan is to fix
this problem by passing all events through ViewRootImpl as usual
then forwarding them to native activity as needed.  This should
greatly simplify IME pre-dispatch and system key handling
and make everything more robust overall.

Fixed issues related to when input events are synthesized.
In particular, added a more robust mechanism to ensure that
synthetic events are canceled appropriately when we discover
that events are no longer being resynthesized (because the
application or IME is handling or dropping them).

The new design is structured as a pipeline with a chain of
responsibility consisting of InputStage objects.  Each InputStage
is responsible for some part of handling each input event
such as dispatching to the view hierarchy or to the IME.
As a stage processes an input event, it has the option of
finishing the event, forwarding the event to the next stage
or handling the event asynchronously.  Some queueing logic
takes care to ensure that events are forwarded downstream in
the correct order even if they are handled out of order
by a given stage.

Cleaned up the InputMethodManager singleton initialization logic
to make it clearer that it must be attached to the main looper.
We don't actually need to pass this looper around.

Deleted the LatencyTimer class since no one uses it and we have
better ways of measuring latency these days using systrace.

Added a hidden helper to Looper to determine whether the current
thread is the indicated Looper thread.

Note: NativeActivity's IME dispatch is broken by this patch.
This will be fixed later in another patch.

Bug: 8473020
Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
2013-04-08 15:31:47 -07:00
Brian Colonna
b1b9a8ac07 FUL now restarts when flipping tablet 180 (bug 7484464)
When a tablet rotates, FUL must be stopped and restarted in a new
position.  90 degree rotations cause a configuration change, causing
FUL to be automatically reconstructed in the new location.  However,
a 180 degree rotation is not a configuration change, so FUL was not
restarting.  A 180 degree rotation happens more often than one might
think.  If you set the tablet down and later picked it up in the
opposite orientation, FUL would not work prior to this fix.

This change adds a rotation watcher to KeyguardFaceUnlockView.  It
watches for 180 degree rotations and stops and restarts FUL
accordingly.

The rotation watcher callback must be unregistered when
KeyguardFaceUnlockView is recreated (as during 90 degree rotation
changes), otherwise the number of rotation watcher callbacks will keep
growing and they will never go away.  This is a problem not just
because there are many callbacks hanging around, but also because the
old callbacks end up trying to access biometric unlock views that no
longer exist, resulting in crashes.  So, a simple function was added
to the window manager to unregister a rotation watcher.

Change-Id: Ie1ef20a9a22b8f4e39918987dff2b8ad444fcfd1
2013-03-29 18:35:43 -04:00
Dianne Hackborn
f3d46ce88f Fix build.
Change-Id: I51b87ee5f0b7f396aad7e239893d9f0764f04bb6
2013-03-26 18:00:42 -07:00
Dianne Hackborn
4ec6cc5108 Fix build.
Change-Id: Iaa70b05a3cfd372518ec35aa8bcea2f9d78b8292
2013-03-05 10:28:05 -08:00
Craig Mautner
2ad920759b Revert ActivityManager changes for tasks. DO NOT MERGE
Keeping all activity=>task changes in master and removing them
from jb-mr2.

Revert "Update histories simultaneously."
Revert "Add null check to setAppGroupId."
Revert "Fix crashing bug in validator."
Revert "Switch topRunning* and moveTaskTo*"
Revert "Begin switch over to task based history."
Revert "Reset and reuse Iterators and don't new() one."
Revert "Remove AppWindowToken lists."
Revert "Fix build."
Revert "Remove unused App methods."
Revert "Stop using AppToken movement and start using Task."
Revert "Replace access to mAppTokens with AppTokenIterator"
Revert "Refactor setAppOpVisibility implementation."
Revert "Add AppWindowTokens to TaskList."
Revert "Make ActivityStack.mHistory private."
Revert "Migrate AppWindowToken lists into DisplayContent."

Change-Id: I5722c9a4956dccb52864207e2967690bc58e4ebb
2013-02-25 17:07:39 -08:00