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

* commit '16dd35bfb60494000f899b1fa334a2c98af79857':
  Initial implementation of Help & feedback
This commit is contained in:
Ken Wakasa 2014-08-08 04:49:54 +00:00 committed by Android Git Automerger
commit 8b5daefa5e
3 changed files with 16 additions and 12 deletions

View file

@ -159,8 +159,9 @@
<!-- Title for input language selection screen --> <!-- Title for input language selection screen -->
<string name="language_selection_title">Input languages</string> <string name="language_selection_title">Input languages</string>
<!-- Title of a preference to send feedback. [CHAR LIMIT=30]--> <!-- Title for the 'Help & feedback' settings fragment which shows a help page and has a button
<string name="send_feedback">Send feedback</string> for submitting feedback. [CHAR LIMIT=35] -->
<string name="help_and_feedback">Help &amp; feedback</string>
<!-- Preference for input language selection --> <!-- Preference for input language selection -->
<string name="select_language">Input languages</string> <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; import com.android.inputmethodcommon.InputMethodSettingsFragment;
public final class SettingsFragment extends InputMethodSettingsFragment { public final class SettingsFragment extends InputMethodSettingsFragment {
private static final int NO_MENU_GROUP = Menu.NONE; // We don't care about menu grouping. // 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 NO_MENU_GROUP = Menu.NONE;
private static final int MENU_ABOUT = Menu.FIRST + 1; // The second menu item id and order. // 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 @Override
public void onCreate(final Bundle icicle) { public void onCreate(final Bundle icicle) {
@ -53,9 +56,9 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override @Override
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
if (FeedbackUtils.isFeedbackFormSupported()) { if (FeedbackUtils.isHelpAndFeedbackFormSupported()) {
menu.add(NO_MENU_GROUP, MENU_FEEDBACK /* itemId */, MENU_FEEDBACK /* order */, menu.add(NO_MENU_GROUP, MENU_HELP_AND_FEEDBACK /* itemId */,
R.string.send_feedback); MENU_HELP_AND_FEEDBACK /* order */, R.string.help_and_feedback);
} }
final int aboutResId = FeedbackUtils.getAboutKeyboardTitleResId(); final int aboutResId = FeedbackUtils.getAboutKeyboardTitleResId();
if (aboutResId != 0) { if (aboutResId != 0) {
@ -66,8 +69,8 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override @Override
public boolean onOptionsItemSelected(final MenuItem item) { public boolean onOptionsItemSelected(final MenuItem item) {
final int itemId = item.getItemId(); final int itemId = item.getItemId();
if (itemId == MENU_FEEDBACK) { if (itemId == MENU_HELP_AND_FEEDBACK) {
FeedbackUtils.showFeedbackForm(getActivity()); FeedbackUtils.showHelpAndFeedbackForm(getActivity());
return true; return true;
} }
if (itemId == MENU_ABOUT) { if (itemId == MENU_ABOUT) {

View file

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