12 Commits

Author SHA1 Message Date
Philip Milne
7a23b49a8c Fixes for optical bounds feature.
1. Make the feature opt-in (ViewGroup::layoutMode defaults to CLIP_BOUNDS) without inheritance.
2. Rename COMPONENT_BOUNDS to CLIP_BOUNDS.
3. Rename LAYOUT_BOUNDS to OPTICAL_BOUNDS.
4. Complete GridLayout implementation.
5. Change the default_gap between components to 8dp, to align with the Style Guide.

Change-Id: I8d40dfc5f4ca469f6424eb3ff60d07bec56e3a9f
2012-04-27 16:46:57 -07:00
Philip Milne
1557fd7809 Fix for bug 6110465.
Add layout bound metadata to 9-patch files and make layouts take them into account.

This CL contains a proposed API for dealing with layout bounds.

This solution exposes:

1. Class: Insets - for storing layout Insets (and later possibly padding).
2. Methods: View:(get/set)LayoutInsets() - for storing layoutBounds.
3. Methods: ViewGroup:(get/set)LayoutMode() - for controlling layoutMode.

It also iuncudes the changes to GridLayout to support layout bounds.

Change-Id: I60c836b6530b61c5abf37f93ee9c44aad73573f1
2012-04-13 16:25:08 -07:00
Philip Milne
e974f6384b Move Activity1 and Activity2 to API Demos area in development/samples.
Change-Id: Ib6521caca69b0a0d96c66d9df754d2af17cb6908
2011-10-06 16:11:35 -07:00
Philip Milne
b559976a50 Remove call to setPadding() in setUseDefaultMargins().
It is not possible for teh user to override the assigned padding values
because the XML attributes are processed in the opposite order.

Also, make the XML and Java examples grid3.xml and Activity2.java
consistent in preparation for a move to API demos.

Change-Id: I47334f9f5a46a8a528067d88350dd70eaa38ff33
2011-08-05 11:24:55 -07:00
Philip Milne
5125e21bc0 Fix for http://b/issue?id=5064532
5064532: GridLayout with initial "stretchy" row and "gone" view in last row doesn't stretch properly

Also:

. Infer stretchibility from whether or not gravity is defined.
. Make algorithms for handling flexibility within cell groups consistent
  with those acting between cells groups (via constraint system).
. Hide and deprecate methods taking flexibility argument.
. Hide and deprecate CAN_STRETCH constant.

Both deprecated features will be removed after references are removed from platform.

Change-Id: Iabf2bf19f35cf30b8ec49c99b49a0550fd495125
2011-07-25 12:12:10 -07:00
Philip Milne
5d1a9840aa Simplify and tidy the API for maximum value support.
Also:

. Remove CAN_SHRINK, FIXED from public view. These can be added later.

Change-Id: I63a64ac4748605da60373c8e3c2109178b5260c2
2011-07-07 14:23:00 -07:00
Philip Milne
48b55244d2 Support for maximum values in layout GridLayout.
A cell's ability to shrink or stretch is now integrated with the
constraints system, which is now supplied with both upper and lower
bounds.

Also:

. Remove package private access (pseudo) annotation
. Remove rowWeight and columnWeight attributes and fields
. Remove code to handle weights

Change-Id: I9e2432101d15466c621f51ae362435051fab5764
2011-07-01 11:08:19 -07:00
Philip Milne
a1f7b10f72 Handle baseline aligned rows in which some components define baseline and some don't.
Also:

. Make all of the methods in Alignment package private.
. Inlucde Tor's test case

Change-Id: If78a6a3b653723d9e12d6b162fd0c86b11a82dff
2011-06-23 11:41:57 -07:00
Philip Milne
1e54825135 Change includeMarginsInAlignment flag to aligmentMode property.
Also:

. Change getInteger() to getInt().
. Conditionally compile, Paint() allocation and initialization.
. Correct spelling mistake in javadoc.

Change-Id: I00438a717e635a3917c5324f56063dce2e6041e8
2011-06-16 20:47:29 -07:00
Philip Milne
51f17d5461 Bugfix for GridLayout assuming that the x value of last column index is maximal. This is not the case when column indexes are defined incorrectly and GridLayout should still work in this case.
Change-Id: I5deb3fb43ed1dd16dd20868854b96ebae4d30623
2011-06-13 10:44:49 -07:00
Philip Milne
f474870fe1 Optimise the way that indices are auto-allocated so that XML files can normally avoid using indices.
Change-Id: Iafb25b17fec9391664c81a7e213eeaa918254912
2011-06-10 10:51:45 -07:00
Philip Milne
3f8956d82b Introduction of GridLayout.
Change-Id: Ia2ec315e7d29dcc5aa13b080fc6ce00708e9c034
2011-05-26 09:28:26 -07:00