From 75c23ced94979a6b3f7c59e95dd46385e9702e2d Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Mon, 20 Sep 2010 18:10:54 +0900 Subject: [PATCH] Add lightweight visual indication for numbers. This change adds lightweight visual hints of alternate numeric characters on the top row - e.g. having a light gray '1' on the upper right corner of letter 'q' Note that MDPI resources are tentative (the same as HDPI for now, until we get fixed MDPI visual assets). bug: 3004632 Change-Id: I7a25cf90b702433a844c88f5c47bf914706af9bc --- java/res/drawable-hdpi/keyboard_hint_0.9.png | Bin 0 -> 379 bytes java/res/drawable-hdpi/keyboard_hint_1.9.png | Bin 0 -> 301 bytes java/res/drawable-hdpi/keyboard_hint_2.9.png | Bin 0 -> 404 bytes java/res/drawable-hdpi/keyboard_hint_3.9.png | Bin 0 -> 413 bytes java/res/drawable-hdpi/keyboard_hint_4.9.png | Bin 0 -> 341 bytes java/res/drawable-hdpi/keyboard_hint_5.9.png | Bin 0 -> 388 bytes java/res/drawable-hdpi/keyboard_hint_6.9.png | Bin 0 -> 413 bytes java/res/drawable-hdpi/keyboard_hint_7.9.png | Bin 0 -> 367 bytes java/res/drawable-hdpi/keyboard_hint_8.9.png | Bin 0 -> 417 bytes java/res/drawable-hdpi/keyboard_hint_9.9.png | Bin 0 -> 417 bytes java/res/drawable-mdpi/keyboard_hint_0.9.png | Bin 0 -> 379 bytes java/res/drawable-mdpi/keyboard_hint_1.9.png | Bin 0 -> 301 bytes java/res/drawable-mdpi/keyboard_hint_2.9.png | Bin 0 -> 404 bytes java/res/drawable-mdpi/keyboard_hint_3.9.png | Bin 0 -> 413 bytes java/res/drawable-mdpi/keyboard_hint_4.9.png | Bin 0 -> 341 bytes java/res/drawable-mdpi/keyboard_hint_5.9.png | Bin 0 -> 388 bytes java/res/drawable-mdpi/keyboard_hint_6.9.png | Bin 0 -> 413 bytes java/res/drawable-mdpi/keyboard_hint_7.9.png | Bin 0 -> 367 bytes java/res/drawable-mdpi/keyboard_hint_8.9.png | Bin 0 -> 417 bytes java/res/drawable-mdpi/keyboard_hint_9.9.png | Bin 0 -> 417 bytes .../inputmethod/latin/LatinKeyboard.java | 44 ++++++++++++ .../latin/LatinKeyboardBaseView.java | 63 ++++++++++++++---- .../inputmethod/latin/LatinKeyboardView.java | 3 +- 23 files changed, 97 insertions(+), 13 deletions(-) create mode 100644 java/res/drawable-hdpi/keyboard_hint_0.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_1.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_2.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_3.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_4.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_5.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_6.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_7.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_8.9.png create mode 100644 java/res/drawable-hdpi/keyboard_hint_9.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_0.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_1.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_2.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_3.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_4.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_5.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_6.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_7.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_8.9.png create mode 100644 java/res/drawable-mdpi/keyboard_hint_9.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_0.9.png b/java/res/drawable-hdpi/keyboard_hint_0.9.png new file mode 100644 index 0000000000000000000000000000000000000000..271264e92c36f17b72b7ee910cee45c351fc0bf4 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42-g#E{-7;x8B^|%hzNeaNy%Lg9kSP-NN1D8^a5}yp*YB zjdyl;3v;{s>gpWN!$%T0+y8s(sm}7KFZ#>D_+BNcXI)6e`~CLsyyv=~d#Dv|vE=i; zsr@?&wL8B$c=h#1DrPPSh;nFPU}So7U-7Dtm0{Er>61~LPMgg$Q;>>2x!EbmMpb{( z-mRCiL<_I`Y?!?A(j|+m>d7)9qFdgsjhU!sE$8<3UQp)M#pn9_Bi*0%P2Z;YTPLFB zi`Cs{4HIh9v#wRWICJ%tD3_I=RrUmvx9?Q=Z#GrT-D5pt7i+{PG1a>)F)UBm>sicS zfSka>A)w&U@JCW*9qS`aT_6)K#=y8~(epa6*o?08$}%@!JBJFVdQ&MBb@0IFh_!~g&Q literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_1.9.png b/java/res/drawable-hdpi/keyboard_hint_1.9.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf3742627b21cbdb8442de2a012044e0c11b336 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Mdv+T978H@y}7-S_mF`=>%(dd-s}xbx~ke66tph{8M%91 zvyeOC5mM4_@w$G}RK0KNcP+!FXv{g&v&y6DeoW}+ioS?N7IAwP+3oD~G~!>f$-a)O z(u`{DMw9-rZF+@9#dowX}bS z{I$R&>uvEs^)>Zky|IhUogVEK18HYqWCEFEt7ysXG6h)#C^hrN?szY5pzPXDzv5m$ h{=RVCMdt=ahR_0)jl5NPEDSr z1<%~X^wgl##FWaylc_cg42));E{-7;x8B@V>_6ln(DpF4$uTTx;*H63j(pOdnC`E% zaq3nNKc$1Z_a|gtTHv7b^2v)fZz-W@*kPAsS>Xi8Af+7p)F^XFy9x?lJB9Aatm zW6mr0nM*s5lqi@!Kklw*7O0`C;LyOp`02jlXG31M*`H7G|1UXS$jdJHAo{Lb?!)El ztjYzJ@digpeK;g2=DzisqjkNmo7Hb!j(@c#vaQbfopRren=ygEE6ab*?G@NqzkG?C@y*r@w$G2!jyLD8y}P>l zq(s=-v<+US_kLOI{nPm4llU*Y({(IQ-idPvfE~xg!ZBgO1S3(8Wm|ww1@d6RCtBwH rUJ4Qu(vs^h;Q41KV)`kzfssL9-0ybAyCgMWFf(|%`njxgN@xNA2DYYa literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_3.9.png b/java/res/drawable-hdpi/keyboard_hint_3.9.png new file mode 100644 index 0000000000000000000000000000000000000000..34b5011091f55725d5f63f7f60bd7e9f3c7eaa75 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42<@kE{-7;x8BTNxbBdHfNQxYtA~n*${!}7ZkJE3C(<|i zD{Y*rF!8~(-6^w7LTx71zMN7#`DB~g1zYRl^x3|hj$WFrL0yJs_Hy2L-M@2$YUudd zwSDqhY#_kPzGR90KT#Fw)=Nw*0uBs}Pi{M|+UMgU{n_R48N0ZzM+(bXlNhXzE-L=( zZlG?yG*x^4;xHM}vro1+&D^D>dr-#eW<=JBnWq%Yr>BV@xufuoX^riy+Qo@^ahBS3 zv1MzgZHf=;YJc?Uo6{7#njagw-|AZDm#(WhaM8LyLOh$t?&FsJ6#q4A|EBe>-Qx6m z7I(i*j(dDbO;JeMpUNXfm#2jPJ^p^#y_tUxyFO^(1Gx|ENR|ou%%0ASom0dV8W@;3 vkO=0g_tU{XiFx^z%l-9x=Qz>%Ogs!?JHqW1w==l{!<)g=)z4*}Q$iB}aOa<2 literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_4.9.png b/java/res/drawable-hdpi/keyboard_hint_4.9.png new file mode 100644 index 0000000000000000000000000000000000000000..d4cc250dd60f767fcbd24a7745eca1500433439f GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Mc+ML978H@y}7-YugO59?cuZ?7MqNARdHJFvf5QOwXbJg z&z+{#i}Su3%LzM~IQlH~y*GKzoF&dLFUuz|ycbbq5!c@H{r$PxHLqVtojcyvkUsPv{Tm>&TV(_R~;Ax44$rjF6*2UngHvggLnV{ literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_5.9.png b/java/res/drawable-hdpi/keyboard_hint_5.9.png new file mode 100644 index 0000000000000000000000000000000000000000..6a054b42f3e54ba92238f30bef827e062d1f7150 GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42)`?E{-7;x8B^|$k${b(D3k@!HXBCPP}^Y>P4}|uLK)* z<@FCvoj7%CZJej4lv>Zqhp*~AgPoYZEG}R6gJ(prOA$mUlQ-TETag`;w|z-eh5m+a$%zNQ zt!|WEy4z#*;j7-CYhB`dTOLh&CwG2N_sXqzg5zd&-90L@YI14t9ufalUA8l4N~%4U zw7+xhJ=>?Jo)1`M!LDIsV&Rxz-~1y;VcHcYAR8_ypuk%D-8+ksk;x_W%=`kCdihII c-*gW!1ZjH9du_5+1qLgFr>mdKI;Vst0G>vjdjJ3c literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_6.9.png b/java/res/drawable-hdpi/keyboard_hint_6.9.png new file mode 100644 index 0000000000000000000000000000000000000000..66e91400a7fbc99b5ca1c5d9798fbc52ad46dd16 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42<@kE{-7;x8B@d*muZ5;Mm95CWcPeu%;tQm8@|O!#0rrg|`@vYB(9dy?LhQ_4$1HQ!F%dBks9{wvNR-MQB|ru3b^6MHk)N&e0Auo=BmBl{L_ z56wDSr z1<%~X^wgl##FWaylc_cg42*)FE{-7;x8B^g=Q?B{a{Qys%S#t8_O0ua-P;}hL2usi zi&wWUPF^3d{YUVk4uvaTCY<-#6&GZDep$V~e#xxhiubW=3^xCs9=+ymhV;6kiO${T z;`V>ehzdP*Ncwi%U-7!z!YvI9j7%&X6PyuEnvMiSK{MLmG|ypiSLdn1m%4zozZ_&Zfl5A?u*{In=gv( z{%i~0G*QImW`>FB!jrq__;>W@)LeSv={TkL*X&JRpKOc@-9PLW6Hst~SS_GX=~SaB zuo&tRn7D`I`M*I?Ks6_|^7@(V{?=+--_Xs#%rHH~wsG-8ms`LPWbkzLb6Mw<&;$U~ CO_((R literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_8.9.png b/java/res/drawable-hdpi/keyboard_hint_8.9.png new file mode 100644 index 0000000000000000000000000000000000000000..ea7f512fd6b4e0a7c538ffd9b422623e162f221d GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42;g6E{-7;x8B@V>_226aqQ!?gb5K(YFVEsrcYFVc(_oW zvD>Eln@W+#la%+Gm9r(_ZohvHe*d`Qz%o*I#!xP7(TbMJFexENbDo=F^+MEq%vq zc{4lw(7mkRa#BBPEN!JdZ(MKNA*Iy5zi?|`#DeYLzD-C!!b%~$?~9GQI=b; zZU3;PFXq$&-50U?+I5HWRIhwVOZd<<72TIzkScPANmIv8c)WtiSDnE1%^3;r>mdKI;Vst E0CAeGE&u=k literal 0 HcmV?d00001 diff --git a/java/res/drawable-hdpi/keyboard_hint_9.9.png b/java/res/drawable-hdpi/keyboard_hint_9.9.png new file mode 100644 index 0000000000000000000000000000000000000000..0bf85de931823f0cefe4727c2c3e053cdaec786b GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42;g6E{-7;x8BU&n0LrP#Px00!k$RuO-7%%*T`CbVptRpoo`<*y&Xb@F8Gd9}a}M=#CRpe{qccsXxb_v0L^10t+` zN}ST(+tQk0si6A%alB*E;((|I1||-L1_mSL%))z5cBJ3G>cbGVl>g|h`PNID>+E8) zil5vSNI&X%v0{y!`y02%)zc3LBzdj<6qfuvN~W^(om=wZvf$wUJAP4oZ>Fs8I?4OL zz&*rj?r){nXZL=LeY!?<#^Urp-isTkXr_S#Q>SthP(6$Yla%JLsdtjI|c)I$ztaD0e0swt# Bt2h7v literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_0.9.png b/java/res/drawable-mdpi/keyboard_hint_0.9.png new file mode 100644 index 0000000000000000000000000000000000000000..271264e92c36f17b72b7ee910cee45c351fc0bf4 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42-g#E{-7;x8B^|%hzNeaNy%Lg9kSP-NN1D8^a5}yp*YB zjdyl;3v;{s>gpWN!$%T0+y8s(sm}7KFZ#>D_+BNcXI)6e`~CLsyyv=~d#Dv|vE=i; zsr@?&wL8B$c=h#1DrPPSh;nFPU}So7U-7Dtm0{Er>61~LPMgg$Q;>>2x!EbmMpb{( z-mRCiL<_I`Y?!?A(j|+m>d7)9qFdgsjhU!sE$8<3UQp)M#pn9_Bi*0%P2Z;YTPLFB zi`Cs{4HIh9v#wRWICJ%tD3_I=RrUmvx9?Q=Z#GrT-D5pt7i+{PG1a>)F)UBm>sicS zfSka>A)w&U@JCW*9qS`aT_6)K#=y8~(epa6*o?08$}%@!JBJFVdQ&MBb@0IFh_!~g&Q literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_1.9.png b/java/res/drawable-mdpi/keyboard_hint_1.9.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf3742627b21cbdb8442de2a012044e0c11b336 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Mdv+T978H@y}7-S_mF`=>%(dd-s}xbx~ke66tph{8M%91 zvyeOC5mM4_@w$G}RK0KNcP+!FXv{g&v&y6DeoW}+ioS?N7IAwP+3oD~G~!>f$-a)O z(u`{DMw9-rZF+@9#dowX}bS z{I$R&>uvEs^)>Zky|IhUogVEK18HYqWCEFEt7ysXG6h)#C^hrN?szY5pzPXDzv5m$ h{=RVCMdt=ahR_0)jl5NPEDSr z1<%~X^wgl##FWaylc_cg42));E{-7;x8B@V>_6ln(DpF4$uTTx;*H63j(pOdnC`E% zaq3nNKc$1Z_a|gtTHv7b^2v)fZz-W@*kPAsS>Xi8Af+7p)F^XFy9x?lJB9Aatm zW6mr0nM*s5lqi@!Kklw*7O0`C;LyOp`02jlXG31M*`H7G|1UXS$jdJHAo{Lb?!)El ztjYzJ@digpeK;g2=DzisqjkNmo7Hb!j(@c#vaQbfopRren=ygEE6ab*?G@NqzkG?C@y*r@w$G2!jyLD8y}P>l zq(s=-v<+US_kLOI{nPm4llU*Y({(IQ-idPvfE~xg!ZBgO1S3(8Wm|ww1@d6RCtBwH rUJ4Qu(vs^h;Q41KV)`kzfssL9-0ybAyCgMWFf(|%`njxgN@xNA2DYYa literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_3.9.png b/java/res/drawable-mdpi/keyboard_hint_3.9.png new file mode 100644 index 0000000000000000000000000000000000000000..34b5011091f55725d5f63f7f60bd7e9f3c7eaa75 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42<@kE{-7;x8BTNxbBdHfNQxYtA~n*${!}7ZkJE3C(<|i zD{Y*rF!8~(-6^w7LTx71zMN7#`DB~g1zYRl^x3|hj$WFrL0yJs_Hy2L-M@2$YUudd zwSDqhY#_kPzGR90KT#Fw)=Nw*0uBs}Pi{M|+UMgU{n_R48N0ZzM+(bXlNhXzE-L=( zZlG?yG*x^4;xHM}vro1+&D^D>dr-#eW<=JBnWq%Yr>BV@xufuoX^riy+Qo@^ahBS3 zv1MzgZHf=;YJc?Uo6{7#njagw-|AZDm#(WhaM8LyLOh$t?&FsJ6#q4A|EBe>-Qx6m z7I(i*j(dDbO;JeMpUNXfm#2jPJ^p^#y_tUxyFO^(1Gx|ENR|ou%%0ASom0dV8W@;3 vkO=0g_tU{XiFx^z%l-9x=Qz>%Ogs!?JHqW1w==l{!<)g=)z4*}Q$iB}aOa<2 literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_4.9.png b/java/res/drawable-mdpi/keyboard_hint_4.9.png new file mode 100644 index 0000000000000000000000000000000000000000..d4cc250dd60f767fcbd24a7745eca1500433439f GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Mc+ML978H@y}7-YugO59?cuZ?7MqNARdHJFvf5QOwXbJg z&z+{#i}Su3%LzM~IQlH~y*GKzoF&dLFUuz|ycbbq5!c@H{r$PxHLqVtojcyvkUsPv{Tm>&TV(_R~;Ax44$rjF6*2UngHvggLnV{ literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_5.9.png b/java/res/drawable-mdpi/keyboard_hint_5.9.png new file mode 100644 index 0000000000000000000000000000000000000000..6a054b42f3e54ba92238f30bef827e062d1f7150 GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42)`?E{-7;x8B^|$k${b(D3k@!HXBCPP}^Y>P4}|uLK)* z<@FCvoj7%CZJej4lv>Zqhp*~AgPoYZEG}R6gJ(prOA$mUlQ-TETag`;w|z-eh5m+a$%zNQ zt!|WEy4z#*;j7-CYhB`dTOLh&CwG2N_sXqzg5zd&-90L@YI14t9ufalUA8l4N~%4U zw7+xhJ=>?Jo)1`M!LDIsV&Rxz-~1y;VcHcYAR8_ypuk%D-8+ksk;x_W%=`kCdihII c-*gW!1ZjH9du_5+1qLgFr>mdKI;Vst0G>vjdjJ3c literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_6.9.png b/java/res/drawable-mdpi/keyboard_hint_6.9.png new file mode 100644 index 0000000000000000000000000000000000000000..66e91400a7fbc99b5ca1c5d9798fbc52ad46dd16 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42<@kE{-7;x8B@d*muZ5;Mm95CWcPeu%;tQm8@|O!#0rrg|`@vYB(9dy?LhQ_4$1HQ!F%dBks9{wvNR-MQB|ru3b^6MHk)N&e0Auo=BmBl{L_ z56wDSr z1<%~X^wgl##FWaylc_cg42*)FE{-7;x8B^g=Q?B{a{Qys%S#t8_O0ua-P;}hL2usi zi&wWUPF^3d{YUVk4uvaTCY<-#6&GZDep$V~e#xxhiubW=3^xCs9=+ymhV;6kiO${T z;`V>ehzdP*Ncwi%U-7!z!YvI9j7%&X6PyuEnvMiSK{MLmG|ypiSLdn1m%4zozZ_&Zfl5A?u*{In=gv( z{%i~0G*QImW`>FB!jrq__;>W@)LeSv={TkL*X&JRpKOc@-9PLW6Hst~SS_GX=~SaB zuo&tRn7D`I`M*I?Ks6_|^7@(V{?=+--_Xs#%rHH~wsG-8ms`LPWbkzLb6Mw<&;$U~ CO_((R literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_8.9.png b/java/res/drawable-mdpi/keyboard_hint_8.9.png new file mode 100644 index 0000000000000000000000000000000000000000..ea7f512fd6b4e0a7c538ffd9b422623e162f221d GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42;g6E{-7;x8B@V>_226aqQ!?gb5K(YFVEsrcYFVc(_oW zvD>Eln@W+#la%+Gm9r(_ZohvHe*d`Qz%o*I#!xP7(TbMJFexENbDo=F^+MEq%vq zc{4lw(7mkRa#BBPEN!JdZ(MKNA*Iy5zi?|`#DeYLzD-C!!b%~$?~9GQI=b; zZU3;PFXq$&-50U?+I5HWRIhwVOZd<<72TIzkScPANmIv8c)WtiSDnE1%^3;r>mdKI;Vst E0CAeGE&u=k literal 0 HcmV?d00001 diff --git a/java/res/drawable-mdpi/keyboard_hint_9.9.png b/java/res/drawable-mdpi/keyboard_hint_9.9.png new file mode 100644 index 0000000000000000000000000000000000000000..0bf85de931823f0cefe4727c2c3e053cdaec786b GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSs!3HD`yQJj;DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg42;g6E{-7;x8BU&n0LrP#Px00!k$RuO-7%%*T`CbVptRpoo`<*y&Xb@F8Gd9}a}M=#CRpe{qccsXxb_v0L^10t+` zN}ST(+tQk0si6A%alB*E;((|I1||-L1_mSL%))z5cBJ3G>cbGVl>g|h`PNID>+E8) zil5vSNI&X%v0{y!`y02%)zc3LBzdj<6qfuvN~W^(om=wZvf$wUJAP4oZ>Fs8I?4OL zz&*rj?r){nXZL=LeY!?<#^Urp-isTkXr_S#Q>SthP(6$Yla%JLsdtjI|c)I$ztaD0e0swt# Bt2h7v literal 0 HcmV?d00001 diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 4e139e849..8b89f3900 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -63,6 +63,9 @@ public class LatinKeyboard extends Keyboard { private Key mF1Key; private Key mSpaceKey; private Key m123Key; + private final int NUMBER_HINT_COUNT = 10; + private Key[] mNumberHintKeys; + private Drawable[] mNumberHintIcons = new Drawable[NUMBER_HINT_COUNT]; private int mSpaceKeyIndex = -1; private int mSpaceDragStartX; private int mSpaceDragLastDiff; @@ -129,6 +132,21 @@ public class LatinKeyboard extends Keyboard { mIsAlphaKeyboard = xmlLayoutResId == R.xml.kbd_qwerty || xmlLayoutResId == R.xml.kbd_qwerty_black; mSpaceKeyIndex = indexOf(' '); + initializeNumberHintResources(context); + } + + private void initializeNumberHintResources(Context context) { + final Resources res = context.getResources(); + mNumberHintIcons[0] = res.getDrawable(R.drawable.keyboard_hint_0); + mNumberHintIcons[1] = res.getDrawable(R.drawable.keyboard_hint_1); + mNumberHintIcons[2] = res.getDrawable(R.drawable.keyboard_hint_2); + mNumberHintIcons[3] = res.getDrawable(R.drawable.keyboard_hint_3); + mNumberHintIcons[4] = res.getDrawable(R.drawable.keyboard_hint_4); + mNumberHintIcons[5] = res.getDrawable(R.drawable.keyboard_hint_5); + mNumberHintIcons[6] = res.getDrawable(R.drawable.keyboard_hint_6); + mNumberHintIcons[7] = res.getDrawable(R.drawable.keyboard_hint_7); + mNumberHintIcons[8] = res.getDrawable(R.drawable.keyboard_hint_8); + mNumberHintIcons[9] = res.getDrawable(R.drawable.keyboard_hint_9); } @Override @@ -150,6 +168,23 @@ public class LatinKeyboard extends Keyboard { m123Label = key.label; break; } + + // For number hints on the upper-right corner of key + if (mNumberHintKeys == null) { + // NOTE: This protected method is being called from the base class constructor before + // mNumberHintKeys gets initialized. + mNumberHintKeys = new Key[NUMBER_HINT_COUNT]; + } + int hintNumber = -1; + if (LatinKeyboardBaseView.isNumberAtLeftmostPopupChar(key)) { + hintNumber = key.popupCharacters.charAt(0) - '0'; + } else if (LatinKeyboardBaseView.isNumberAtRightmostPopupChar(key)) { + hintNumber = key.popupCharacters.charAt(key.popupCharacters.length() - 1) - '0'; + } + if (hintNumber >= 0 && hintNumber <= 9) { + mNumberHintKeys[hintNumber] = key; + } + return key; } @@ -293,6 +328,7 @@ public class LatinKeyboard extends Keyboard { if (mSpaceKey != null) { updateSpaceBarForLocale(isAutoCompletion, isBlack); } + updateNumberHintKeys(); } private void setDefaultBounds(Drawable drawable) { @@ -340,6 +376,14 @@ public class LatinKeyboard extends Keyboard { return mSpaceKey; } + private void updateNumberHintKeys() { + for (int i = 0; i < mNumberHintKeys.length; ++i) { + if (mNumberHintKeys[i] != null) { + mNumberHintKeys[i].icon = mNumberHintIcons[i]; + } + } + } + private void updateSpaceBarForLocale(boolean isAutoCompletion, boolean isBlack) { // If application locales are explicitly selected. if (mLocale != null) { diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index a2db12979..26b3c0581 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -797,6 +797,7 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx canvas.translate(key.x + kbdPaddingLeft, key.y + kbdPaddingTop); keyBackground.draw(canvas); + boolean shouldDrawIcon = true; if (label != null) { // For characters, use large font. For labels like "Done", use small font. if (label.length() > 1 && key.codes.length < 2) { @@ -817,14 +818,24 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx paint); // Turn off drop shadow paint.setShadowLayer(0, 0, 0, 0); - } else if (key.icon != null) { + + // Usually don't draw icon if label is not null, but we draw icon for the number + // hint. + shouldDrawIcon = isNumberAtEdgeOfPopupChars(key); + } + if (key.icon != null && shouldDrawIcon) { + // Special handing for the upper-right number hint icons + final int drawableWidth = isNumberAtEdgeOfPopupChars(key) ? + key.width : key.icon.getIntrinsicWidth(); + final int drawableHeight = isNumberAtEdgeOfPopupChars(key) ? + key.height : key.icon.getIntrinsicHeight(); + final int drawableX = (key.width - padding.left - padding.right - - key.icon.getIntrinsicWidth()) / 2 + padding.left; + - drawableWidth) / 2 + padding.left; final int drawableY = (key.height - padding.top - padding.bottom - - key.icon.getIntrinsicHeight()) / 2 + padding.top; + - drawableHeight) / 2 + padding.top; canvas.translate(drawableX, drawableY); - key.icon.setBounds(0, 0, - key.icon.getIntrinsicWidth(), key.icon.getIntrinsicHeight()); + key.icon.setBounds(0, 0, drawableWidth, drawableHeight); key.icon.draw(canvas); canvas.translate(-drawableX, -drawableY); } @@ -885,7 +896,8 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx Key key = tracker.getKey(keyIndex); if (key == null) return; - if (key.icon != null) { + // Should not draw number hint icons + if (key.icon != null && !isNumberAtEdgeOfPopupChars(key)) { mPreviewText.setCompoundDrawables(null, null, null, key.iconPreview != null ? key.iconPreview : key.icon); mPreviewText.setText(null); @@ -1100,12 +1112,8 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx } // HACK: Have the leftmost number in the popup characters right above the key - boolean isNumberAtLeftmost = false; - if (popupKey.popupCharacters != null && popupKey.popupCharacters.length() > 1) { - char leftmostChar = popupKey.popupCharacters.charAt(0); - isNumberAtLeftmost = leftmostChar >= '0' && leftmostChar <= '9'; - } - + boolean isNumberAtLeftmost = + hasMultiplePopupChars(popupKey) && isNumberAtLeftmostPopupChar(popupKey); int popupX = popupKey.x + mWindowOffset[0]; int popupY = popupKey.y + mWindowOffset[1]; if (isNumberAtLeftmost) { @@ -1151,6 +1159,37 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx return true; } + private static boolean hasMultiplePopupChars(Key key) { + if (key.popupCharacters != null && key.popupCharacters.length() > 1) { + return true; + } + return false; + } + + private static boolean isNumberAtEdgeOfPopupChars(Key key) { + return isNumberAtLeftmostPopupChar(key) || isNumberAtRightmostPopupChar(key); + } + + /* package */ static boolean isNumberAtLeftmostPopupChar(Key key) { + if (key.popupCharacters != null && key.popupCharacters.length() > 0 + && isAsciiDigit(key.popupCharacters.charAt(0))) { + return true; + } + return false; + } + + /* package */ static boolean isNumberAtRightmostPopupChar(Key key) { + if (key.popupCharacters != null && key.popupCharacters.length() > 0 + && isAsciiDigit(key.popupCharacters.charAt(key.popupCharacters.length() - 1))) { + return true; + } + return false; + } + + private static boolean isAsciiDigit(char c) { + return (c < 0x80) && Character.isDigit(c); + } + private MotionEvent generateMiniKeyboardMotionEvent(int action, int x, int y, long eventTime) { return MotionEvent.obtain(mMiniKeyboardPopupTime, eventTime, action, x - mMiniKeyboardOriginX, y - mMiniKeyboardOriginY, 0); diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index c17d7c555..a45bb21e9 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -24,6 +24,7 @@ import android.inputmethodservice.Keyboard.Key; import android.os.Handler; import android.os.Message; import android.os.SystemClock; +import android.text.TextUtils; import android.util.AttributeSet; import android.view.MotionEvent; @@ -101,7 +102,7 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { if (keyboard.isShifted() && keyboard instanceof LatinKeyboard && ((LatinKeyboard) keyboard).isAlphaKeyboard() - && label != null && label.length() < 3 + && !TextUtils.isEmpty(label) && label.length() < 3 && Character.isLowerCase(label.charAt(0))) { label = label.toString().toUpperCase(); }