diff options
author | Leon Scroggins <scroggo@google.com> | 2010-12-17 15:25:33 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-12-17 15:25:33 -0500 |
commit | 905250c0e82e89a08b9e4670f1e3a806cb4d2fb8 (patch) | |
tree | 79c703c01bd29dc6d682028803c9a275161e2f01 /src/com/android/browser/AddBookmarkPage.java | |
parent | e6e1c9169b485a8e06b0114d7ced7198f9a60a51 (diff) | |
download | packages_apps_Browser-905250c0e82e89a08b9e4670f1e3a806cb4d2fb8.zip packages_apps_Browser-905250c0e82e89a08b9e4670f1e3a806cb4d2fb8.tar.gz packages_apps_Browser-905250c0e82e89a08b9e4670f1e3a806cb4d2fb8.tar.bz2 |
Improvements to add bookmark dialog.
Bug:2953515
Use the folder icon for folders.
Center the header views in the choose folder view.
Change-Id: Ia19d81131a177aa3fce02645c411011e40e21bc4
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
-rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index e03c0f6..f5b677a 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -110,6 +110,8 @@ public class AddBookmarkPage extends Activity private CustomListView mListView; private boolean mSaveToHomeScreen; private long mRootFolder; + private TextView mTopLevelLabel; + private Drawable mHeaderIcon; private static class Folder { String Name; @@ -157,6 +159,16 @@ public class AddBookmarkPage extends Activity if (mIsFolderNamerShowing) { completeOrCancelFolderNaming(true); } + setShowBookmarkIcon(level == 1); + } + + /** + * Show or hide the icon for bookmarks next to "Bookmarks" in the crumb view. + * @param show True if the icon should visible, false otherwise. + */ + private void setShowBookmarkIcon(boolean show) { + Drawable drawable = show ? mHeaderIcon: null; + mTopLevelLabel.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); } @Override @@ -579,7 +591,10 @@ public class AddBookmarkPage extends Activity mCrumbs.setUseBackButton(true); mCrumbs.setController(this); String name = getString(R.string.bookmarks); - mCrumbs.pushView(name, false, new Folder(name, mRootFolder)); + mTopLevelLabel = (TextView) mCrumbs.pushView(name, false, new Folder(name, mRootFolder)); + // To better match the other folders. + mTopLevelLabel.setCompoundDrawablePadding(6); + mHeaderIcon = getResources().getDrawable(R.drawable.ic_folder_bookmark_widget_holo_dark); mCrumbHolder = findViewById(R.id.crumb_holder); mCrumbs.setMaxVisible(MAX_CRUMBS_SHOWN); @@ -594,6 +609,8 @@ public class AddBookmarkPage extends Activity if (mCurrentFolder != mRootFolder) { // Find all the folders manager.initLoader(LOADER_ID_ALL_FOLDERS, null, this); + } else { + setShowBookmarkIcon(true); } // Find the contents of the current folder manager.initLoader(LOADER_ID_FOLDER_CONTENTS, null, this); |