OSDN Git Service

When distributing linear layout weights, also set size to 0dp
authorTor Norbye <tnorbye@google.com>
Mon, 13 Jun 2011 23:12:07 +0000 (16:12 -0700)
committerTor Norbye <tnorbye@google.com>
Mon, 13 Jun 2011 23:12:07 +0000 (16:12 -0700)
commit762c68b0eeb2e58e6d1bf591732479a62d8ac035
treeb9e1df4598a8b6b37e77d8f15a04fec0ffa3ea07
parentdce68be01e3b9f330c4f9ea5660cdc20948ed382
When distributing linear layout weights, also set size to 0dp

When you use the layout actions bar "Distribute Weights" in a
LinearLayout, in addition to setting all the weights to the same
nonzero value, also set the size (the height for a vertical linear
layout and the width for a horizontal one) to 0dp, to ensure that the
widgets are all given the same total size rather than sharing the
remaining space evenly.

In addition, when adding new widgets to a LinearLayout, see if all
elements in the linear layout already have nonzero and equal weights,
and if so duplicate this weight value on the new widget as well, and
similarly also duplicate 0dp/0dip/0px if used.

Change-Id: Iac5284a866b19b27e91666dc62278c63b8dde2bb
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java