diff --git a/res/layout/account_settings_edit_quick_responses_fragment.xml b/res/layout/account_settings_edit_quick_responses_fragment.xml
index 63dd146c1..66d8d2f98 100644
--- a/res/layout/account_settings_edit_quick_responses_fragment.xml
+++ b/res/layout/account_settings_edit_quick_responses_fragment.xml
@@ -18,9 +18,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:paddingTop="@dimen/settings_fragment_padding_top"
- android:paddingLeft="@dimen/settings_fragment_padding_left"
- android:paddingRight="@dimen/settings_fragment_padding_right"
>
@@ -41,10 +38,4 @@
android:visibility="gone"
android:text="@string/quick_responses_empty_view"
/>
-
\ No newline at end of file
diff --git a/res/layout/quick_response_item.xml b/res/layout/quick_response_item.xml
index 741e634b9..4134760e1 100644
--- a/res/layout/quick_response_item.xml
+++ b/res/layout/quick_response_item.xml
@@ -28,7 +28,6 @@
android:id="@+id/quick_response_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_centerVertical="true"
style="@style/accountSetupInfoText"
android:ellipsize="end"
android:focusable="false"
diff --git a/res/menu/quick_response_prefs_fragment_menu.xml b/res/menu/quick_response_prefs_fragment_menu.xml
new file mode 100644
index 000000000..8da9281c4
--- /dev/null
+++ b/res/menu/quick_response_prefs_fragment_menu.xml
@@ -0,0 +1,31 @@
+
+
+
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1f26c44d4..9bc440f88 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -65,7 +65,7 @@
Star
Done
-
+
Create new
Delete
diff --git a/src/com/android/email/activity/setup/AccountSettingsEditQuickResponsesFragment.java b/src/com/android/email/activity/setup/AccountSettingsEditQuickResponsesFragment.java
index d377b668e..4b64df3e6 100644
--- a/src/com/android/email/activity/setup/AccountSettingsEditQuickResponsesFragment.java
+++ b/src/com/android/email/activity/setup/AccountSettingsEditQuickResponsesFragment.java
@@ -22,31 +22,25 @@ import com.android.email2.ui.MailActivityEmail;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.EmailContent;
import com.android.emailcommon.provider.Account;
-import com.android.emailcommon.provider.QuickResponse;
-import com.android.emailcommon.utility.EmailAsyncTask;
import com.android.mail.utils.LogUtils;
import android.app.Activity;
import android.app.Fragment;
-import android.app.FragmentManager;
import android.app.LoaderManager;
import android.content.ContentUris;
-import android.content.Context;
import android.content.CursorLoader;
import android.content.Loader;
-import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ArrayAdapter;
-import android.widget.ImageView;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
@@ -126,6 +120,8 @@ public class AccountSettingsEditQuickResponsesFragment extends Fragment {
Bundle args = getArguments();
mAccount = args.getParcelable("account");
+
+ setHasOptionsMenu(true);
}
@Override
@@ -155,16 +151,23 @@ public class AccountSettingsEditQuickResponsesFragment extends Fragment {
.show(getFragmentManager(), null);
}
});
- final View createNewView =
- UiUtilities.getView((ViewGroup) listView.getParent(), R.id.create_new);
- createNewView.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- final Uri baseUri = Uri.parse(EmailContent.CONTENT_URI + "/quickresponse");
- EditQuickResponseDialog.newInstance(null, baseUri, mAccount.getId(), true)
- .show(getFragmentManager(), null);
- }
- });
return view;
}
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ menu.clear();
+ inflater.inflate(R.menu.quick_response_prefs_fragment_menu, menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.create_new) {
+ final Uri baseUri = Uri.parse(EmailContent.CONTENT_URI + "/quickresponse");
+ EditQuickResponseDialog.newInstance(null, baseUri, mAccount.getId(), true)
+ .show(getFragmentManager(), null);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
}