am a462cd80: Support feedback

* commit 'a462cd80ae9d07cea596c61c54d7b1b2ba6c6645':
  Support feedback
main
Satoshi Kataoka 2013-03-19 01:30:29 -07:00 committed by Android Git Automerger
commit c1125b6dd1
5 changed files with 56 additions and 0 deletions

View File

@ -308,6 +308,8 @@
- operation[CHAR LIMIT=100] --> - operation[CHAR LIMIT=100] -->
<!-- TODO: remove translatable=false attribute once text is stable --> <!-- TODO: remove translatable=false attribute once text is stable -->
<string name="research_feedback_demonstration_instructions" translatable="false">Please demonstrate the issue you are writing about.\n\nWhen finished, select the \"Bug?\" button again."</string> <string name="research_feedback_demonstration_instructions" translatable="false">Please demonstrate the issue you are writing about.\n\nWhen finished, select the \"Bug?\" button again."</string>
<!-- Title of a preference to send feedback. [CHAR LIMIT=30]-->
<string name="send_feedback">Send feedback</string>
<!-- Temporary notification of recording failure [CHAR LIMIT=100] --> <!-- Temporary notification of recording failure [CHAR LIMIT=100] -->
<!-- TODO: remove translatable=false attribute once text is stable --> <!-- TODO: remove translatable=false attribute once text is stable -->
<string name="research_feedback_recording_failure" translatable="false">Recording cancelled due to timeout</string> <string name="research_feedback_recording_failure" translatable="false">Recording cancelled due to timeout</string>

View File

@ -176,6 +176,9 @@
android:key="pref_show_setup_wizard_icon" android:key="pref_show_setup_wizard_icon"
android:title="@string/show_setup_wizard_icon" /> android:title="@string/show_setup_wizard_icon" />
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen
android:key="send_feedback"
android:title="@string/send_feedback" />
<PreferenceScreen <PreferenceScreen
android:key="debug_settings" android:key="debug_settings"
android:title="Debug settings" android:title="Debug settings"

View File

@ -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) {
}
}

View File

@ -77,6 +77,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY = private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY =
"pref_suppress_language_switch_key"; "pref_suppress_language_switch_key";
public static final String PREF_SEND_FEEDBACK = "send_feedback";
private Resources mRes; private Resources mRes;
private SharedPreferences mPrefs; private SharedPreferences mPrefs;
private Locale mCurrentLocale; private Locale mCurrentLocale;

View File

@ -16,6 +16,7 @@
package com.android.inputmethod.latin; package com.android.inputmethod.latin;
import android.app.Activity;
import android.app.backup.BackupManager; import android.app.backup.BackupManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -26,6 +27,7 @@ import android.os.Bundle;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceGroup; import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
import android.view.inputmethod.InputMethodSubtype; 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( final boolean showVoiceKeyOption = res.getBoolean(
R.bool.config_enable_show_voice_key_option); R.bool.config_enable_show_voice_key_option);
if (!showVoiceKeyOption) { if (!showVoiceKeyOption) {