am 04f1e165: am 83a96fe5: Initial implementation of Help & feedback

* commit '04f1e1652220fb89b8ae4fabe4fa7c4b90cb092c':
  Initial implementation of Help & feedback
main
Ken Wakasa 2014-08-08 04:40:32 +00:00 committed by Android Git Automerger
commit 16dd35bfb6
3 changed files with 16 additions and 12 deletions

View File

@ -159,8 +159,9 @@
<!-- Title for input language selection screen -->
<string name="language_selection_title">Input languages</string>
<!-- Title of a preference to send feedback. [CHAR LIMIT=30]-->
<string name="send_feedback">Send feedback</string>
<!-- Title for the 'Help & feedback' settings fragment which shows a help page and has a button
for submitting feedback. [CHAR LIMIT=35] -->
<string name="help_and_feedback">Help &amp; feedback</string>
<!-- Preference for input language selection -->
<string name="select_language">Input languages</string>

View File

@ -29,9 +29,12 @@ import com.android.inputmethod.latin.utils.FeedbackUtils;
import com.android.inputmethodcommon.InputMethodSettingsFragment;
public final class SettingsFragment extends InputMethodSettingsFragment {
private static final int NO_MENU_GROUP = Menu.NONE; // We don't care about menu grouping.
private static final int MENU_FEEDBACK = Menu.FIRST; // The first menu item id and order.
private static final int MENU_ABOUT = Menu.FIRST + 1; // The second menu item id and order.
// We don't care about menu grouping.
private static final int NO_MENU_GROUP = Menu.NONE;
// The first menu item id and order.
private static final int MENU_HELP_AND_FEEDBACK = Menu.FIRST;
// The second menu item id and order.
private static final int MENU_ABOUT = Menu.FIRST + 1;
@Override
public void onCreate(final Bundle icicle) {
@ -53,9 +56,9 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
if (FeedbackUtils.isFeedbackFormSupported()) {
menu.add(NO_MENU_GROUP, MENU_FEEDBACK /* itemId */, MENU_FEEDBACK /* order */,
R.string.send_feedback);
if (FeedbackUtils.isHelpAndFeedbackFormSupported()) {
menu.add(NO_MENU_GROUP, MENU_HELP_AND_FEEDBACK /* itemId */,
MENU_HELP_AND_FEEDBACK /* order */, R.string.help_and_feedback);
}
final int aboutResId = FeedbackUtils.getAboutKeyboardTitleResId();
if (aboutResId != 0) {
@ -66,8 +69,8 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
final int itemId = item.getItemId();
if (itemId == MENU_FEEDBACK) {
FeedbackUtils.showFeedbackForm(getActivity());
if (itemId == MENU_HELP_AND_FEEDBACK) {
FeedbackUtils.showHelpAndFeedbackForm(getActivity());
return true;
}
if (itemId == MENU_ABOUT) {

View File

@ -20,11 +20,11 @@ import android.content.Context;
import android.content.Intent;
public class FeedbackUtils {
public static boolean isFeedbackFormSupported() {
public static boolean isHelpAndFeedbackFormSupported() {
return false;
}
public static void showFeedbackForm(Context context) {
public static void showHelpAndFeedbackForm(Context context) {
}
public static int getAboutKeyboardTitleResId() {