Refactor Bookmark fragment, fixes NPE
Bug: 2926451
This change refactors the BrowserBookmarkPage fragment for better
encapsulation, and updates the CombinedBookmarkHistoryView and
ShortcutActivity. ShortcutActivity now supports folder navigation
as well as toggling list or thumbnail view.
Change-Id: Ie8168467e793d60d75c15746f81318cfa7e9f003
diff --git a/res/layout/bookmarks_header.xml b/res/layout/bookmarks_header.xml
new file mode 100644
index 0000000..597e629
--- /dev/null
+++ b/res/layout/bookmarks_header.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="48dip"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/root_folder"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:text="@string/defaultBookmarksUpButton"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center_vertical"
+ android:visibility="gone"
+ android:paddingLeft="16dip"
+ android:drawableLeft="@drawable/ic_tab_bookmarks_selected"
+ android:drawablePadding="16dip" />
+
+ <com.android.browser.BreadCrumbView
+ android:id="@+id/crumbs"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:paddingLeft="16dip" />
+
+ <TextView
+ android:id="@+id/select_bookmark_view"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:text="@string/switch_to_thumbnails"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center_vertical" />
+
+</LinearLayout>