aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java21
-rw-r--r--java/src/com/android/inputmethod/latin/settings/Settings.java1
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsFragment.java1
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java8
4 files changed, 14 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 399e588ba..1631a200e 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1176,14 +1176,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onClick(final DialogInterface di, final int position) {
di.dismiss();
- ImportantNoticeUtils.updateLastImportantNoticeVersion(context);
- setNeutralSuggestionStrip();
+ if (position == DialogInterface.BUTTON_POSITIVE) {
+ ImportantNoticeUtils.updateLastImportantNoticeVersion(context);
+ setNeutralSuggestionStrip();
+ return;
+ }
+ if (position == DialogInterface.BUTTON_NEGATIVE) {
+ launchSettings();
+ return;
+ }
}
};
final AlertDialog.Builder builder =
new AlertDialog.Builder(context, AlertDialog.THEME_HOLO_DARK);
builder.setMessage(R.string.important_notice_contents)
- .setPositiveButton(android.R.string.ok, listener);
+ .setPositiveButton(android.R.string.ok, listener)
+ .setNegativeButton(R.string.go_to_settings, listener);
showOptionDialog(builder.create(), true /* cancelable */);
}
@@ -1614,13 +1622,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
launchSubActivity(SettingsActivity.class);
}
- public void launchKeyboardedDialogActivity(final Class<? extends Activity> activityClass) {
- // Put the text in the attached EditText into a safe, saved state before switching to a
- // new activity that will also use the soft keyboard.
- mInputLogic.commitTyped(mSettings.getCurrent(), LastComposedWord.NOT_A_SEPARATOR);
- launchSubActivity(activityClass);
- }
-
private void launchSubActivity(final Class<? extends Activity> activityClass) {
Intent intent = new Intent();
intent.setClass(LatinIME.this, activityClass);
diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java
index 45c5b733f..b51c765f0 100644
--- a/java/src/com/android/inputmethod/latin/settings/Settings.java
+++ b/java/src/com/android/inputmethod/latin/settings/Settings.java
@@ -66,6 +66,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
"pref_include_other_imes_in_language_switch_list";
public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20110916";
public static final String PREF_CUSTOM_INPUT_STYLES = "custom_input_styles";
+ // TODO: consolidate key preview dismiss delay with the key preview animation parameters.
public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY =
"pref_key_preview_popup_dismiss_delay";
public static final String PREF_BIGRAM_PREDICTIONS = "next_word_prediction";
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
index 67017a43b..bb5547fc9 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
@@ -169,6 +169,7 @@ public final class SettingsFragment extends InputMethodSettingsFragment
removePreference(Settings.PREF_VIBRATION_DURATION_SETTINGS, advancedSettings);
}
+ // TODO: consolidate key preview dismiss delay with the key preview animation parameters.
if (!Settings.readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) {
removePreference(Settings.PREF_POPUP_ON, generalSettings);
removePreference(Settings.PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY, advancedSettings);
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
index 7c11f5432..e77c55069 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
@@ -44,7 +44,6 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.android.inputmethod.compat.TextViewCompatUtils;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.PunctuationSuggestions;
import com.android.inputmethod.latin.R;
@@ -506,15 +505,10 @@ final class SuggestionStripLayoutHelper {
}
public void layoutImportantNotice(final View importantNoticeStrip, final int stripWidth) {
- final Resources res = importantNoticeStrip.getResources();
- final Drawable infoIcon = res.getDrawable(R.drawable.sym_keyboard_info_holo_dark);
- final Drawable moreIcon = res.getDrawable(R.drawable.sym_keyboard_more_holo_dark);
- final int width = stripWidth - infoIcon.getIntrinsicWidth() - moreIcon.getIntrinsicWidth();
final TextView titleView = (TextView)importantNoticeStrip.findViewById(
R.id.important_notice_title);
+ final int width = stripWidth - titleView.getPaddingLeft() - titleView.getPaddingRight();
titleView.setTextColor(mColorAutoCorrect);
- TextViewCompatUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(
- titleView, infoIcon, null, moreIcon, null);
final CharSequence importantNoticeTitle = titleView.getText();
titleView.setTextScaleX(1.0f); // Reset textScaleX.
final float titleScaleX = getTextScaleX(