diff options
author | 2013-03-19 16:49:19 +0900 | |
---|---|---|
committer | 2013-03-19 17:25:55 +0900 | |
commit | a462cd80ae9d07cea596c61c54d7b1b2ba6c6645 (patch) | |
tree | 4ae6b442805aa19100174495f3cd805b586f2d1d /java/src | |
parent | 8e005f2989de98cd284f1f5210f4c9d8d658e5e7 (diff) | |
download | latinime-a462cd80ae9d07cea596c61c54d7b1b2ba6c6645.tar.gz latinime-a462cd80ae9d07cea596c61c54d7b1b2ba6c6645.tar.xz latinime-a462cd80ae9d07cea596c61c54d7b1b2ba6c6645.zip |
Support feedback
Bug: 8143554
Change-Id: If0a6bafc94da040f97f27c6d046fb58bed9fd615
Diffstat (limited to 'java/src')
3 files changed, 51 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/FeedbackUtils.java b/java/src/com/android/inputmethod/latin/FeedbackUtils.java new file mode 100644 index 000000000..1e5260e34 --- /dev/null +++ b/java/src/com/android/inputmethod/latin/FeedbackUtils.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.latin; + +import android.content.Context; + +public class FeedbackUtils { + public static boolean isFeedbackFormSupported() { + return false; + } + + public static void showFeedbackForm(Context context) { + } +} diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 4cbfa8ea1..ce659bf45 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -77,6 +77,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY = "pref_suppress_language_switch_key"; + public static final String PREF_SEND_FEEDBACK = "send_feedback"; + private Resources mRes; private SharedPreferences mPrefs; private Locale mCurrentLocale; diff --git a/java/src/com/android/inputmethod/latin/SettingsFragment.java b/java/src/com/android/inputmethod/latin/SettingsFragment.java index fa17b4ffc..4fdd83911 100644 --- a/java/src/com/android/inputmethod/latin/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/SettingsFragment.java @@ -16,6 +16,7 @@ package com.android.inputmethod.latin; +import android.app.Activity; import android.app.backup.BackupManager; import android.content.Context; import android.content.Intent; @@ -26,6 +27,7 @@ import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.view.inputmethod.InputMethodSubtype; @@ -103,6 +105,25 @@ public final class SettingsFragment extends InputMethodSettingsFragment } } + final Preference feedbackSettings = findPreference(Settings.PREF_SEND_FEEDBACK); + if (feedbackSettings != null) { + if (FeedbackUtils.isFeedbackFormSupported()) { + feedbackSettings.setOnPreferenceClickListener(new OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference arg0) { + final Activity activity = getActivity(); + FeedbackUtils.showFeedbackForm(activity); + if (!activity.isFinishing()) { + activity.finish(); + } + return true; + } + }); + } else { + miscSettings.removePreference(feedbackSettings); + } + } + final boolean showVoiceKeyOption = res.getBoolean( R.bool.config_enable_show_voice_key_option); if (!showVoiceKeyOption) { |