From 6b5a4d63658a7b06a8234daf2103c07a229a72b0 Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Thu, 19 Nov 2015 15:35:56 -0800 Subject: [PATCH] docs: Quick formatting fixes Doc used curly quotes in some code snippets; replaced with straight quotes. Also removed trailing spaces and made a couple of other formatting fixes. I'll build the docs then go ahead and submit them. (See first comment for doc stage location.) bug: 25461271 Change-Id: I6a8df8d77ccbe1f17c3fe82e23d8c6623e6e0507 --- .../improving-layouts/reusing-layouts.jd | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/html/training/improving-layouts/reusing-layouts.jd b/docs/html/training/improving-layouts/reusing-layouts.jd index 87431d3a59c39..8c63afb65e3cc 100644 --- a/docs/html/training/improving-layouts/reusing-layouts.jd +++ b/docs/html/training/improving-layouts/reusing-layouts.jd @@ -43,7 +43,7 @@ to embed another layout inside the current layout.

Reusing layouts is particularly powerful as it allows you create reusable complex layouts. For example, a yes/no button panel, or custom progress bar with description text. It also means that any elements of your application that are common across multiple layouts can be -extracted, managed separately, then included in each layout. So while +extracted, managed separately, then included in each layout. So while you can create individual UI components by writing a custom {@link android.view.View}, you can do it even more easily by re-using a layout file.

@@ -56,14 +56,14 @@ included in each activity (titlebar.xml):

 <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:layout_height="wrap_content"
+               android:src="@drawable/gafricalogo" />
+</FrameLayout>
 

The root {@link android.view.View} should be exactly how you'd like it to appear in each @@ -80,18 +80,18 @@ G-Kenya codelab that includes the title bar from above:

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" 
-    android:layout_width=”match_parent”
-    android:layout_height=”match_parent”
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
     android:background="@color/app_bg"
-    android:gravity="center_horizontal">
+    android:gravity="center_horizontal">
 
-    <include layout="@layout/titlebar"/>
+    <include layout="@layout/titlebar"/>
 
-    <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" />
 
     ...
 
@@ -103,10 +103,10 @@ included layout's root view by specifying them in the {@code <include/>} t
 example:

-<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"/>
 

However, if you want to override layout attributes using @@ -130,17 +130,17 @@ serves no real purpose other than to slow down your UI performance.

{@code <merge>} element as the root view for the re-usable layout. For example:

-<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_width="fill_parent"
         android:layout_height="wrap_content"
-        android:text="@string/add"/>
+        android:text="@string/add"/>
 
     <Button
-        android:layout_width="fill_parent" 
+        android:layout_width="fill_parent"
         android:layout_height="wrap_content"
-        android:text="@string/delete"/>
+        android:text="@string/delete"/>
 
 </merge>