From 40ac45ebdcd71940394dda00371d4847f7db0f26 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Wed, 1 Sep 2010 17:54:12 +0900 Subject: [PATCH] Get rid of arrows in candidate view bug: 2959293 Change-Id: Ia5dcb29397f608846f865fabb3c696866b3687aa --- .../ic_suggest_strip_scroll_left_arrow.png | Bin 619 -> 0 bytes .../ic_suggest_strip_scroll_right_arrow.png | Bin 619 -> 0 bytes .../keyboard_suggest_strip_divider.png | Bin 172 -> 0 bytes .../keyboard_suggest_strip_divider.png | Bin 166 -> 0 bytes .../ic_suggest_strip_scroll_left_arrow.png | Bin 445 -> 0 bytes .../ic_suggest_strip_scroll_right_arrow.png | Bin 440 -> 0 bytes java/res/layout/candidates.xml | 47 +--------- .../latin/CandidateViewContainer.java | 83 ------------------ .../android/inputmethod/latin/LatinIME.java | 6 +- 9 files changed, 5 insertions(+), 131 deletions(-) delete mode 100755 java/res/drawable-hdpi/ic_suggest_strip_scroll_left_arrow.png delete mode 100755 java/res/drawable-hdpi/ic_suggest_strip_scroll_right_arrow.png delete mode 100755 java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png delete mode 100644 java/res/drawable-land-mdpi/keyboard_suggest_strip_divider.png delete mode 100644 java/res/drawable-mdpi/ic_suggest_strip_scroll_left_arrow.png delete mode 100644 java/res/drawable-mdpi/ic_suggest_strip_scroll_right_arrow.png delete mode 100644 java/src/com/android/inputmethod/latin/CandidateViewContainer.java diff --git a/java/res/drawable-hdpi/ic_suggest_strip_scroll_left_arrow.png b/java/res/drawable-hdpi/ic_suggest_strip_scroll_left_arrow.png deleted file mode 100755 index e375f262f875012c5893a2e2e08fa6d5ab8c9a16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)-Eax-EMbt z0L1qo{s{3%AP^unn~mT*84ib=cTpmdIEUDa$z+Oz!{LcI{Fkq4vC<6U@wgWPcc}W* z<#G|X+fDG9!2bzAu2u!I6cCHWqPX!Mf?LcIi^U=fE8+@Z-aD?iphJXCrz1h2Y&M&T z&*vlPmT#id)w588%msu(Avdbs(d+f{0`_{niRd&$sh+i{8h|c)eXrGO`N3dNX}8-Z z8C#Ta% zj7HoN0|&FYMb!rmhvSv)aMseApJ;_b;T`L7 z49hNp!QjsyFyFLFNs>-x$0+}w%mEz00UW>q{{i?EU;y5403`qfvlajV002ovPDHLk FV1i%mBQ*d3 diff --git a/java/res/drawable-hdpi/ic_suggest_strip_scroll_right_arrow.png b/java/res/drawable-hdpi/ic_suggest_strip_scroll_right_arrow.png deleted file mode 100755 index d38ae7562d1c2ba5a9f7a61aad1079c71410a86d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)r5~hWXWWbvN;1}RH;-{TZ=4767zUGES*lXForD4 zPk`K&%Vov3U4)f02(x%RZUnB|m>U9;wGBX-&~GRdVyRS$dA;5&=7yzGsl7LVi&CJ_ zU*UGUSt5~O(P&gbHg~G3J{60_@Lol>f;fyUi^XDwW!L~J?im#dg|lA)R;v{=zZi3n z8R+x*jBFG|p)K6c=kq=5nUS|;KtUi{H3{>Y@c(EI8L&(yL-Wq%a(OzPP6N2@V<&)w zc@|uZXTq<^D#{`d2u!eut4^nLZ`F}^S!9No?IK}VL-D#;EG{7a_MOgFfUfICSnJ{U z`zdr}a0^Rry4~)4lg>tfSsdOP-jm!uK;ld8k>o7rrZ!!8-` z^E}v?0ea3H#m#A&HaO&wDT(i70T2KI5C8%A3&5uU0|4hj%<6-iXMg|z002ovPDHLk FV1le=5-R`z diff --git a/java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png b/java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png deleted file mode 100755 index 1a03c52e64df4681aacb8bf1c15cb741eaf0b568..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^Oh9bO0U{@7=E?#o$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1Gex5FlAr-fhcGUd*v_5|SjDP?CpFePbVNnA^ZxREu3D-iF zP`=d)lh_{lI%*tL_gKO!(PVMfCBvaeQZN6}7hSvCk_Q_&IUGc$urFj_;$fK5SXEbR SE_V%RGJ~h9pUXO@geCwk*Ei?@ diff --git a/java/res/drawable-land-mdpi/keyboard_suggest_strip_divider.png b/java/res/drawable-land-mdpi/keyboard_suggest_strip_divider.png deleted file mode 100644 index e54c5b099431be9853118c033e6fee440e44aa61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^OhBy00U{G$-VFv)k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XJUm?-Ln?0d^f~e|7_hKJfBb*`XD@STZt$Zdp^0}R7z7QC zJ33Z1S*_<)pAj9ID(Y6%nD%G&tkd;!!sj`ry)J!Ta$v{V2qqqeESB;(&)M-UKr&M1Kt@J}K}1A^fsv7sfti_^fuIY5gM$r#&fU+>&Mu&!puoV-&(FZg z$;t5d?_UO>q4>ifFfgzH}(jsKZuKqGXTTp0lFGSVrr&IlO_oOU84XD nqYGpiFj^vw8Zh_`00=Mu3SEkNqBo^b00000NkvXXu0mjfuG6_P diff --git a/java/res/drawable-mdpi/ic_suggest_strip_scroll_right_arrow.png b/java/res/drawable-mdpi/ic_suggest_strip_scroll_right_arrow.png deleted file mode 100644 index 639a28711cd019a6feeaf2f84b50381e5a834ae3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 440 zcmV;p0Z0CcP)To!~BSFK1Q36W9GXqT1)Jbap0yvJNF$}ZdIBscK*0?aB(P(I@szS5b1W^>{1UN4Q zpePD>o`+7S1HE1kBuN^(uDckGMzucyP9GT32FS7u{eB-II)N??!_e;n(lmwret)i& zN+pAk)@tN>F&qxxZURuW+wIPYAeyG3+wDTT-G+L-{$bnp8NyyW0Vax3co_(3wOX)V zuj4`hti%zhR;w#w?;r?*=;jPATR>M(OosTKB*}~CdC}b=o**pCW@1vmHk-}sWHO2K z&$HLO#kUHAkcr9h-+kZz{B4nb0EqW74oXp!)polbOsCW6<}Tyn - - - - - - - - - - - - - - + diff --git a/java/src/com/android/inputmethod/latin/CandidateViewContainer.java b/java/src/com/android/inputmethod/latin/CandidateViewContainer.java deleted file mode 100644 index e0cb8c3b0..000000000 --- a/java/src/com/android/inputmethod/latin/CandidateViewContainer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2008 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; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnTouchListener; -import android.widget.LinearLayout; - -public class CandidateViewContainer extends LinearLayout implements OnTouchListener { - - private View mButtonLeft; - private View mButtonRight; - private View mButtonLeftLayout; - private View mButtonRightLayout; - private CandidateView mCandidates; - - public CandidateViewContainer(Context screen, AttributeSet attrs) { - super(screen, attrs); - } - - public void initViews() { - if (mCandidates == null) { - mButtonLeftLayout = findViewById(R.id.candidate_left_parent); - mButtonLeft = findViewById(R.id.candidate_left); - if (mButtonLeft != null) { - mButtonLeft.setOnTouchListener(this); - } - mButtonRightLayout = findViewById(R.id.candidate_right_parent); - mButtonRight = findViewById(R.id.candidate_right); - if (mButtonRight != null) { - mButtonRight.setOnTouchListener(this); - } - mCandidates = (CandidateView) findViewById(R.id.candidates); - } - } - - @Override - public void requestLayout() { - if (mCandidates != null) { - int availableWidth = mCandidates.getWidth(); - int neededWidth = mCandidates.computeHorizontalScrollRange(); - int x = mCandidates.getScrollX(); - boolean leftVisible = x > 0; - boolean rightVisible = x + availableWidth < neededWidth; - if (mButtonLeftLayout != null) { - mButtonLeftLayout.setVisibility(leftVisible ? VISIBLE : GONE); - } - if (mButtonRightLayout != null) { - mButtonRightLayout.setVisibility(rightVisible ? VISIBLE : GONE); - } - } - super.requestLayout(); - } - - public boolean onTouch(View v, MotionEvent event) { - if (event.getAction() == MotionEvent.ACTION_DOWN) { - if (v == mButtonRight) { - mCandidates.scrollNext(); - } else if (v == mButtonLeft) { - mCandidates.scrollPrev(); - } - } - return false; - } - -} diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 74ed90ff6..0896f6c2c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -61,6 +61,7 @@ import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; +import android.widget.LinearLayout; import java.io.FileDescriptor; import java.io.IOException; @@ -153,7 +154,7 @@ public class LatinIME extends InputMethodService private static final int POS_METHOD = 1; //private LatinKeyboardView mInputView; - private CandidateViewContainer mCandidateViewContainer; + private LinearLayout mCandidateViewContainer; private CandidateView mCandidateView; private Suggest mSuggest; private CompletionInfo[] mCompletions; @@ -538,9 +539,8 @@ public class LatinIME extends InputMethodService @Override public View onCreateCandidatesView() { mKeyboardSwitcher.makeKeyboards(true); - mCandidateViewContainer = (CandidateViewContainer) getLayoutInflater().inflate( + mCandidateViewContainer = (LinearLayout) getLayoutInflater().inflate( R.layout.candidates, null); - mCandidateViewContainer.initViews(); mCandidateView = (CandidateView) mCandidateViewContainer.findViewById(R.id.candidates); mCandidateView.setService(this); setCandidatesViewShown(true);