Beginning work on adding bookmarks with folders.

Bug: 2953515

Provides the basic functionality for the AddBookmark page, allowing
the user to save the bookmark in a folder of his/her choosing.

Change-Id: I170599b723069aaee661dae3fc1a0fb915793906
diff --git a/res/layout/browser_add_bookmark.xml b/res/layout/browser_add_bookmark.xml
index f15caf2..e22e820 100644
--- a/res/layout/browser_add_bookmark.xml
+++ b/res/layout/browser_add_bookmark.xml
@@ -29,11 +29,10 @@
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"/>
 
-    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    <RelativeLayout android:id="@+id/default_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1"
-        android:orientation="vertical"
         android:paddingTop="5dip"
         android:paddingBottom="13dip"
         android:paddingLeft="20dip"
@@ -43,6 +42,10 @@
             android:id="@+id/titleText"
             android:layout_height="wrap_content"
             android:layout_width="wrap_content"
+            android:layout_alignParentTop="true"
+            android:layout_marginRight="50dip"
+            android:layout_marginBottom="40dip"
+            android:layout_marginTop="40dip"
             android:text="@string/name"
             android:gravity="left"
             android:textAppearance="?android:attr/textAppearanceMedium" />
@@ -52,8 +55,11 @@
             android:layout_height="wrap_content"
             android:layout_width="250dip"
             android:gravity="fill_horizontal"
+            android:layout_alignBaseline="@+id/titleText"
+            android:layout_toRightOf="@+id/titleText"
             android:inputType="textCapSentences"
             android:selectAllOnFocus="true"
+            android:ellipsize="end"
             android:textAppearance="?android:attr/textAppearanceMedium" />
                 
 
@@ -64,6 +70,10 @@
             android:layout_width="wrap_content"
             android:text="@string/location"
             android:gravity="left"
+            android:layout_below="@+id/titleText"
+            android:layout_alignLeft="@+id/titleText"
+            android:layout_marginBottom="40dip"
+            android:layout_marginRight="20dip"
             android:textAppearance="?android:attr/textAppearanceMedium" />
                 
         <EditText
@@ -71,12 +81,73 @@
             android:layout_height="wrap_content"
             android:layout_width="250dip"
             android:hint="@string/http"
+            android:layout_alignBaseline="@+id/addressText"
+            android:layout_alignLeft="@+id/title"
             android:gravity="fill_horizontal"
             android:inputType="textUri"
             android:selectAllOnFocus="true"
+            android:ellipsize="end"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <TextView
+            android:id="@+id/add_to"
+            android:layout_height="wrap_content"
+            android:layout_width="wrap_content"
+            android:text="@string/containing_folder"
+            android:layout_below="@+id/addressText"
+            android:layout_alignLeft="@+id/titleText"
+            android:layout_marginRight="20dip"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <TextView
+            android:id="@+id/folder"
+            android:layout_height="wrap_content"
+            android:layout_width="250dip"
+            android:layout_alignLeft="@+id/title"
+            android:layout_alignBaseline="@+id/add_to"
+            android:singleLine="true"
+            android:ellipsize="start"
+            android:text="@string/bookmarks"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    </RelativeLayout>
+
+    <LinearLayout android:id="@+id/folder_selector"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:visibility="gone"
+        >
+
+        <TextView
+            android:id="@+id/path"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:ellipsize="start"
+            android:text="@string/bookmarks"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <ListView
+            android:id="@+id/list"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            />
+        <EditText
+            android:id="@+id/folder_namer"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone"
+            />
+        <Button
+            android:id="@+id/add_new_folder"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:text="@string/add_new_folder"
             android:textAppearance="?android:attr/textAppearanceMedium" />
     </LinearLayout>
-        
+
     <LinearLayout 
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -102,4 +173,3 @@
     </LinearLayout>
 
 </LinearLayout>
-
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cbd9bbc..3ceec67 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -122,14 +122,22 @@
     <!-- Button label to cancel saving a bookmark. -->
     <string name="do_not_save">Cancel</string>
     <!-- Field label in Bookmark dialog box: refers to URL of the page to bookmark -->
-    <string name="location">Location</string>
+    <string name="location">Address</string>
+    <!-- Field label in Bookmark dialog box: refers to the folder in which to save the bookmark -->
+    <string name="containing_folder">Add to</string>
+    <!-- Button text for a button that allows the user to add a new folder.  Also used as the title of the add bookmarks dialog on the page
+         that allows choosing the folder to place it in. -->
+    <string name="add_new_folder">Add new folder</string>
+    <!-- Default name for a new folder -->
+    <string name="new_folder">New folder</string>
     <!-- Field label in Bookmark dialog box: title that the user wishes to use for the bookmark -->
-    <string name="name">Name</string>
+    <string name="name">label</string>
     <!-- Initial value in Location field in Bookmark dialog box -->
     <string name="http">http://</string>
-    <!-- Menu item that opens a dialog to save a bookmark for the current page, also displayed as
-            the title of the dialog used for adding a bookmark -->
-    <string name="save_to_bookmarks">Bookmark this page</string>
+    <!-- Menu item that opens a dialog to save a bookmark for the current page -->
+    <string name="save_to_bookmarks">Add to Bookmarks</string>
+    <!-- Title of the dialog to bookmark a page -->
+    <string name="bookmark_this_page">Bookmark this page</string>
     <!-- Menu item on the bookmarks page, to edit an existing bookmark -->
     <string name="edit_bookmark">Edit bookmark</string>
     <!-- Context menu item to create a shortcut to the bookmark on the desktop -->