diff options
author | Leon Scroggins <scroggo@google.com> | 2011-01-11 19:08:03 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2011-01-11 19:10:40 -0500 |
commit | 0e3a7b8dd64b064871a40e65a5c59f969759b320 (patch) | |
tree | 75a9b109a1e724e0990e80c92e63e748b2eb3a09 /src/com/android/browser/AddBookmarkPage.java | |
parent | 1605bef4e1f99805a801308f97ade622b907dc7a (diff) | |
download | packages_apps_Browser-0e3a7b8dd64b064871a40e65a5c59f969759b320.zip packages_apps_Browser-0e3a7b8dd64b064871a40e65a5c59f969759b320.tar.gz packages_apps_Browser-0e3a7b8dd64b064871a40e65a5c59f969759b320.tar.bz2 |
Close button on folder namer, with single line look.
Bug:2953515
Change-Id: Ic079383f5bab45c0aa8f9a704b5f64f8fe7fa79d
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
-rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 9d8c73c..5e389ea 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -98,6 +98,7 @@ public class AddBookmarkPage extends Activity private View mDefaultView; private View mFolderSelector; private EditText mFolderNamer; + private View mFolderCancel; private boolean mIsFolderNamerShowing; private View mFolderNamerHolder; private View mAddNewFolder; @@ -243,6 +244,8 @@ public class AddBookmarkPage extends Activity } else { finish(); } + } else if (v == mFolderCancel) { + completeOrCancelFolderNaming(true); } else if (v == mAddNewFolder) { setShowFolderNamer(true); mFolderNamer.setText(R.string.new_folder); @@ -286,6 +289,11 @@ public class AddBookmarkPage extends Activity public void onNothingSelected(AdapterView<?> parent) { } + /** + * Finish naming a folder, and close the IME + * @param cancel If true, the new folder is not created. If false, the new + * folder is created and the user is taken inside it. + */ private void completeOrCancelFolderNaming(boolean cancel) { if (!cancel && !TextUtils.isEmpty(mFolderNamer.getText())) { String name = mFolderNamer.getText().toString(); @@ -588,6 +596,8 @@ public class AddBookmarkPage extends Activity mFolderNamerHolder = getLayoutInflater().inflate(R.layout.new_folder_layout, null); mFolderNamer = (EditText) mFolderNamerHolder.findViewById(R.id.folder_namer); mFolderNamer.setOnEditorActionListener(this); + mFolderCancel = mFolderNamerHolder.findViewById(R.id.close); + mFolderCancel.setOnClickListener(this); mAddNewFolder = findViewById(R.id.add_new_folder); mAddNewFolder.setOnClickListener(this); |