Settnig the LayoutParams for the first parent view?
<p>Here is my xmls (there are basically two views: a linear [<code>B</code>] inside a relative [<code>A</code>])</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/A"
android:layout_width= "wrap_content"
android:layout_height= "wrap_content" &gt;

&lt;LinearLayout
android:id="@+id/B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"&gt;
&lt;/LinearLayout&gt;

&lt;/&lt;RelativeLayout&gt;
</code></pre>

<p>I need to set the <code>RelativeLayout</code>'s params but I have no idea what class it should belonged to (since it is parentless).</p>

<pre><code>SomethingLayout.LayoutParams p = new SomethingLayout.LayoutParams(w*10, h);
A.setLayoutParams(p);
</code></pre>

<p>It would be great if someone can tell me how this can be done.</p>

<hr>

<p>The reason why I need to do that is because I want to set the width of <code>B</code> as 10 times of the screen width, namely <code>w*10</code>:</p>

<pre><code>RelativeLayout.LayoutParams para = new RelativeLayout.LayoutParams(w*10, h);
B.setLayoutParams(para);
</code></pre>

<p>When I animate <code>B</code>,</p>

<pre><code>ObjectAnimator animation2 = ObjectAnimator.ofFloat(B, "x", -w)
</code></pre>

<p>it shows that the width of <code>B</code> is <code>w</code> rather than <code>w*10</code>, as if <code>A</code>, who is being the parent view, is limiting its width.</p>

<p>And therefore I figured out that setting A's params can solve the problem. But I have no idea how to do that...</p>
