Initial implementation of Help & feedback
bug: 16717930 Change-Id: Iddc8e831c3f01ec7eb02ed1bc5d5e103d497e177main
parent
db776143d9
commit
83a96fe5c7
|
@ -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 & 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>
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue