Skip to content

Commit 3f8d9c9

Browse files
asolovayAndroid (Google) Code Review
authored andcommitted
Merge "docs: Replaced deprecated fill_parent with match_parent." into klp-modular-docs
2 parents 6a5dd93 + e295205 commit 3f8d9c9

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

docs/html/guide/topics/ui/declaring-layout.jd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ to hold a {@link android.widget.TextView} and a {@link android.widget.Button}:</
8888
<pre>
8989
&lt;?xml version="1.0" encoding="utf-8"?>
9090
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
91-
android:layout_width="fill_parent"
92-
android:layout_height="fill_parent"
91+
android:layout_width="match_parent"
92+
android:layout_height="match_parent"
9393
android:orientation="vertical" >
9494
&lt;TextView android:id="@+id/text"
9595
android:layout_width="wrap_content"
@@ -215,14 +215,14 @@ set the width or height: </p>
215215
<ul>
216216
<li><var>wrap_content</var> tells your view to size itself to the dimensions
217217
required by its content</li>
218-
<li><var>fill_parent</var> (renamed <var>match_parent</var> in API Level 8)
218+
<li><var>match_parent</var> (named <var>fill_parent</var> before API Level 8)
219219
tells your view to become as big as its parent view group will allow.</li>
220220
</ul>
221221

222222
<p>In general, specifying a layout width and height using absolute units such as
223223
pixels is not recommended. Instead, using relative measurements such as
224224
density-independent pixel units (<var>dp</var>), <var>wrap_content</var>, or
225-
<var>fill_parent</var>, is a better approach, because it helps ensure that
225+
<var>match_parent</var>, is a better approach, because it helps ensure that
226226
your application will display properly across a variety of device screen sizes.
227227
The accepted measurement types are defined in the
228228
<a href="{@docRoot}guide/topics/resources/available-resources.html#dimension">

docs/html/guide/topics/ui/layout/grid.jd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ result, with cell borders displayed as dotted lines (added for visual effect). <
4141
<pre>
4242
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
4343
&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
44-
android:layout_width="fill_parent"
45-
android:layout_height="fill_parent"
44+
android:layout_width="match_parent"
45+
android:layout_height="match_parent"
4646
android:stretchColumns="1">
4747
&lt;TableRow>
4848
&lt;TextView
@@ -82,8 +82,8 @@ documentation for more details. </p>
8282
<pre>
8383
&lt;?xml version="1.0" encoding="utf-8"?>
8484
&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
85-
android:layout_width="fill_parent"
86-
android:layout_height="fill_parent"
85+
android:layout_width="match_parent"
86+
android:layout_height="match_parent"
8787
android:stretchColumns="1">
8888

8989
&lt;TableRow>

docs/html/guide/topics/ui/layout/gridview.jd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ into the project's
4343
<li>Open the <code>res/layout/main.xml</code> file and insert the following:
4444
<pre>
4545
&lt;?xml version="1.0" encoding="utf-8"?>
46-
&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
46+
&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
4747
android:id="@+id/gridview"
48-
android:layout_width="fill_parent"
49-
android:layout_height="fill_parent"
48+
android:layout_width="match_parent"
49+
android:layout_height="match_parent"
5050
android:columnWidth="90dp"
5151
android:numColumns="auto_fit"
5252
android:verticalSpacing="10dp"

docs/html/guide/topics/ui/layout/linear.jd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ share the rest equally.</p>
8282
<pre>
8383
&lt;?xml version="1.0" encoding="utf-8"?>
8484
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
85-
android:layout_width="fill_parent"
86-
android:layout_height="fill_parent"
85+
android:layout_width="match_parent"
86+
android:layout_height="match_parent"
8787
android:paddingLeft="16dp"
8888
android:paddingRight="16dp"
8989
android:orientation="vertical" >
9090
&lt;EditText
91-
android:layout_width="fill_parent"
91+
android:layout_width="match_parent"
9292
android:layout_height="wrap_content"
9393
android:hint="@string/to" />
9494
&lt;EditText
95-
android:layout_width="fill_parent"
95+
android:layout_width="match_parent"
9696
android:layout_height="wrap_content"
9797
android:hint="@string/subject" />
9898
&lt;EditText
99-
android:layout_width="fill_parent"
99+
android:layout_width="match_parent"
100100
android:layout_height="0dp"
101101
android:layout_weight="1"
102102
android:gravity="top"

docs/html/guide/topics/ui/layout/relative.jd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ view declared in the hierarchy. The example below demonstrates such a scenario.<
8282
<pre>
8383
&lt;?xml version="1.0" encoding="utf-8"?>
8484
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
85-
android:layout_width="fill_parent"
86-
android:layout_height="fill_parent"
85+
android:layout_width="match_parent"
86+
android:layout_height="match_parent"
8787
android:paddingLeft="16dp"
8888
android:paddingRight="16dp" >
8989
&lt;EditText
9090
android:id="@+id/name"
91-
android:layout_width="fill_parent"
91+
android:layout_width="match_parent"
9292
android:layout_height="wrap_content"
9393
android:hint="@string/reminder" />
9494
&lt;Spinner
@@ -114,4 +114,4 @@ view declared in the hierarchy. The example below demonstrates such a scenario.<
114114
</pre>
115115

116116
<p>For details about all the layout attributes available to each child view of a {@link
117-
android.widget.RelativeLayout}, see {@link android.widget.RelativeLayout.LayoutParams}.</p>
117+
android.widget.RelativeLayout}, see {@link android.widget.RelativeLayout.LayoutParams}.</p>

0 commit comments

Comments
 (0)