Loading docs/html/training/improving-layouts/reusing-layouts.jd +21 −21 Original line number Diff line number Diff line Loading @@ -56,14 +56,14 @@ included in each activity (<code>titlebar.xml</code>):</p> <pre> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=”match_parent” android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/titlebar_bg"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gafricalogo" /> </FrameLayout> android:src="@drawable/gafricalogo" /> </FrameLayout> </pre> <p>The root {@link android.view.View} should be exactly how you'd like it to appear in each Loading @@ -81,17 +81,17 @@ G-Kenya codelab that includes the title bar from above:</p> <pre> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/app_bg" android:gravity="center_horizontal"> android:gravity="center_horizontal"> <strong><include layout="@layout/titlebar"/></strong> <strong><include layout="@layout/titlebar"/></strong> <TextView android:layout_width=”match_parent” <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hello" android:padding="10dp" /> android:padding="10dp" /> ... Loading @@ -103,10 +103,10 @@ included layout's root view by specifying them in the {@code <include/>} t example:</p> <pre> <include android:id=”@+id/news_title” android:layout_width=”match_parent” android:layout_height=”match_parent” layout=”@layout/title”/> <include android:id="@+id/news_title" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/title"/> </pre> <p>However, if you want to override layout attributes using Loading @@ -130,17 +130,17 @@ serves no real purpose other than to slow down your UI performance.</p> {@code <merge>} element as the root view for the re-usable layout. For example:</p> <pre> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/add"/> android:text="@string/add"/> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/delete"/> android:text="@string/delete"/> </merge> </pre> Loading Loading
docs/html/training/improving-layouts/reusing-layouts.jd +21 −21 Original line number Diff line number Diff line Loading @@ -56,14 +56,14 @@ included in each activity (<code>titlebar.xml</code>):</p> <pre> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=”match_parent” android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/titlebar_bg"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gafricalogo" /> </FrameLayout> android:src="@drawable/gafricalogo" /> </FrameLayout> </pre> <p>The root {@link android.view.View} should be exactly how you'd like it to appear in each Loading @@ -81,17 +81,17 @@ G-Kenya codelab that includes the title bar from above:</p> <pre> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/app_bg" android:gravity="center_horizontal"> android:gravity="center_horizontal"> <strong><include layout="@layout/titlebar"/></strong> <strong><include layout="@layout/titlebar"/></strong> <TextView android:layout_width=”match_parent” <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hello" android:padding="10dp" /> android:padding="10dp" /> ... Loading @@ -103,10 +103,10 @@ included layout's root view by specifying them in the {@code <include/>} t example:</p> <pre> <include android:id=”@+id/news_title” android:layout_width=”match_parent” android:layout_height=”match_parent” layout=”@layout/title”/> <include android:id="@+id/news_title" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/title"/> </pre> <p>However, if you want to override layout attributes using Loading @@ -130,17 +130,17 @@ serves no real purpose other than to slow down your UI performance.</p> {@code <merge>} element as the root view for the re-usable layout. For example:</p> <pre> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/add"/> android:text="@string/add"/> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/delete"/> android:text="@string/delete"/> </merge> </pre> Loading