Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16dd35bf authored by Ken Wakasa's avatar Ken Wakasa Committed by Android Git Automerger
Browse files

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

* commit '04f1e165':
  Initial implementation of Help & feedback
parents dca68b7a 04f1e165
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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>
+11 −8
Original line number Diff line number Diff line
@@ -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) {
+2 −2
Original line number Diff line number Diff line
@@ -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() {