diff options
author | 2014-02-17 11:28:48 +0900 | |
---|---|---|
committer | 2014-02-17 14:57:04 +0900 | |
commit | 28c02b400f9271b29e0fce20e7dae51d1d2b769f (patch) | |
tree | 391a014fc7618ca0a6b1ad41d86ac0386bb48113 /java/src | |
parent | 95d16561e0e6c38dbd99c893f09c5dbe9d4a465d (diff) | |
download | latinime-28c02b400f9271b29e0fce20e7dae51d1d2b769f.tar.gz latinime-28c02b400f9271b29e0fce20e7dae51d1d2b769f.tar.xz latinime-28c02b400f9271b29e0fce20e7dae51d1d2b769f.zip |
Add go to "Settings" button to important notice dialog
This CL also
- removes icons on important notice title.
- changes the "Personalized suggestions" summary text.
This change must be checked in together with Id115d89ba9.
Bug: 10587358
Change-Id: I52ff26fa8ae12445e9014ba08253f69e1be609f4
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 21 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | 8 |
2 files changed, 12 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index d1125afcc..d69fbb182 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 */); } @@ -1612,13 +1620,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/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( |