From 580e1d7ac0cb90a464a3b3aed88047f85a4ab41f Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 24 Aug 2011 17:35:42 +0900 Subject: [PATCH] Fix suggestions strip press state to align vertically This change also tweaks more_suggestions_hint drawables to eliminate unnecessarily padding at the bottom. Bug: 5204563 Change-Id: If5ec731c9a490da0116a020e8fd405c7d025d707 --- .../res/drawable-hdpi/more_suggestions_hint.png | Bin 249 -> 242 bytes .../res/drawable-mdpi/more_suggestions_hint.png | Bin 226 -> 222 bytes .../drawable-xhdpi/more_suggestions_hint.png | Bin 322 -> 310 bytes .../inputmethod/latin/CandidateView.java | 9 +++++---- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/res/drawable-hdpi/more_suggestions_hint.png b/java/res/drawable-hdpi/more_suggestions_hint.png index 4515f443455c9097a9506349e61758b92a209688..93604752b08d4a809d339281853053b3a8312263 100644 GIT binary patch delta 56 zcmey#_=$0XI2Sty8v_Fa$LU;)iHf$2^%LVu*yhI2S($8v_HwlNs+rCo0-9woQyLRc*GP=FTf)I)Q};DD(e6GedgW^pjE- SU;YPj89ZJ6T-G@yGywpO`xP7j diff --git a/java/res/drawable-mdpi/more_suggestions_hint.png b/java/res/drawable-mdpi/more_suggestions_hint.png index 6168de3534173f71e073f3f9b5719c2aa67f97df..7352810d3d5ca4cf4d5d6dc554930f09a8c1284e 100644 GIT binary patch delta 55 zcmaFFc#m;{I2RiS8v_HwsT#TG6BTV4vnR$U$tv&wMgIS1W_ZP>!!)B(Rtv~w@O1Ta JS?83{1OTi*4>AA% delta 59 zcmcb|_=s_WI2R8G8v_GF_H*0DiHf$2`4i)l6c@Ach%o~N8UFugW{~{s^)dAJntl-9 M)78&qol`;+0Qut);{X5v diff --git a/java/res/drawable-xhdpi/more_suggestions_hint.png b/java/res/drawable-xhdpi/more_suggestions_hint.png index f577a36171de336a0d2ff6acba52b3c67fa05529..35fb4208784d06d58faf92c52d9e3fd99ff897db 100644 GIT binary patch delta 56 zcmX@aw2f(kI2RWO8v_G_heN2&L`7T1!xQ6o%Dre}1PcBC&&=RhIPLb_ry}e?E`z75 KpUXO@geCyOn-J#! delta 68 zcmdnSbckt!IF}d)8v_G_O~~{!6BTV4&rgisspY0CyS3!Xr9f|YUD;*Rn1Is%|1&cv XCoX5^y|g_W$YtbP0l+XkK;5rq< diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index d46b4b5b5..5f20c70b4 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -413,8 +413,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo // TODO: This "more suggestions hint" should have nicely designed icon. word.setCompoundDrawablesWithIntrinsicBounds( null, null, null, mMoreCandidateHint); + // HACK: To align with other TextView that has no compound drawables. + word.setCompoundDrawablePadding(-mMoreCandidateHint.getIntrinsicHeight()); } else { - word.setCompoundDrawables(null, null, null, null); + word.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); } // Disable this candidate if the suggestion is null or empty. @@ -426,7 +428,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo word.setText(text); // TextView.setText() resets text scale x to 1.0. word.setTextScaleX(scaleX); stripView.addView(word); - setLayoutWeight(word, getCandidateWeight(index), mCandidateStripHeight); + setLayoutWeight(word, getCandidateWeight(index), MATCH_PARENT); if (DBG) { final CharSequence debugInfo = getDebugInfo(suggestions, pos); @@ -526,8 +528,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo mPreviewPopup = new PopupWindow(context); mPreviewText = (TextView) inflater.inflate(R.layout.candidate_preview, null); - mPreviewPopup.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, - ViewGroup.LayoutParams.WRAP_CONTENT); + mPreviewPopup.setWindowLayoutMode(WRAP_CONTENT, WRAP_CONTENT); mPreviewPopup.setContentView(mPreviewText); mPreviewPopup.setBackgroundDrawable(null);