1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.inputmethod.keyboard; 18 19 import android.test.AndroidTestCase; 20 import android.test.suitebuilder.annotation.MediumTest; 21 22 import com.android.inputmethod.keyboard.MoreKeysKeyboard.MoreKeysKeyboardParams; 23 24 @MediumTest 25 public class MoreKeysKeyboardBuilderFixedOrderTests extends AndroidTestCase { 26 private static final int WIDTH = 10; 27 private static final int HEIGHT = 10; 28 29 private static final int KEYBOARD_WIDTH = WIDTH * 10; 30 private static final int XPOS_L0 = WIDTH * 0 + WIDTH / 2; 31 private static final int XPOS_L1 = WIDTH * 1 + WIDTH / 2; 32 private static final int XPOS_L2 = WIDTH * 2 + WIDTH / 2; 33 private static final int XPOS_L3 = WIDTH * 3 + WIDTH / 2; 34 private static final int XPOS_M0 = WIDTH * 4 + WIDTH / 2; 35 private static final int XPOS_M1 = WIDTH * 5 + WIDTH / 2; 36 private static final int XPOS_R3 = WIDTH * 6 + WIDTH / 2; 37 private static final int XPOS_R2 = WIDTH * 7 + WIDTH / 2; 38 private static final int XPOS_R1 = WIDTH * 8 + WIDTH / 2; 39 private static final int XPOS_R0 = WIDTH * 9 + WIDTH / 2; 40 41 @Override 42 protected void setUp() throws Exception { 43 super.setUp(); 44 } 45 46 private static MoreKeysKeyboardParams createParams(final int numKeys, final int columnNum, 47 final int coordXInParent) { 48 final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams(); 49 params.setParameters(numKeys, columnNum, WIDTH, HEIGHT, coordXInParent, KEYBOARD_WIDTH, 50 true /* isMoreKeysFixedColumn */, true /* isMoreKeysFixedOrder */, 51 0 /* dividerWidth */); 52 return params; 53 } 54 55 public void testLayoutError() { 56 MoreKeysKeyboardParams params = null; 57 try { 58 final int fixColumns = KEYBOARD_WIDTH / WIDTH; 59 params = createParams(fixColumns + 1, fixColumns + 1, HEIGHT); 60 fail("Should throw IllegalArgumentException"); 61 } catch (IllegalArgumentException e) { 62 // Too small keyboard to hold more keys keyboard. 63 } 64 assertNull("Too small keyboard to hold more keys keyboard", params); 65 } 66 67 // More keys keyboard layout test. 68 // "[n]" represents n-th key position in more keys keyboard. 69 // "<m>" is the default key. 70 71 // <1> 72 public void testLayout1KeyFix5M0() { 73 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_M0); 74 assertEquals("1 key fix 5 M0 columns", 1, params.mNumColumns); 75 assertEquals("1 key fix 5 M0 rows", 1, params.mNumRows); 76 assertEquals("1 key fix 5 M0 left", 0, params.mLeftKeys); 77 assertEquals("1 key fix 5 M0 right", 1, params.mRightKeys); 78 assertEquals("1 key fix 5 M0 <1>", 0, params.getColumnPos(0)); 79 assertEquals("1 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 80 assertEquals("1 key fix 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 81 } 82 83 // |<1> 84 public void testLayout1KeyFix5L0() { 85 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L0); 86 assertEquals("1 key fix 5 L0 columns", 1, params.mNumColumns); 87 assertEquals("1 key fix 5 L0 rows", 1, params.mNumRows); 88 assertEquals("1 key fix 5 L0 left", 0, params.mLeftKeys); 89 assertEquals("1 key fix 5 L0 right", 1, params.mRightKeys); 90 assertEquals("1 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 91 assertEquals("1 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 92 assertEquals("1 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 93 } 94 95 // |___ <1> 96 public void testLayout1KeyFix5L1() { 97 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L1); 98 assertEquals("1 key fix 5 L1 columns", 1, params.mNumColumns); 99 assertEquals("1 key fix 5 L1 rows", 1, params.mNumRows); 100 assertEquals("1 key fix 5 L1 left", 0, params.mLeftKeys); 101 assertEquals("1 key fix 5 L1 right", 1, params.mRightKeys); 102 assertEquals("1 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 103 assertEquals("1 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 104 assertEquals("1 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 105 } 106 107 // |___ ___ <1> 108 public void testLayout1KeyFix5L2() { 109 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L2); 110 assertEquals("1 key fix 5 L2 columns", 1, params.mNumColumns); 111 assertEquals("1 key fix 5 L2 rows", 1, params.mNumRows); 112 assertEquals("1 key fix 5 L2 left", 0, params.mLeftKeys); 113 assertEquals("1 key fix 5 L2 right", 1, params.mRightKeys); 114 assertEquals("1 key fix 5 L2 <1>", 0, params.getColumnPos(0)); 115 assertEquals("1 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 116 assertEquals("1 key fix 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 117 } 118 119 // <1>| 120 public void testLayout1KeyFix5R0() { 121 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R0); 122 assertEquals("1 key fix 5 R0 columns", 1, params.mNumColumns); 123 assertEquals("1 key fix 5 R0 rows", 1, params.mNumRows); 124 assertEquals("1 key fix 5 R0 left", 0, params.mLeftKeys); 125 assertEquals("1 key fix 5 R0 right", 1, params.mRightKeys); 126 assertEquals("1 key fix 5 R0 <1>", 0, params.getColumnPos(0)); 127 assertEquals("1 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 128 assertEquals("1 key fix 5 R0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 129 } 130 131 // <1> ___| 132 public void testLayout1KeyFix5R1() { 133 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R1); 134 assertEquals("1 key fix 5 R1 columns", 1, params.mNumColumns); 135 assertEquals("1 key fix 5 R1 rows", 1, params.mNumRows); 136 assertEquals("1 key fix 5 R1 left", 0, params.mLeftKeys); 137 assertEquals("1 key fix 5 R1 right", 1, params.mRightKeys); 138 assertEquals("1 key fix 5 R1 <1>", 0, params.getColumnPos(0)); 139 assertEquals("1 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 140 assertEquals("1 key fix 5 R1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 141 } 142 143 // <1> ___ ___| 144 public void testLayout1KeyFix5R2() { 145 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R2); 146 assertEquals("1 key fix 5 R2 columns", 1, params.mNumColumns); 147 assertEquals("1 key fix 5 R2 rows", 1, params.mNumRows); 148 assertEquals("1 key fix 5 R2 left", 0, params.mLeftKeys); 149 assertEquals("1 key fix 5 R2 right", 1, params.mRightKeys); 150 assertEquals("1 key fix 5 R2 <1>", 0, params.getColumnPos(0)); 151 assertEquals("1 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 152 assertEquals("1 key fix 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 153 } 154 155 // <1> [2] 156 public void testLayout2KeyFix5M0() { 157 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_M0); 158 assertEquals("2 key fix 5 M0 columns", 2, params.mNumColumns); 159 assertEquals("2 key fix 5 M0 rows", 1, params.mNumRows); 160 assertEquals("2 key fix 5 M0 left", 0, params.mLeftKeys); 161 assertEquals("2 key fix 5 M0 right", 2, params.mRightKeys); 162 assertEquals("2 key fix 5 M0 <1>", 0, params.getColumnPos(0)); 163 assertEquals("2 key fix 5 M0 [2]", 1, params.getColumnPos(1)); 164 assertEquals("2 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 165 assertEquals("2 key fix 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 166 } 167 168 // |<1> [2] 169 public void testLayout2KeyFix5L0() { 170 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L0); 171 assertEquals("2 key fix 5 L0 columns", 2, params.mNumColumns); 172 assertEquals("2 key fix 5 L0 rows", 1, params.mNumRows); 173 assertEquals("2 key fix 5 L0 left", 0, params.mLeftKeys); 174 assertEquals("2 key fix 5 L0 right", 2, params.mRightKeys); 175 assertEquals("2 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 176 assertEquals("2 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 177 assertEquals("2 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 178 assertEquals("2 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 179 } 180 181 // |___ <1> [2] 182 public void testLayout2KeyFix5L1() { 183 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L1); 184 assertEquals("2 key fix 5 L1 columns", 2, params.mNumColumns); 185 assertEquals("2 key fix 5 L1 rows", 1, params.mNumRows); 186 assertEquals("2 key fix 5 L1 left", 0, params.mLeftKeys); 187 assertEquals("2 key fix 5 L1 right", 2, params.mRightKeys); 188 assertEquals("2 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 189 assertEquals("2 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 190 assertEquals("2 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 191 assertEquals("2 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 192 } 193 194 // |___ ___ <1> [2] 195 public void testLayout2KeyFix5L2() { 196 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L2); 197 assertEquals("2 key fix 5 L2 columns", 2, params.mNumColumns); 198 assertEquals("2 key fix 5 L2 rows", 1, params.mNumRows); 199 assertEquals("2 key fix 5 L2 left", 0, params.mLeftKeys); 200 assertEquals("2 key fix 5 L2 right", 2, params.mRightKeys); 201 assertEquals("2 key fix 5 L2 <1>", 0, params.getColumnPos(0)); 202 assertEquals("2 key fix 5 L2 [2]", 1, params.getColumnPos(1)); 203 assertEquals("2 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 204 assertEquals("2 key fix 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 205 } 206 207 // [1] <2>| 208 public void testLayout2KeyFix5R0() { 209 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R0); 210 assertEquals("2 key fix 5 R0 columns", 2, params.mNumColumns); 211 assertEquals("2 key fix 5 R0 rows", 1, params.mNumRows); 212 assertEquals("2 key fix 5 R0 left", 1, params.mLeftKeys); 213 assertEquals("2 key fix 5 R0 right", 1, params.mRightKeys); 214 assertEquals("2 key fix 5 R0 [1]", -1, params.getColumnPos(0)); 215 assertEquals("2 key fix 5 R0 <2>", 0, params.getColumnPos(1)); 216 assertEquals("2 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 217 assertEquals("2 key fix 5 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 218 } 219 220 // [1] <2> ___| 221 public void testLayout2KeyFix5R1() { 222 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R1); 223 assertEquals("2 key fix 5 R1 columns", 2, params.mNumColumns); 224 assertEquals("2 key fix 5 R1 rows", 1, params.mNumRows); 225 assertEquals("2 key fix 5 R1 left", 1, params.mLeftKeys); 226 assertEquals("2 key fix 5 R1 right", 1, params.mRightKeys); 227 assertEquals("2 key fix 5 R1 [1]", -1, params.getColumnPos(0)); 228 assertEquals("2 key fix 5 R1 <2>", 0, params.getColumnPos(1)); 229 assertEquals("2 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 230 assertEquals("2 key fix 5 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 231 } 232 233 // <1> [2] ___| 234 public void testLayout2KeyFix5R2() { 235 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R2); 236 assertEquals("2 key fix 5 R2 columns", 2, params.mNumColumns); 237 assertEquals("2 key fix 5 R2 rows", 1, params.mNumRows); 238 assertEquals("2 key fix 5 R2 left", 0, params.mLeftKeys); 239 assertEquals("2 key fix 5 R2 right", 2, params.mRightKeys); 240 assertEquals("2 key fix 5 R2 <1>", 0, params.getColumnPos(0)); 241 assertEquals("2 key fix 5 R2 [2]", 1, params.getColumnPos(1)); 242 assertEquals("2 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 243 assertEquals("2 key fix 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 244 } 245 246 // [3] 247 // <1> [2] 248 public void testLayout3KeyFix2M0() { 249 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_M0); 250 assertEquals("3 key fix 2 M0 columns", 2, params.mNumColumns); 251 assertEquals("3 key fix 2 M0 rows", 2, params.mNumRows); 252 assertEquals("3 key fix 2 M0 left", 0, params.mLeftKeys); 253 assertEquals("3 key fix 2 M0 right", 2, params.mRightKeys); 254 assertEquals("3 key fix 2 M0 <1>", 0, params.getColumnPos(0)); 255 assertEquals("3 key fix 2 M0 [2]", 1, params.getColumnPos(1)); 256 assertEquals("3 key fix 2 M0 [3]", 0, params.getColumnPos(2)); 257 assertEquals("3 key fix 2 M0 adjust", 0, params.mTopRowAdjustment); 258 assertEquals("3 key fix 2 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 259 } 260 261 // |[3] 262 // |<1> [2] 263 public void testLayout3KeyFix2L0() { 264 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L0); 265 assertEquals("3 key fix 2 L0 columns", 2, params.mNumColumns); 266 assertEquals("3 key fix 2 L0 rows", 2, params.mNumRows); 267 assertEquals("3 key fix 2 L0 left", 0, params.mLeftKeys); 268 assertEquals("3 key fix 2 L0 right", 2, params.mRightKeys); 269 assertEquals("3 key fix 2 L0 <1>", 0, params.getColumnPos(0)); 270 assertEquals("3 key fix 2 L0 [2]", 1, params.getColumnPos(1)); 271 assertEquals("3 key fix 2 L0 [3]", 0, params.getColumnPos(2)); 272 assertEquals("3 key fix 2 L0 adjust", 0, params.mTopRowAdjustment); 273 assertEquals("3 key fix 2 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 274 } 275 276 // |___ [3] 277 // |___ <1> [2] 278 public void testLayout3KeyFix2L1() { 279 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L1); 280 assertEquals("3 key fix 2 L1 columns", 2, params.mNumColumns); 281 assertEquals("3 key fix 2 L1 rows", 2, params.mNumRows); 282 assertEquals("3 key fix 2 L1 left", 0, params.mLeftKeys); 283 assertEquals("3 key fix 2 L1 right", 2, params.mRightKeys); 284 assertEquals("3 key fix 2 L1 <1>", 0, params.getColumnPos(0)); 285 assertEquals("3 key fix 2 L1 [2]", 1, params.getColumnPos(1)); 286 assertEquals("3 key fix 2 L1 [3]", 0, params.getColumnPos(2)); 287 assertEquals("3 key fix 2 L1 adjust", 0, params.mTopRowAdjustment); 288 assertEquals("3 key fix 2 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 289 } 290 291 // | [3] 292 // |___ ___ <1> [2] 293 public void testLayout3KeyFix2L2() { 294 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L2); 295 assertEquals("3 key fix 2 L2 columns", 2, params.mNumColumns); 296 assertEquals("3 key fix 2 L2 rows", 2, params.mNumRows); 297 assertEquals("3 key fix 2 L2 left", 0, params.mLeftKeys); 298 assertEquals("3 key fix 2 L2 right", 2, params.mRightKeys); 299 assertEquals("3 key fix 2 L2 <1>", 0, params.getColumnPos(0)); 300 assertEquals("3 key fix 2 L2 [2]", 1, params.getColumnPos(1)); 301 assertEquals("3 key fix 2 L2 [3]", 0, params.getColumnPos(2)); 302 assertEquals("3 key fix 2 L2 adjust", 0, params.mTopRowAdjustment); 303 assertEquals("3 key fix 2 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 304 } 305 306 // [3]| 307 // [1] <2>| 308 public void testLayout3KeyFix2R0() { 309 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R0); 310 assertEquals("3 key fix 2 R0 columns", 2, params.mNumColumns); 311 assertEquals("3 key fix 2 R0 rows", 2, params.mNumRows); 312 assertEquals("3 key fix 2 R0 left", 1, params.mLeftKeys); 313 assertEquals("3 key fix 2 R0 right", 1, params.mRightKeys); 314 assertEquals("3 key fix 2 R0 [1]", -1, params.getColumnPos(0)); 315 assertEquals("3 key fix 2 R0 <2>", 0, params.getColumnPos(1)); 316 assertEquals("3 key fix 2 R0 [3]", 0, params.getColumnPos(2)); 317 assertEquals("3 key fix 2 R0 adjust", 0, params.mTopRowAdjustment); 318 assertEquals("3 key fix 2 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 319 } 320 321 // [3] ___| 322 // [1] <2> ___| 323 public void testLayout3KeyFix2R1() { 324 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R1); 325 assertEquals("3 key fix 2 R1 columns", 2, params.mNumColumns); 326 assertEquals("3 key fix 2 R1 rows", 2, params.mNumRows); 327 assertEquals("3 key fix 2 R1 left", 1, params.mLeftKeys); 328 assertEquals("3 key fix 2 R1 right", 1, params.mRightKeys); 329 assertEquals("3 key fix 2 R1 [1]", -1, params.getColumnPos(0)); 330 assertEquals("3 key fix 2 R1 <2>", 0, params.getColumnPos(1)); 331 assertEquals("3 key fix 2 R1 [3]", 0, params.getColumnPos(2)); 332 assertEquals("3 key fix 2 R1 adjust", 0, params.mTopRowAdjustment); 333 assertEquals("3 key fix 2 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 334 } 335 336 // [3] ___| 337 // <1> [2] ___| 338 public void testLayout3KeyFix2R2() { 339 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R2); 340 assertEquals("3 key fix 2 R2 columns", 2, params.mNumColumns); 341 assertEquals("3 key fix 2 R2 rows", 2, params.mNumRows); 342 assertEquals("3 key fix 2 R2 left", 0, params.mLeftKeys); 343 assertEquals("3 key fix 2 R2 right", 2, params.mRightKeys); 344 assertEquals("3 key fix 2 R2 <1>", 0, params.getColumnPos(0)); 345 assertEquals("3 key fix 2 R2 [2]", 1, params.getColumnPos(1)); 346 assertEquals("3 key fix 2 R2 [3]", 0, params.getColumnPos(2)); 347 assertEquals("3 key fix 2 R2 adjust", 0, params.mTopRowAdjustment); 348 assertEquals("3 key fix 2 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 349 } 350 351 // [3] [4] 352 // <1> [2] 353 public void testLayout4KeyFix2M0() { 354 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_M0); 355 assertEquals("3 key fix 2 M0 columns", 2, params.mNumColumns); 356 assertEquals("3 key fix 2 M0 rows", 2, params.mNumRows); 357 assertEquals("3 key fix 2 M0 left", 0, params.mLeftKeys); 358 assertEquals("3 key fix 2 M0 right", 2, params.mRightKeys); 359 assertEquals("3 key fix 2 M0 <1>", 0, params.getColumnPos(0)); 360 assertEquals("3 key fix 2 M0 [2]", 1, params.getColumnPos(1)); 361 assertEquals("3 key fix 2 M0 [3]", 0, params.getColumnPos(2)); 362 assertEquals("3 key fix 2 M0 [4]", 1, params.getColumnPos(3)); 363 assertEquals("3 key fix 2 M0 adjust", 0, params.mTopRowAdjustment); 364 assertEquals("3 key fix 2 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 365 } 366 367 // |[3] [4] 368 // |<1> [2] 369 public void testLayout4KeyFix2L0() { 370 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L0); 371 assertEquals("3 key fix 2 L0 columns", 2, params.mNumColumns); 372 assertEquals("3 key fix 2 L0 rows", 2, params.mNumRows); 373 assertEquals("3 key fix 2 L0 left", 0, params.mLeftKeys); 374 assertEquals("3 key fix 2 L0 right", 2, params.mRightKeys); 375 assertEquals("3 key fix 2 L0 <1>", 0, params.getColumnPos(0)); 376 assertEquals("3 key fix 2 L0 [2]", 1, params.getColumnPos(1)); 377 assertEquals("3 key fix 2 L0 [3]", 0, params.getColumnPos(2)); 378 assertEquals("3 key fix 2 L0 [4]", 1, params.getColumnPos(3)); 379 assertEquals("3 key fix 2 L0 adjust", 0, params.mTopRowAdjustment); 380 assertEquals("3 key fix 2 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 381 } 382 383 // |___ [3] [4] 384 // |___ <1> [2] 385 public void testLayout4KeyFix2L1() { 386 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L1); 387 assertEquals("3 key fix 2 L1 columns", 2, params.mNumColumns); 388 assertEquals("3 key fix 2 L1 rows", 2, params.mNumRows); 389 assertEquals("3 key fix 2 L1 left", 0, params.mLeftKeys); 390 assertEquals("3 key fix 2 L1 right", 2, params.mRightKeys); 391 assertEquals("3 key fix 2 L1 <1>", 0, params.getColumnPos(0)); 392 assertEquals("3 key fix 2 L1 [2]", 1, params.getColumnPos(1)); 393 assertEquals("3 key fix 2 L1 [3]", 0, params.getColumnPos(2)); 394 assertEquals("3 key fix 2 L1 [4]", 1, params.getColumnPos(3)); 395 assertEquals("3 key fix 2 L1 adjust", 0, params.mTopRowAdjustment); 396 assertEquals("3 key fix 2 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 397 } 398 399 // | [3] [4] 400 // |___ ___ <1> [2] 401 public void testLayout4KeyFix2L2() { 402 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L2); 403 assertEquals("3 key fix 2 L2 columns", 2, params.mNumColumns); 404 assertEquals("3 key fix 2 L2 rows", 2, params.mNumRows); 405 assertEquals("3 key fix 2 L2 left", 0, params.mLeftKeys); 406 assertEquals("3 key fix 2 L2 right", 2, params.mRightKeys); 407 assertEquals("3 key fix 2 L2 <1>", 0, params.getColumnPos(0)); 408 assertEquals("3 key fix 2 L2 [2]", 1, params.getColumnPos(1)); 409 assertEquals("3 key fix 2 L2 [3]", 0, params.getColumnPos(2)); 410 assertEquals("3 key fix 2 L2 [4]", 1, params.getColumnPos(3)); 411 assertEquals("3 key fix 2 L2 adjust", 0, params.mTopRowAdjustment); 412 assertEquals("3 key fix 2 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 413 } 414 415 // [3] [4]| 416 // [1] <2>| 417 public void testLayout4KeyFix2R0() { 418 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R0); 419 assertEquals("3 key fix 2 R0 columns", 2, params.mNumColumns); 420 assertEquals("3 key fix 2 R0 rows", 2, params.mNumRows); 421 assertEquals("3 key fix 2 R0 left", 1, params.mLeftKeys); 422 assertEquals("3 key fix 2 R0 right", 1, params.mRightKeys); 423 assertEquals("3 key fix 2 R0 [1]", -1, params.getColumnPos(0)); 424 assertEquals("3 key fix 2 R0 <2>", 0, params.getColumnPos(1)); 425 assertEquals("3 key fix 2 R0 [3]", -1, params.getColumnPos(2)); 426 assertEquals("3 key fix 2 R0 [4]", 0, params.getColumnPos(3)); 427 assertEquals("3 key fix 2 R0 adjust", 0, params.mTopRowAdjustment); 428 assertEquals("3 key fix 2 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 429 } 430 431 // [3] [4] ___| 432 // [1] <2> ___| 433 public void testLayout4KeyFix2R1() { 434 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R1); 435 assertEquals("3 key fix 2 R1 columns", 2, params.mNumColumns); 436 assertEquals("3 key fix 2 R1 rows", 2, params.mNumRows); 437 assertEquals("3 key fix 2 R1 left", 1, params.mLeftKeys); 438 assertEquals("3 key fix 2 R1 right", 1, params.mRightKeys); 439 assertEquals("3 key fix 2 R1 [1]", -1, params.getColumnPos(0)); 440 assertEquals("3 key fix 2 R1 <2>", 0, params.getColumnPos(1)); 441 assertEquals("3 key fix 2 R1 [3]", -1, params.getColumnPos(2)); 442 assertEquals("3 key fix 2 R1 [4]", 0, params.getColumnPos(3)); 443 assertEquals("3 key fix 2 R1 adjust", 0, params.mTopRowAdjustment); 444 assertEquals("3 key fix 2 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 445 } 446 447 // [3] [4] ___| 448 // <1> [2] ___| 449 public void testLayout4KeyFix2R2() { 450 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R2); 451 assertEquals("3 key fix 2 R2 columns", 2, params.mNumColumns); 452 assertEquals("3 key fix 2 R2 rows", 2, params.mNumRows); 453 assertEquals("3 key fix 2 R2 left", 0, params.mLeftKeys); 454 assertEquals("3 key fix 2 R2 right", 2, params.mRightKeys); 455 assertEquals("3 key fix 2 R2 <1>", 0, params.getColumnPos(0)); 456 assertEquals("3 key fix 2 R2 [2]", 1, params.getColumnPos(1)); 457 assertEquals("3 key fix 2 R2 [3]", 0, params.getColumnPos(2)); 458 assertEquals("3 key fix 2 R2 [4]", 1, params.getColumnPos(3)); 459 assertEquals("3 key fix 2 R2 adjust", 0, params.mTopRowAdjustment); 460 assertEquals("3 key fix 2 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 461 } 462 463 // [1] <2> [3] 464 public void testLayout3KeyFix5M0() { 465 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_M0); 466 assertEquals("3 key fix 5 columns", 3, params.mNumColumns); 467 assertEquals("3 key fix 5 rows", 1, params.mNumRows); 468 assertEquals("3 key fix 5 left", 1, params.mLeftKeys); 469 assertEquals("3 key fix 5 right", 2, params.mRightKeys); 470 assertEquals("3 key fix 5 [1]", -1, params.getColumnPos(0)); 471 assertEquals("3 key fix 5 <2>", 0, params.getColumnPos(1)); 472 assertEquals("3 key fix 5 [3]", 1, params.getColumnPos(2)); 473 assertEquals("3 key fix 5 adjust", 0, params.mTopRowAdjustment); 474 assertEquals("3 key fix 5 default", WIDTH * 1, params.getDefaultKeyCoordX()); 475 } 476 477 // |<1> [2] [3] 478 public void testLayout3KeyFix5L0() { 479 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L0); 480 assertEquals("3 key fix 5 L0 columns", 3, params.mNumColumns); 481 assertEquals("3 key fix 5 L0 rows", 1, params.mNumRows); 482 assertEquals("3 key fix 5 L0 left", 0, params.mLeftKeys); 483 assertEquals("3 key fix 5 L0 right", 3, params.mRightKeys); 484 assertEquals("3 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 485 assertEquals("3 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 486 assertEquals("3 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 487 assertEquals("3 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 488 assertEquals("3 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 489 } 490 491 // |___ <1> [2] [3] 492 public void testLayout3KeyFix5L1() { 493 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L1); 494 assertEquals("3 key fix 5 L1 columns", 3, params.mNumColumns); 495 assertEquals("3 key fix 5 L1 rows", 1, params.mNumRows); 496 assertEquals("3 key fix 5 L1 left", 0, params.mLeftKeys); 497 assertEquals("3 key fix 5 L1 right", 3, params.mRightKeys); 498 assertEquals("3 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 499 assertEquals("3 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 500 assertEquals("3 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 501 assertEquals("3 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 502 assertEquals("3 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 503 } 504 505 // |___ [1] <2> [3] 506 public void testLayout3KeyFix5L2() { 507 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L2); 508 assertEquals("3 key fix 5 L2 columns", 3, params.mNumColumns); 509 assertEquals("3 key fix 5 L2 rows", 1, params.mNumRows); 510 assertEquals("3 key fix 5 L2 left", 1, params.mLeftKeys); 511 assertEquals("3 key fix 5 L2 right", 2, params.mRightKeys); 512 assertEquals("3 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 513 assertEquals("3 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 514 assertEquals("3 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 515 assertEquals("3 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 516 assertEquals("3 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 517 } 518 519 // [1] [2] <3>| 520 public void testLayout3KeyFix5R0() { 521 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R0); 522 assertEquals("3 key fix 5 R0 columns", 3, params.mNumColumns); 523 assertEquals("3 key fix 5 R0 rows", 1, params.mNumRows); 524 assertEquals("3 key fix 5 R0 left", 2, params.mLeftKeys); 525 assertEquals("3 key fix 5 R0 right", 1, params.mRightKeys); 526 assertEquals("3 key fix 5 R0 [1]", -2, params.getColumnPos(0)); 527 assertEquals("3 key fix 5 R0 [2]", -1, params.getColumnPos(1)); 528 assertEquals("3 key fix 5 R0 <3>", 0, params.getColumnPos(2)); 529 assertEquals("3 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 530 assertEquals("3 key fix 5 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 531 } 532 533 // [1] [2] <3> ___| 534 public void testLayout3KeyFix5R1() { 535 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R1); 536 assertEquals("3 key fix 5 R1 columns", 3, params.mNumColumns); 537 assertEquals("3 key fix 5 R1 rows", 1, params.mNumRows); 538 assertEquals("3 key fix 5 R1 left", 2, params.mLeftKeys); 539 assertEquals("3 key fix 5 R1 right", 1, params.mRightKeys); 540 assertEquals("3 key fix 5 R1 [1]", -2, params.getColumnPos(0)); 541 assertEquals("3 key fix 5 R1 [2]", -1, params.getColumnPos(1)); 542 assertEquals("3 key fix 5 R1 <3>", 0, params.getColumnPos(2)); 543 assertEquals("3 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 544 assertEquals("3 key fix 5 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 545 } 546 547 // [1] <2> [3] ___| 548 public void testLayout3KeyFix5R2() { 549 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R2); 550 assertEquals("3 key fix 5 R2 columns", 3, params.mNumColumns); 551 assertEquals("3 key fix 5 R2 rows", 1, params.mNumRows); 552 assertEquals("3 key fix 5 R2 left", 1, params.mLeftKeys); 553 assertEquals("3 key fix 5 R2 right", 2, params.mRightKeys); 554 assertEquals("3 key fix 5 R2 [1]", -1, params.getColumnPos(0)); 555 assertEquals("3 key fix 5 R2 <2>", 0, params.getColumnPos(1)); 556 assertEquals("3 key fix 5 R2 [3]", 1, params.getColumnPos(2)); 557 assertEquals("3 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 558 assertEquals("3 key fix 5 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 559 } 560 561 // [4] 562 // [1] <2> [3] 563 public void testLayout4KeyFix3M0() { 564 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_M0); 565 assertEquals("4 key fix 3 M0 columns", 3, params.mNumColumns); 566 assertEquals("4 key fix 3 M0 rows", 2, params.mNumRows); 567 assertEquals("4 key fix 3 M0 left", 1, params.mLeftKeys); 568 assertEquals("4 key fix 3 M0 right", 2, params.mRightKeys); 569 assertEquals("4 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 570 assertEquals("4 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 571 assertEquals("4 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 572 assertEquals("4 key fix 3 M0 [4]", 0, params.getColumnPos(3)); 573 assertEquals("4 key fix 3 M0 adjust", 0, params.mTopRowAdjustment); 574 assertEquals("4 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 575 } 576 577 // |[4] 578 // |<1> [2] [3] 579 public void testLayout4KeyFix3L0() { 580 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L0); 581 assertEquals("4 key fix 3 L0 columns", 3, params.mNumColumns); 582 assertEquals("4 key fix 3 L0 rows", 2, params.mNumRows); 583 assertEquals("4 key fix 3 L0 left", 0, params.mLeftKeys); 584 assertEquals("4 key fix 3 L0 right", 3, params.mRightKeys); 585 assertEquals("4 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 586 assertEquals("4 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 587 assertEquals("4 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 588 assertEquals("4 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 589 assertEquals("4 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 590 assertEquals("4 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 591 } 592 593 // |___ [4] 594 // |___ <1> [2] [3] 595 public void testLayout4KeyFix3L1() { 596 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L1); 597 assertEquals("4 key fix 3 L1 columns", 3, params.mNumColumns); 598 assertEquals("4 key fix 3 L1 rows", 2, params.mNumRows); 599 assertEquals("4 key fix 3 L1 left", 0, params.mLeftKeys); 600 assertEquals("4 key fix 3 L1 right", 3, params.mRightKeys); 601 assertEquals("4 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 602 assertEquals("4 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 603 assertEquals("4 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 604 assertEquals("4 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 605 assertEquals("4 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 606 assertEquals("4 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 607 } 608 609 // |___ ___ [4] 610 // |___ ___ [1] <2> [3] 611 public void testLayout4KeyFix3L2() { 612 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L2); 613 assertEquals("4 key fix 3 L2 columns", 3, params.mNumColumns); 614 assertEquals("4 key fix 3 L2 rows", 2, params.mNumRows); 615 assertEquals("4 key fix 3 L2 left", 1, params.mLeftKeys); 616 assertEquals("4 key fix 3 L2 right", 2, params.mRightKeys); 617 assertEquals("4 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 618 assertEquals("4 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 619 assertEquals("4 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 620 assertEquals("4 key fix 3 L2 [4]", 0, params.getColumnPos(3)); 621 assertEquals("4 key fix 3 L2 adjust", 0, params.mTopRowAdjustment); 622 assertEquals("4 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 623 } 624 625 // [4]| 626 // [1] [2] <3>| 627 public void testLayout4KeyFix3R0() { 628 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R0); 629 assertEquals("4 key fix 3 R0 columns", 3, params.mNumColumns); 630 assertEquals("4 key fix 3 R0 rows", 2, params.mNumRows); 631 assertEquals("4 key fix 3 R0 left", 2, params.mLeftKeys); 632 assertEquals("4 key fix 3 R0 right", 1, params.mRightKeys); 633 assertEquals("4 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 634 assertEquals("4 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 635 assertEquals("4 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 636 assertEquals("4 key fix 3 R0 [4]", 0, params.getColumnPos(3)); 637 assertEquals("4 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 638 assertEquals("4 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 639 } 640 641 // [4] ___| 642 // [1] [2] <3> ___| 643 public void testLayout4KeyFix3R1() { 644 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R1); 645 assertEquals("4 key fix 3 R1 columns", 3, params.mNumColumns); 646 assertEquals("4 key fix 3 R1 rows", 2, params.mNumRows); 647 assertEquals("4 key fix 3 R1 left", 2, params.mLeftKeys); 648 assertEquals("4 key fix 3 R1 right", 1, params.mRightKeys); 649 assertEquals("4 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 650 assertEquals("4 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 651 assertEquals("4 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 652 assertEquals("4 key fix 3 R1 [4]", 0, params.getColumnPos(3)); 653 assertEquals("4 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 654 assertEquals("4 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 655 } 656 657 // [4] ___| 658 // [1] <2> [3] ___| 659 public void testLayout4KeyFix3R2() { 660 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R2); 661 assertEquals("4 key fix 3 R2 columns", 3, params.mNumColumns); 662 assertEquals("4 key fix 3 R2 rows", 2, params.mNumRows); 663 assertEquals("4 key fix 3 R2 left", 1, params.mLeftKeys); 664 assertEquals("4 key fix 3 R2 right", 2, params.mRightKeys); 665 assertEquals("4 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 666 assertEquals("4 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 667 assertEquals("4 key fix 3 R2 [3]", 1, params.getColumnPos(2)); 668 assertEquals("4 key fix 3 R2 [4]", 0, params.getColumnPos(3)); 669 assertEquals("4 key fix 3 R2 adjust", 0, params.mTopRowAdjustment); 670 assertEquals("4 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 671 } 672 673 // [4] [5] 674 // [1] <2> [3] 675 public void testLayout5KeyFix3M0() { 676 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_M0); 677 assertEquals("5 key fix 3 M0 columns", 3, params.mNumColumns); 678 assertEquals("5 key fix 3 M0 rows", 2, params.mNumRows); 679 assertEquals("5 key fix 3 M0 left", 1, params.mLeftKeys); 680 assertEquals("5 key fix 3 M0 right", 2, params.mRightKeys); 681 assertEquals("5 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 682 assertEquals("5 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 683 assertEquals("5 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 684 assertEquals("5 key fix 3 M0 [4]", 0, params.getColumnPos(3)); 685 assertEquals("5 key fix 3 M0 [5]", 1, params.getColumnPos(4)); 686 assertEquals("5 key fix 3 M0 adjust", -1, params.mTopRowAdjustment); 687 assertEquals("5 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 688 } 689 690 // |[4] [5] 691 // |<1> [2] [3] 692 public void testLayout5KeyFix3L0() { 693 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L0); 694 assertEquals("5 key fix 3 L0 columns", 3, params.mNumColumns); 695 assertEquals("5 key fix 3 L0 rows", 2, params.mNumRows); 696 assertEquals("5 key fix 3 L0 left", 0, params.mLeftKeys); 697 assertEquals("5 key fix 3 L0 right", 3, params.mRightKeys); 698 assertEquals("5 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 699 assertEquals("5 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 700 assertEquals("5 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 701 assertEquals("5 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 702 assertEquals("5 key fix 3 L0 [5]", 1, params.getColumnPos(4)); 703 assertEquals("5 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 704 assertEquals("5 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 705 } 706 707 // |___ [4] [5] 708 // |___ <1> [2] [3] 709 public void testLayout5KeyFix3L1() { 710 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L1); 711 assertEquals("5 key fix 3 L1 columns", 3, params.mNumColumns); 712 assertEquals("5 key fix 3 L1 rows", 2, params.mNumRows); 713 assertEquals("5 key fix 3 L1 left", 0, params.mLeftKeys); 714 assertEquals("5 key fix 3 L1 right", 3, params.mRightKeys); 715 assertEquals("5 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 716 assertEquals("5 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 717 assertEquals("5 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 718 assertEquals("5 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 719 assertEquals("5 key fix 3 L1 [5]", 1, params.getColumnPos(4)); 720 assertEquals("5 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 721 assertEquals("5 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 722 } 723 724 // |___ [4] [5] 725 // |___ [1] <2> [3] 726 public void testLayout5KeyFix3L2() { 727 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L2); 728 assertEquals("5 key fix 3 L2 columns", 3, params.mNumColumns); 729 assertEquals("5 key fix 3 L2 rows", 2, params.mNumRows); 730 assertEquals("5 key fix 3 L2 left", 1, params.mLeftKeys); 731 assertEquals("5 key fix 3 L2 right", 2, params.mRightKeys); 732 assertEquals("5 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 733 assertEquals("5 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 734 assertEquals("5 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 735 assertEquals("5 key fix 3 L2 [4]", 0, params.getColumnPos(3)); 736 assertEquals("5 key fix 3 L2 [5]", 1, params.getColumnPos(4)); 737 assertEquals("5 key fix 3 L2 adjust", -1, params.mTopRowAdjustment); 738 assertEquals("5 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 739 } 740 741 // [4] [5]| 742 // [1] [2] <3>| 743 public void testLayout5KeyFix3R0() { 744 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R0); 745 assertEquals("5 key fix 3 R0 columns", 3, params.mNumColumns); 746 assertEquals("5 key fix 3 R0 rows", 2, params.mNumRows); 747 assertEquals("5 key fix 3 R0 left", 2, params.mLeftKeys); 748 assertEquals("5 key fix 3 R0 right", 1, params.mRightKeys); 749 assertEquals("5 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 750 assertEquals("5 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 751 assertEquals("5 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 752 assertEquals("5 key fix 3 R0 [4]", -1, params.getColumnPos(3)); 753 assertEquals("5 key fix 3 R0 [5]", 0, params.getColumnPos(4)); 754 assertEquals("5 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 755 assertEquals("5 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 756 } 757 758 // [4] [5] ___| 759 // [1] [2] <3> ___| 760 public void testLayout5KeyFix3R1() { 761 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R1); 762 assertEquals("5 key fix 3 R1 columns", 3, params.mNumColumns); 763 assertEquals("5 key fix 3 R1 rows", 2, params.mNumRows); 764 assertEquals("5 key fix 3 R1 left", 2, params.mLeftKeys); 765 assertEquals("5 key fix 3 R1 right", 1, params.mRightKeys); 766 assertEquals("5 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 767 assertEquals("5 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 768 assertEquals("5 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 769 assertEquals("5 key fix 3 R1 [4]", -1, params.getColumnPos(3)); 770 assertEquals("5 key fix 3 R1 [5]", 0, params.getColumnPos(4)); 771 assertEquals("5 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 772 assertEquals("5 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 773 } 774 775 // [4] [5] ___| 776 // [1] <2> [3] ___| 777 public void testLayout5KeyFix3R2() { 778 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R2); 779 assertEquals("5 key fix 3 R2 columns", 3, params.mNumColumns); 780 assertEquals("5 key fix 3 R2 rows", 2, params.mNumRows); 781 assertEquals("5 key fix 3 R2 left", 1, params.mLeftKeys); 782 assertEquals("5 key fix 3 R2 right", 2, params.mRightKeys); 783 assertEquals("5 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 784 assertEquals("5 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 785 assertEquals("5 key fix 3 R2 [3]", 1, params.getColumnPos(2)); 786 assertEquals("5 key fix 3 R2 [4]", 0, params.getColumnPos(3)); 787 assertEquals("5 key fix 3 R2 [5]", 1, params.getColumnPos(4)); 788 assertEquals("5 key fix 3 R2 adjust", -1, params.mTopRowAdjustment); 789 assertEquals("5 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 790 } 791 792 // [4] [5] [6] 793 // [1] <2> [3] 794 public void testLayout6KeyFix3M0() { 795 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_M0); 796 assertEquals("6 key fix 3 M0 columns", 3, params.mNumColumns); 797 assertEquals("6 key fix 3 M0 rows", 2, params.mNumRows); 798 assertEquals("6 key fix 3 M0 left", 1, params.mLeftKeys); 799 assertEquals("6 key fix 3 M0 right", 2, params.mRightKeys); 800 assertEquals("6 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 801 assertEquals("6 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 802 assertEquals("6 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 803 assertEquals("6 key fix 3 M0 [4]", -1, params.getColumnPos(3)); 804 assertEquals("6 key fix 3 M0 [5]", 0, params.getColumnPos(4)); 805 assertEquals("6 key fix 3 M0 [6]", 1, params.getColumnPos(5)); 806 assertEquals("6 key fix 3 M0 adjust", 0, params.mTopRowAdjustment); 807 assertEquals("6 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 808 } 809 810 // |[4] [5] [6] 811 // |<1> [2] [3] 812 public void testLayout6KeyFix3L0() { 813 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L0); 814 assertEquals("6 key fix 3 L0 columns", 3, params.mNumColumns); 815 assertEquals("6 key fix 3 L0 rows", 2, params.mNumRows); 816 assertEquals("6 key fix 3 L0 left", 0, params.mLeftKeys); 817 assertEquals("6 key fix 3 L0 right", 3, params.mRightKeys); 818 assertEquals("6 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 819 assertEquals("6 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 820 assertEquals("6 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 821 assertEquals("6 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 822 assertEquals("6 key fix 3 L0 [5]", 1, params.getColumnPos(4)); 823 assertEquals("6 key fix 3 L0 [6]", 2, params.getColumnPos(5)); 824 assertEquals("6 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 825 assertEquals("6 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 826 } 827 828 // |___ [4] [5] [6] 829 // |___ <1> [2] [3] 830 public void testLayout6KeyFix3L1() { 831 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L1); 832 assertEquals("6 key fix 3 L1 columns", 3, params.mNumColumns); 833 assertEquals("6 key fix 3 L1 rows", 2, params.mNumRows); 834 assertEquals("6 key fix 3 L1 left", 0, params.mLeftKeys); 835 assertEquals("6 key fix 3 L1 right", 3, params.mRightKeys); 836 assertEquals("6 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 837 assertEquals("6 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 838 assertEquals("6 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 839 assertEquals("6 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 840 assertEquals("6 key fix 3 L1 [5]", 1, params.getColumnPos(4)); 841 assertEquals("6 key fix 3 L1 [6]", 2, params.getColumnPos(5)); 842 assertEquals("6 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 843 assertEquals("6 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 844 } 845 846 // |___ [4] [5] [6] 847 // |___ [1] <2> [3] 848 public void testLayout6KeyFix3L2() { 849 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L2); 850 assertEquals("6 key fix 3 L2 columns", 3, params.mNumColumns); 851 assertEquals("6 key fix 3 L2 rows", 2, params.mNumRows); 852 assertEquals("6 key fix 3 L2 left", 1, params.mLeftKeys); 853 assertEquals("6 key fix 3 L2 right", 2, params.mRightKeys); 854 assertEquals("6 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 855 assertEquals("6 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 856 assertEquals("6 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 857 assertEquals("6 key fix 3 L2 [4]", -1, params.getColumnPos(3)); 858 assertEquals("6 key fix 3 L2 [5]", 0, params.getColumnPos(4)); 859 assertEquals("6 key fix 3 L2 [6]", 1, params.getColumnPos(5)); 860 assertEquals("6 key fix 3 L2 adjust", 0, params.mTopRowAdjustment); 861 assertEquals("6 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 862 } 863 864 // [4] [5] [6]| 865 // [1] [2] <3>| 866 public void testLayout6KeyFix3R0() { 867 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R0); 868 assertEquals("6 key fix 3 R0 columns", 3, params.mNumColumns); 869 assertEquals("6 key fix 3 R0 rows", 2, params.mNumRows); 870 assertEquals("6 key fix 3 R0 left", 2, params.mLeftKeys); 871 assertEquals("6 key fix 3 R0 right", 1, params.mRightKeys); 872 assertEquals("6 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 873 assertEquals("6 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 874 assertEquals("6 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 875 assertEquals("6 key fix 3 R0 [4]", -2, params.getColumnPos(3)); 876 assertEquals("6 key fix 3 R0 [5]", -1, params.getColumnPos(4)); 877 assertEquals("6 key fix 3 R0 [6]", 0, params.getColumnPos(5)); 878 assertEquals("6 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 879 assertEquals("6 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 880 } 881 882 // [4] [5] [6] ___| 883 // [1] [2] <3> ___| 884 public void testLayout6KeyFix3R1() { 885 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R1); 886 assertEquals("6 key fix 3 R1 columns", 3, params.mNumColumns); 887 assertEquals("6 key fix 3 R1 rows", 2, params.mNumRows); 888 assertEquals("6 key fix 3 R1 left", 2, params.mLeftKeys); 889 assertEquals("6 key fix 3 R1 right", 1, params.mRightKeys); 890 assertEquals("6 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 891 assertEquals("6 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 892 assertEquals("6 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 893 assertEquals("6 key fix 3 R1 [4]", -2, params.getColumnPos(3)); 894 assertEquals("6 key fix 3 R1 [5]", -1, params.getColumnPos(4)); 895 assertEquals("6 key fix 3 R1 [6]", 0, params.getColumnPos(5)); 896 assertEquals("6 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 897 assertEquals("6 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 898 } 899 900 // [4] [5] [6] ___| 901 // [1] <2> [3] ___| 902 public void testLayout6KeyFix3R2() { 903 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R2); 904 assertEquals("6 key fix 3 R2 columns", 3, params.mNumColumns); 905 assertEquals("6 key fix 3 R2 rows", 2, params.mNumRows); 906 assertEquals("6 key fix 3 R2 left", 1, params.mLeftKeys); 907 assertEquals("6 key fix 3 R2 right", 2, params.mRightKeys); 908 assertEquals("6 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 909 assertEquals("6 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 910 assertEquals("6 key fix 3 R2 [1]", 1, params.getColumnPos(2)); 911 assertEquals("6 key fix 3 R2 [4]", -1, params.getColumnPos(3)); 912 assertEquals("6 key fix 3 R2 [5]", 0, params.getColumnPos(4)); 913 assertEquals("6 key fix 3 R2 [6]", 1, params.getColumnPos(5)); 914 assertEquals("6 key fix 3 R2 adjust", 0, params.mTopRowAdjustment); 915 assertEquals("6 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 916 } 917 918 // <1> [2] [3] [4] 919 public void testLayout4KeyFix5M0() { 920 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_M0); 921 assertEquals("4 key fix 5 columns", 4, params.mNumColumns); 922 assertEquals("4 key fix 5 rows", 1, params.mNumRows); 923 assertEquals("4 key fix 5 left", 1, params.mLeftKeys); 924 assertEquals("4 key fix 5 right", 3, params.mRightKeys); 925 assertEquals("4 key fix 5 <1>", -1, params.getColumnPos(0)); 926 assertEquals("4 key fix 5 [2]", 0, params.getColumnPos(1)); 927 assertEquals("4 key fix 5 [3]", 1, params.getColumnPos(2)); 928 assertEquals("4 key fix 5 [4]", 2, params.getColumnPos(3)); 929 assertEquals("4 key fix 5 adjust", 0, params.mTopRowAdjustment); 930 assertEquals("4 key fix 5 default", WIDTH * 1, params.getDefaultKeyCoordX()); 931 } 932 933 // |<1> [2] [3] [4] 934 public void testLayout4KeyFix5L0() { 935 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L0); 936 assertEquals("4 key fix 5 L0 columns", 4, params.mNumColumns); 937 assertEquals("4 key fix 5 L0 rows", 1, params.mNumRows); 938 assertEquals("4 key fix 5 L0 left", 0, params.mLeftKeys); 939 assertEquals("4 key fix 5 L0 right", 4, params.mRightKeys); 940 assertEquals("4 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 941 assertEquals("4 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 942 assertEquals("4 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 943 assertEquals("4 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 944 assertEquals("4 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 945 assertEquals("4 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 946 } 947 948 // |___ <1> [2] [3] [4] 949 public void testLayout4KeyFix5L1() { 950 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L1); 951 assertEquals("4 key fix 5 L1 columns", 4, params.mNumColumns); 952 assertEquals("4 key fix 5 L1 rows", 1, params.mNumRows); 953 assertEquals("4 key fix 5 L1 left", 0, params.mLeftKeys); 954 assertEquals("4 key fix 5 L1 right", 4, params.mRightKeys); 955 assertEquals("4 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 956 assertEquals("4 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 957 assertEquals("4 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 958 assertEquals("4 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 959 assertEquals("4 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 960 assertEquals("4 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 961 } 962 963 // |___ [1] <2> [3] [4] 964 public void testLayout4KeyFix5L2() { 965 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L2); 966 assertEquals("4 key fix 5 L2 columns", 4, params.mNumColumns); 967 assertEquals("4 key fix 5 L2 rows", 1, params.mNumRows); 968 assertEquals("4 key fix 5 L2 left", 1, params.mLeftKeys); 969 assertEquals("4 key fix 5 L2 right", 3, params.mRightKeys); 970 assertEquals("4 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 971 assertEquals("4 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 972 assertEquals("4 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 973 assertEquals("4 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 974 assertEquals("4 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 975 assertEquals("4 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 976 } 977 978 // [1] [2] [3] <4>| 979 public void testLayout4KeyFix5R0() { 980 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R0); 981 assertEquals("4 key fix 5 R0 columns", 4, params.mNumColumns); 982 assertEquals("4 key fix 5 R0 rows", 1, params.mNumRows); 983 assertEquals("4 key fix 5 R0 left", 3, params.mLeftKeys); 984 assertEquals("4 key fix 5 R0 right", 1, params.mRightKeys); 985 assertEquals("4 key fix 5 R0 [1]", -3, params.getColumnPos(0)); 986 assertEquals("4 key fix 5 R0 [2]", -2, params.getColumnPos(1)); 987 assertEquals("4 key fix 5 R0 [3]", -1, params.getColumnPos(2)); 988 assertEquals("4 key fix 5 R0 <4>", 0, params.getColumnPos(3)); 989 assertEquals("4 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 990 assertEquals("4 key fix 5 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 991 } 992 993 // [1] [2] [3] <4> ___| 994 public void testLayout4KeyFix5R1() { 995 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R1); 996 assertEquals("4 key fix 5 R1 columns", 4, params.mNumColumns); 997 assertEquals("4 key fix 5 R1 rows", 1, params.mNumRows); 998 assertEquals("4 key fix 5 R1 left", 3, params.mLeftKeys); 999 assertEquals("4 key fix 5 R1 right", 1, params.mRightKeys); 1000 assertEquals("4 key fix 5 R1 [1]", -3, params.getColumnPos(0)); 1001 assertEquals("4 key fix 5 R1 [2]", -2, params.getColumnPos(1)); 1002 assertEquals("4 key fix 5 R1 [3]", -1, params.getColumnPos(2)); 1003 assertEquals("4 key fix 5 R1 <4>", 0, params.getColumnPos(3)); 1004 assertEquals("4 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1005 assertEquals("4 key fix 5 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1006 } 1007 1008 // [1] [2] <3> [4] ___| 1009 public void testLayout4KeyFix5R2() { 1010 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R2); 1011 assertEquals("4 key fix 5 R2 columns", 4, params.mNumColumns); 1012 assertEquals("4 key fix 5 R2 rows", 1, params.mNumRows); 1013 assertEquals("4 key fix 5 R2 left", 2, params.mLeftKeys); 1014 assertEquals("4 key fix 5 R2 right", 2, params.mRightKeys); 1015 assertEquals("4 key fix 5 R2 [1]", -2, params.getColumnPos(0)); 1016 assertEquals("4 key fix 5 R2 [2]", -1, params.getColumnPos(1)); 1017 assertEquals("4 key fix 5 R2 <3>", 0, params.getColumnPos(2)); 1018 assertEquals("4 key fix 5 R2 [4]", 1, params.getColumnPos(3)); 1019 assertEquals("4 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1020 assertEquals("4 key fix 5 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1021 } 1022 1023 // [5] 1024 // [1] <2> [3] [4] 1025 public void testLayout5KeyFix4M0() { 1026 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_M0); 1027 assertEquals("5 key fix 4 M0 columns", 4, params.mNumColumns); 1028 assertEquals("5 key fix 4 M0 rows", 2, params.mNumRows); 1029 assertEquals("5 key fix 4 M0 left", 1, params.mLeftKeys); 1030 assertEquals("5 key fix 4 M0 right", 3, params.mRightKeys); 1031 assertEquals("5 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1032 assertEquals("5 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1033 assertEquals("5 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1034 assertEquals("5 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1035 assertEquals("5 key fix 4 M0 [5]", 0, params.getColumnPos(4)); 1036 assertEquals("5 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1037 assertEquals("5 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1038 } 1039 1040 // |[5] 1041 // |<1> [2] [3] [4] 1042 public void testLayout5KeyFix4L0() { 1043 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L0); 1044 assertEquals("5 key fix 4 L0 columns", 4, params.mNumColumns); 1045 assertEquals("5 key fix 4 L0 rows", 2, params.mNumRows); 1046 assertEquals("5 key fix 4 L0 left", 0, params.mLeftKeys); 1047 assertEquals("5 key fix 4 L0 right", 4, params.mRightKeys); 1048 assertEquals("5 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1049 assertEquals("5 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1050 assertEquals("5 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1051 assertEquals("5 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1052 assertEquals("5 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1053 assertEquals("5 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1054 assertEquals("5 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1055 } 1056 1057 // |___ [5] 1058 // |___ <1> [2] [3] [4] 1059 public void testLayout5KeyFix4L1() { 1060 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L1); 1061 assertEquals("5 key fix 4 L1 columns", 4, params.mNumColumns); 1062 assertEquals("5 key fix 4 L1 rows", 2, params.mNumRows); 1063 assertEquals("5 key fix 4 L1 left", 0, params.mLeftKeys); 1064 assertEquals("5 key fix 4 L1 right", 4, params.mRightKeys); 1065 assertEquals("5 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1066 assertEquals("5 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1067 assertEquals("5 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1068 assertEquals("5 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1069 assertEquals("5 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1070 assertEquals("5 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1071 assertEquals("5 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1072 } 1073 1074 // |___ [5] 1075 // |___ [1] <2> [3] [4] 1076 public void testLayout5KeyFix4L2() { 1077 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L2); 1078 assertEquals("5 key fix 4 L2 columns", 4, params.mNumColumns); 1079 assertEquals("5 key fix 4 L2 rows", 2, params.mNumRows); 1080 assertEquals("5 key fix 4 L2 left", 1, params.mLeftKeys); 1081 assertEquals("5 key fix 4 L2 right", 3, params.mRightKeys); 1082 assertEquals("5 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1083 assertEquals("5 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1084 assertEquals("5 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1085 assertEquals("5 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1086 assertEquals("5 key fix 4 L2 [5]", 0, params.getColumnPos(4)); 1087 assertEquals("5 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1088 assertEquals("5 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1089 } 1090 1091 // [5]| 1092 // [1] [2] [3] <4>| 1093 public void testLayout5KeyFix4R0() { 1094 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R0); 1095 assertEquals("5 key fix 4 R0 columns", 4, params.mNumColumns); 1096 assertEquals("5 key fix 4 R0 rows", 2, params.mNumRows); 1097 assertEquals("5 key fix 4 R0 left", 3, params.mLeftKeys); 1098 assertEquals("5 key fix 4 R0 right", 1, params.mRightKeys); 1099 assertEquals("5 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1100 assertEquals("5 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1101 assertEquals("5 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1102 assertEquals("5 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1103 assertEquals("5 key fix 4 R0 [5]", 0, params.getColumnPos(4)); 1104 assertEquals("5 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1105 assertEquals("5 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1106 } 1107 1108 // [5] ___| 1109 // [1] [2] [3] <4> ___| 1110 public void testLayout5KeyFix4R1() { 1111 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R1); 1112 assertEquals("5 key fix 4 R1 columns", 4, params.mNumColumns); 1113 assertEquals("5 key fix 4 R1 rows", 2, params.mNumRows); 1114 assertEquals("5 key fix 4 R1 left", 3, params.mLeftKeys); 1115 assertEquals("5 key fix 4 R1 right", 1, params.mRightKeys); 1116 assertEquals("5 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1117 assertEquals("5 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1118 assertEquals("5 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1119 assertEquals("5 key fix 4 R1 [4]", 0, params.getColumnPos(3)); 1120 assertEquals("5 key fix 4 R1 [5]", 0, params.getColumnPos(4)); 1121 assertEquals("5 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1122 assertEquals("5 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1123 } 1124 1125 // [5] ___| 1126 // [1] [2] <3> [4] ___| 1127 public void testLayout5KeyFix4R2() { 1128 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R2); 1129 assertEquals("5 key fix 4 R2 columns", 4, params.mNumColumns); 1130 assertEquals("5 key fix 4 R2 rows", 2, params.mNumRows); 1131 assertEquals("5 key fix 4 R2 left", 2, params.mLeftKeys); 1132 assertEquals("5 key fix 4 R2 right", 2, params.mRightKeys); 1133 assertEquals("5 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1134 assertEquals("5 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1135 assertEquals("5 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1136 assertEquals("5 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1137 assertEquals("5 key fix 4 R2 [5]", 0, params.getColumnPos(4)); 1138 assertEquals("5 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1139 assertEquals("5 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1140 } 1141 1142 // [5] [6] 1143 // [1] <2> [3] [4] 1144 public void testLayout6KeyFix4M0() { 1145 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_M0); 1146 assertEquals("6 key fix 4 M0 columns", 4, params.mNumColumns); 1147 assertEquals("6 key fix 4 M0 rows", 2, params.mNumRows); 1148 assertEquals("6 key fix 4 M0 left", 1, params.mLeftKeys); 1149 assertEquals("6 key fix 4 M0 right", 3, params.mRightKeys); 1150 assertEquals("6 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1151 assertEquals("6 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1152 assertEquals("6 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1153 assertEquals("6 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1154 assertEquals("6 key fix 4 M0 [5]", 0, params.getColumnPos(4)); 1155 assertEquals("6 key fix 4 M0 [6]", 1, params.getColumnPos(5)); 1156 assertEquals("6 key fix 4 M0 adjust", -1, params.mTopRowAdjustment); 1157 assertEquals("6 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1158 } 1159 1160 // |[5] [6] 1161 // |<1> [2] [3] [4] 1162 public void testLayout6KeyFix4L0() { 1163 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L0); 1164 assertEquals("6 key fix 4 L0 columns", 4, params.mNumColumns); 1165 assertEquals("6 key fix 4 L0 rows", 2, params.mNumRows); 1166 assertEquals("6 key fix 4 L0 left", 0, params.mLeftKeys); 1167 assertEquals("6 key fix 4 L0 right", 4, params.mRightKeys); 1168 assertEquals("6 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1169 assertEquals("6 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1170 assertEquals("6 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1171 assertEquals("6 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1172 assertEquals("6 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1173 assertEquals("6 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1174 assertEquals("6 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1175 assertEquals("6 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1176 } 1177 1178 // |___ [5] [6] 1179 // |___ <1> [2] [3] [4] 1180 public void testLayout6KeyFix4L1() { 1181 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L1); 1182 assertEquals("6 key fix 4 L1 columns", 4, params.mNumColumns); 1183 assertEquals("6 key fix 4 L1 rows", 2, params.mNumRows); 1184 assertEquals("6 key fix 4 L1 left", 0, params.mLeftKeys); 1185 assertEquals("6 key fix 4 L1 right", 4, params.mRightKeys); 1186 assertEquals("6 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1187 assertEquals("6 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1188 assertEquals("6 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1189 assertEquals("6 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1190 assertEquals("6 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1191 assertEquals("6 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1192 assertEquals("6 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1193 assertEquals("6 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1194 } 1195 1196 // |___ [5] [6] 1197 // |___ [1] <2> [3] [4] 1198 public void testLayout6KeyFix4L2() { 1199 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L2); 1200 assertEquals("6 key fix 4 L2 columns", 4, params.mNumColumns); 1201 assertEquals("6 key fix 4 L2 rows", 2, params.mNumRows); 1202 assertEquals("6 key fix 4 L2 left", 1, params.mLeftKeys); 1203 assertEquals("6 key fix 4 L2 right", 3, params.mRightKeys); 1204 assertEquals("6 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1205 assertEquals("6 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1206 assertEquals("6 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1207 assertEquals("6 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1208 assertEquals("6 key fix 4 L2 [5]", 0, params.getColumnPos(4)); 1209 assertEquals("6 key fix 4 L2 [6]", 1, params.getColumnPos(5)); 1210 assertEquals("6 key fix 4 L2 adjust", -1, params.mTopRowAdjustment); 1211 assertEquals("6 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1212 } 1213 1214 // [5] [6]| 1215 // [1] [2] [3] <4>| 1216 public void testLayout6KeyFix4R0() { 1217 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R0); 1218 assertEquals("6 key fix 4 R0 columns", 4, params.mNumColumns); 1219 assertEquals("6 key fix 4 R0 rows", 2, params.mNumRows); 1220 assertEquals("6 key fix 4 R0 left", 3, params.mLeftKeys); 1221 assertEquals("6 key fix 4 R0 right", 1, params.mRightKeys); 1222 assertEquals("6 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1223 assertEquals("6 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1224 assertEquals("6 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1225 assertEquals("6 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1226 assertEquals("6 key fix 4 R0 [5]", -1, params.getColumnPos(4)); 1227 assertEquals("6 key fix 4 R0 [6]", 0, params.getColumnPos(5)); 1228 assertEquals("6 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1229 assertEquals("6 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1230 } 1231 1232 // [5] [6] ___| 1233 // [1] [2] [3] <4> ___| 1234 public void testLayout6KeyFix4R1() { 1235 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R1); 1236 assertEquals("6 key fix 4 R1 columns", 4, params.mNumColumns); 1237 assertEquals("6 key fix 4 R1 rows", 2, params.mNumRows); 1238 assertEquals("6 key fix 4 R1 left", 3, params.mLeftKeys); 1239 assertEquals("6 key fix 4 R1 right", 1, params.mRightKeys); 1240 assertEquals("6 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1241 assertEquals("6 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1242 assertEquals("6 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1243 assertEquals("6 key fix 4 R1 [4]", 0, params.getColumnPos(3)); 1244 assertEquals("6 key fix 4 R1 [5]", -1, params.getColumnPos(4)); 1245 assertEquals("6 key fix 4 R1 [6]", 0, params.getColumnPos(5)); 1246 assertEquals("6 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1247 assertEquals("6 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1248 } 1249 1250 // [5] [6] ___| 1251 // [1] [2] <3> [4] ___| 1252 public void testLayout6KeyFix4R2() { 1253 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R2); 1254 assertEquals("6 key fix 4 R2 columns", 4, params.mNumColumns); 1255 assertEquals("6 key fix 4 R2 rows", 2, params.mNumRows); 1256 assertEquals("6 key fix 4 R2 left", 2, params.mLeftKeys); 1257 assertEquals("6 key fix 4 R2 right", 2, params.mRightKeys); 1258 assertEquals("6 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1259 assertEquals("6 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1260 assertEquals("6 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1261 assertEquals("6 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1262 assertEquals("6 key fix 4 R2 [5]", 0, params.getColumnPos(4)); 1263 assertEquals("6 key fix 4 R2 [6]", 1, params.getColumnPos(5)); 1264 assertEquals("6 key fix 4 R2 adjust", -1, params.mTopRowAdjustment); 1265 assertEquals("6 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1266 } 1267 1268 // [5] [6] [7] 1269 // [1] <2> [3] [4] 1270 public void testLayout7KeyFix4M0() { 1271 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_M0); 1272 assertEquals("7 key fix 4 M0 columns", 4, params.mNumColumns); 1273 assertEquals("7 key fix 4 M0 rows", 2, params.mNumRows); 1274 assertEquals("7 key fix 4 M0 left", 1, params.mLeftKeys); 1275 assertEquals("7 key fix 4 M0 right", 3, params.mRightKeys); 1276 assertEquals("7 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1277 assertEquals("7 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1278 assertEquals("7 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1279 assertEquals("7 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1280 assertEquals("7 key fix 4 M0 [5]", -1, params.getColumnPos(4)); 1281 assertEquals("7 key fix 4 M0 [6]", 0, params.getColumnPos(5)); 1282 assertEquals("7 key fix 4 M0 [7]", 1, params.getColumnPos(6)); 1283 assertEquals("7 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1284 assertEquals("7 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1285 } 1286 1287 // |[5] [6] [7] 1288 // |<1> [2] [3] [4] 1289 public void testLayout7KeyFix4L0() { 1290 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L0); 1291 assertEquals("7 key fix 4 L0 columns", 4, params.mNumColumns); 1292 assertEquals("7 key fix 4 L0 rows", 2, params.mNumRows); 1293 assertEquals("7 key fix 4 L0 left", 0, params.mLeftKeys); 1294 assertEquals("7 key fix 4 L0 right", 4, params.mRightKeys); 1295 assertEquals("7 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1296 assertEquals("7 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1297 assertEquals("7 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1298 assertEquals("7 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1299 assertEquals("7 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1300 assertEquals("7 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1301 assertEquals("7 key fix 4 L0 [7]", 2, params.getColumnPos(6)); 1302 assertEquals("7 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1303 assertEquals("7 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1304 } 1305 1306 // |___ [5] [6] [7] 1307 // |___ <1> [2] [3] [4] 1308 public void testLayout7KeyFix4L1() { 1309 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L1); 1310 assertEquals("7 key fix 4 L1 columns", 4, params.mNumColumns); 1311 assertEquals("7 key fix 4 L1 rows", 2, params.mNumRows); 1312 assertEquals("7 key fix 4 L1 left", 0, params.mLeftKeys); 1313 assertEquals("7 key fix 4 L1 right", 4, params.mRightKeys); 1314 assertEquals("7 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1315 assertEquals("7 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1316 assertEquals("7 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1317 assertEquals("7 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1318 assertEquals("7 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1319 assertEquals("7 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1320 assertEquals("7 key fix 4 l1 [7]", 2, params.getColumnPos(6)); 1321 assertEquals("7 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1322 assertEquals("7 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1323 } 1324 1325 // |___ [5] [6] [7] 1326 // |___ [1] <2> [3] [4] 1327 public void testLayout7KeyFix4L2() { 1328 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L2); 1329 assertEquals("7 key fix 4 L2 columns", 4, params.mNumColumns); 1330 assertEquals("7 key fix 4 L2 rows", 2, params.mNumRows); 1331 assertEquals("7 key fix 4 L2 left", 1, params.mLeftKeys); 1332 assertEquals("7 key fix 4 L2 right", 3, params.mRightKeys); 1333 assertEquals("7 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1334 assertEquals("7 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1335 assertEquals("7 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1336 assertEquals("7 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1337 assertEquals("7 key fix 4 L2 [5]", -1, params.getColumnPos(4)); 1338 assertEquals("7 key fix 4 L2 [6]", 0, params.getColumnPos(5)); 1339 assertEquals("7 key fix 4 L2 [7]", 1, params.getColumnPos(6)); 1340 assertEquals("7 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1341 assertEquals("7 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1342 } 1343 1344 // [5] [6] [7]| 1345 // [1] [2] [3] <4>| 1346 public void testLayout7KeyFix4R0() { 1347 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R0); 1348 assertEquals("7 key fix 4 R0 columns", 4, params.mNumColumns); 1349 assertEquals("7 key fix 4 R0 rows", 2, params.mNumRows); 1350 assertEquals("7 key fix 4 R0 left", 3, params.mLeftKeys); 1351 assertEquals("7 key fix 4 R0 right", 1, params.mRightKeys); 1352 assertEquals("7 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1353 assertEquals("7 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1354 assertEquals("7 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1355 assertEquals("7 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1356 assertEquals("7 key fix 4 R0 [5]", -2, params.getColumnPos(4)); 1357 assertEquals("7 key fix 4 R0 [6]", -1, params.getColumnPos(5)); 1358 assertEquals("7 key fix 4 R0 [7]", 0, params.getColumnPos(6)); 1359 assertEquals("7 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1360 assertEquals("7 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1361 } 1362 1363 // [5] [6] [7] ___| 1364 // [1] [2] [3] <4> ___| 1365 public void testLayout7KeyFix4R1() { 1366 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R1); 1367 assertEquals("7 key fix 4 R1 columns", 4, params.mNumColumns); 1368 assertEquals("7 key fix 4 R1 rows", 2, params.mNumRows); 1369 assertEquals("7 key fix 4 R1 left", 3, params.mLeftKeys); 1370 assertEquals("7 key fix 4 R1 right", 1, params.mRightKeys); 1371 assertEquals("7 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1372 assertEquals("7 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1373 assertEquals("7 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1374 assertEquals("7 key fix 4 R1 <4>", 0, params.getColumnPos(3)); 1375 assertEquals("7 key fix 4 R1 [5]", -2, params.getColumnPos(4)); 1376 assertEquals("7 key fix 4 R1 [6]", -1, params.getColumnPos(5)); 1377 assertEquals("7 key fix 4 R1 [7]", 0, params.getColumnPos(6)); 1378 assertEquals("7 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1379 assertEquals("7 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1380 } 1381 1382 // [5] [6] [7] ___| 1383 // [1] [2] <3> [4] ___| 1384 public void testLayout7KeyFix4R2() { 1385 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R2); 1386 assertEquals("7 key fix 4 R2 columns", 4, params.mNumColumns); 1387 assertEquals("7 key fix 4 R2 rows", 2, params.mNumRows); 1388 assertEquals("7 key fix 4 R2 left", 2, params.mLeftKeys); 1389 assertEquals("7 key fix 4 R2 right", 2, params.mRightKeys); 1390 assertEquals("7 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1391 assertEquals("7 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1392 assertEquals("7 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1393 assertEquals("7 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1394 assertEquals("7 key fix 4 R2 [5]", -1, params.getColumnPos(4)); 1395 assertEquals("7 key fix 4 R2 [6]", 0, params.getColumnPos(5)); 1396 assertEquals("7 key fix 4 R2 [7]", 1, params.getColumnPos(6)); 1397 assertEquals("7 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1398 assertEquals("7 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1399 } 1400 1401 // [5] [6] [7] [8] 1402 // [1] <2> [3] [4] 1403 public void testLayout8KeyFix4M0() { 1404 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_M0); 1405 assertEquals("8 key fix 4 M0 columns", 4, params.mNumColumns); 1406 assertEquals("8 key fix 4 M0 rows", 2, params.mNumRows); 1407 assertEquals("8 key fix 4 M0 left", 1, params.mLeftKeys); 1408 assertEquals("8 key fix 4 M0 right", 3, params.mRightKeys); 1409 assertEquals("8 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1410 assertEquals("8 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1411 assertEquals("8 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1412 assertEquals("8 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1413 assertEquals("8 key fix 4 M0 [5]", -1, params.getColumnPos(4)); 1414 assertEquals("8 key fix 4 M0 [6]", 0, params.getColumnPos(5)); 1415 assertEquals("8 key fix 4 M0 [7]", 1, params.getColumnPos(6)); 1416 assertEquals("8 key fix 4 M0 [8]", 2, params.getColumnPos(7)); 1417 assertEquals("8 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1418 assertEquals("8 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1419 } 1420 1421 // |[5] [6] [7] [8] 1422 // |<1> [2] [3] [4] 1423 public void testLayout8KeyFix4L0() { 1424 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L0); 1425 assertEquals("8 key fix 4 L0 columns", 4, params.mNumColumns); 1426 assertEquals("8 key fix 4 L0 rows", 2, params.mNumRows); 1427 assertEquals("8 key fix 4 L0 left", 0, params.mLeftKeys); 1428 assertEquals("8 key fix 4 L0 right", 4, params.mRightKeys); 1429 assertEquals("8 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1430 assertEquals("8 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1431 assertEquals("8 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1432 assertEquals("8 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1433 assertEquals("8 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1434 assertEquals("8 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1435 assertEquals("8 key fix 4 L0 [7]", 2, params.getColumnPos(6)); 1436 assertEquals("8 key fix 4 L0 [8]", 3, params.getColumnPos(7)); 1437 assertEquals("8 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1438 assertEquals("8 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1439 } 1440 1441 // |___ [5] [6] [7] [8] 1442 // |___ <1> [2] [3] [4] 1443 public void testLayout8KeyFix4L1() { 1444 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L1); 1445 assertEquals("8 key fix 4 L1 columns", 4, params.mNumColumns); 1446 assertEquals("8 key fix 4 L1 rows", 2, params.mNumRows); 1447 assertEquals("8 key fix 4 L1 left", 0, params.mLeftKeys); 1448 assertEquals("8 key fix 4 L1 right", 4, params.mRightKeys); 1449 assertEquals("8 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1450 assertEquals("8 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1451 assertEquals("8 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1452 assertEquals("8 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1453 assertEquals("8 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1454 assertEquals("8 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1455 assertEquals("8 key fix 4 L1 [7]", 2, params.getColumnPos(6)); 1456 assertEquals("8 key fix 4 L1 [8]", 3, params.getColumnPos(7)); 1457 assertEquals("8 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1458 assertEquals("8 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1459 } 1460 1461 // |___ [5] [6] [7] [8] 1462 // |___ [1] <2> [3] [4] 1463 public void testLayout8KeyFix4L2() { 1464 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L2); 1465 assertEquals("8 key fix 4 L2 columns", 4, params.mNumColumns); 1466 assertEquals("8 key fix 4 L2 rows", 2, params.mNumRows); 1467 assertEquals("8 key fix 4 L2 left", 1, params.mLeftKeys); 1468 assertEquals("8 key fix 4 L2 right", 3, params.mRightKeys); 1469 assertEquals("8 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1470 assertEquals("8 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1471 assertEquals("8 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1472 assertEquals("8 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1473 assertEquals("8 key fix 4 L2 [5]", -1, params.getColumnPos(4)); 1474 assertEquals("8 key fix 4 L2 [6]", 0, params.getColumnPos(5)); 1475 assertEquals("8 key fix 4 L2 [7]", 1, params.getColumnPos(6)); 1476 assertEquals("8 key fix 4 L2 [8]", 2, params.getColumnPos(7)); 1477 assertEquals("8 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1478 assertEquals("8 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1479 } 1480 1481 // [5] [6] [7] [8]| 1482 // [1] [2] [3] <4>| 1483 public void testLayout8KeyFix4R0() { 1484 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R0); 1485 assertEquals("8 key fix 4 R0 columns", 4, params.mNumColumns); 1486 assertEquals("8 key fix 4 R0 rows", 2, params.mNumRows); 1487 assertEquals("8 key fix 4 R0 left", 3, params.mLeftKeys); 1488 assertEquals("8 key fix 4 R0 right", 1, params.mRightKeys); 1489 assertEquals("8 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1490 assertEquals("8 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1491 assertEquals("8 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1492 assertEquals("8 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1493 assertEquals("8 key fix 4 R0 [5]", -3, params.getColumnPos(4)); 1494 assertEquals("8 key fix 4 R0 [6]", -2, params.getColumnPos(5)); 1495 assertEquals("8 key fix 4 R0 [7]", -1, params.getColumnPos(6)); 1496 assertEquals("8 key fix 4 R0 [8]", 0, params.getColumnPos(7)); 1497 assertEquals("8 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1498 assertEquals("8 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1499 } 1500 1501 // [5] [6] [7] [8] ___| 1502 // [1] [2] [3] <4> ___| 1503 public void testLayout8KeyFix4R1() { 1504 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R1); 1505 assertEquals("8 key fix 4 R1 columns", 4, params.mNumColumns); 1506 assertEquals("8 key fix 4 R1 rows", 2, params.mNumRows); 1507 assertEquals("8 key fix 4 R1 left", 3, params.mLeftKeys); 1508 assertEquals("8 key fix 4 R1 right", 1, params.mRightKeys); 1509 assertEquals("8 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1510 assertEquals("8 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1511 assertEquals("8 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1512 assertEquals("8 key fix 4 R1 <4>", 0, params.getColumnPos(3)); 1513 assertEquals("8 key fix 4 R1 [5]", -3, params.getColumnPos(4)); 1514 assertEquals("8 key fix 4 R1 [6]", -2, params.getColumnPos(5)); 1515 assertEquals("8 key fix 4 R1 [7]", -1, params.getColumnPos(6)); 1516 assertEquals("8 key fix 4 R1 [8]", 0, params.getColumnPos(7)); 1517 assertEquals("8 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1518 assertEquals("8 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1519 } 1520 1521 // [5] [6] [7] [8] ___| 1522 // [1] [2] <3> [4] ___| 1523 public void testLayout8KeyFix4R2() { 1524 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R2); 1525 assertEquals("8 key fix 4 R2 columns", 4, params.mNumColumns); 1526 assertEquals("8 key fix 4 R2 rows", 2, params.mNumRows); 1527 assertEquals("8 key fix 4 R2 left", 2, params.mLeftKeys); 1528 assertEquals("8 key fix 4 R2 right", 2, params.mRightKeys); 1529 assertEquals("8 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1530 assertEquals("8 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1531 assertEquals("8 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1532 assertEquals("8 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1533 assertEquals("8 key fix 4 R2 [5]", -2, params.getColumnPos(4)); 1534 assertEquals("8 key fix 4 R2 [6]", -1, params.getColumnPos(5)); 1535 assertEquals("8 key fix 4 R2 [7]", 0, params.getColumnPos(6)); 1536 assertEquals("8 key fix 4 R2 [8]", 1, params.getColumnPos(7)); 1537 assertEquals("8 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1538 assertEquals("8 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1539 } 1540 1541 // [1] [2] <3> [4] [5] 1542 public void testLayout5KeyFix5M0() { 1543 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_M0); 1544 assertEquals("5 key fix 5 columns", 5, params.mNumColumns); 1545 assertEquals("5 key fix 5 rows", 1, params.mNumRows); 1546 assertEquals("5 key fix 5 left", 2, params.mLeftKeys); 1547 assertEquals("5 key fix 5 right", 3, params.mRightKeys); 1548 assertEquals("5 key fix 5 [1]", -2, params.getColumnPos(0)); 1549 assertEquals("5 key fix 5 [2]", -1, params.getColumnPos(1)); 1550 assertEquals("5 key fix 5 <3>", 0, params.getColumnPos(2)); 1551 assertEquals("5 key fix 5 [4]", 1, params.getColumnPos(3)); 1552 assertEquals("5 key fix 5 [5]", 2, params.getColumnPos(4)); 1553 assertEquals("5 key fix 5 adjust", 0, params.mTopRowAdjustment); 1554 assertEquals("5 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1555 } 1556 1557 // |<1> [2] [3] [4] [5] 1558 public void testLayout5KeyFix5L0() { 1559 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L0); 1560 assertEquals("5 key fix 5 L0 columns", 5, params.mNumColumns); 1561 assertEquals("5 key fix 5 L0 rows", 1, params.mNumRows); 1562 assertEquals("5 key fix 5 L0 left", 0, params.mLeftKeys); 1563 assertEquals("5 key fix 5 L0 right", 5, params.mRightKeys); 1564 assertEquals("5 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1565 assertEquals("5 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1566 assertEquals("5 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1567 assertEquals("5 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1568 assertEquals("5 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1569 assertEquals("5 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1570 assertEquals("5 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1571 } 1572 1573 // |___ <1> [2] [3] [4] [5] 1574 public void testLayout5KeyFix5L1() { 1575 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L1); 1576 assertEquals("5 key fix 5 L1 columns", 5, params.mNumColumns); 1577 assertEquals("5 key fix 5 L1 rows", 1, params.mNumRows); 1578 assertEquals("5 key fix 5 L1 left", 0, params.mLeftKeys); 1579 assertEquals("5 key fix 5 L1 right", 5, params.mRightKeys); 1580 assertEquals("5 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1581 assertEquals("5 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1582 assertEquals("5 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1583 assertEquals("5 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1584 assertEquals("5 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1585 assertEquals("5 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1586 assertEquals("5 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1587 } 1588 1589 // |___ [1] <2> [3] [4] [5] 1590 public void testLayout5KeyFix5L2() { 1591 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L2); 1592 assertEquals("5 key fix 5 L2 columns", 5, params.mNumColumns); 1593 assertEquals("5 key fix 5 L2 rows", 1, params.mNumRows); 1594 assertEquals("5 key fix 5 L2 left", 1, params.mLeftKeys); 1595 assertEquals("5 key fix 5 L2 right", 4, params.mRightKeys); 1596 assertEquals("5 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1597 assertEquals("5 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1598 assertEquals("5 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1599 assertEquals("5 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1600 assertEquals("5 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1601 assertEquals("5 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1602 assertEquals("5 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1603 } 1604 1605 // [1] [2] [3] [4] <5>| 1606 public void testLayout5KeyFix5R0() { 1607 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R0); 1608 assertEquals("5 key fix 5 R0 columns", 5, params.mNumColumns); 1609 assertEquals("5 key fix 5 R0 rows", 1, params.mNumRows); 1610 assertEquals("5 key fix 5 R0 left", 4, params.mLeftKeys); 1611 assertEquals("5 key fix 5 R0 right", 1, params.mRightKeys); 1612 assertEquals("5 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1613 assertEquals("5 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1614 assertEquals("5 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1615 assertEquals("5 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1616 assertEquals("5 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1617 assertEquals("5 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1618 assertEquals("5 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1619 } 1620 1621 // [1] [2] [3] [4] <5> ___| 1622 public void testLayout5KeyFix5R1() { 1623 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R1); 1624 assertEquals("5 key fix 5 R1 columns", 5, params.mNumColumns); 1625 assertEquals("5 key fix 5 R1 rows", 1, params.mNumRows); 1626 assertEquals("5 key fix 5 R1 left", 4, params.mLeftKeys); 1627 assertEquals("5 key fix 5 R1 right", 1, params.mRightKeys); 1628 assertEquals("5 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1629 assertEquals("5 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1630 assertEquals("5 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 1631 assertEquals("5 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 1632 assertEquals("5 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 1633 assertEquals("5 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1634 assertEquals("5 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1635 } 1636 1637 // [1] [2] [3] <4> [5] ___| 1638 public void testLayout5KeyFix5R2() { 1639 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R2); 1640 assertEquals("5 key fix 5 R2 columns", 5, params.mNumColumns); 1641 assertEquals("5 key fix 5 R2 rows", 1, params.mNumRows); 1642 assertEquals("5 key fix 5 R2 left", 3, params.mLeftKeys); 1643 assertEquals("5 key fix 5 R2 right", 2, params.mRightKeys); 1644 assertEquals("5 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 1645 assertEquals("5 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 1646 assertEquals("5 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 1647 assertEquals("5 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 1648 assertEquals("5 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 1649 assertEquals("5 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1650 assertEquals("5 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1651 } 1652 1653 // [6] 1654 // [1] [2] <3> [4] [5] 1655 public void testLayout6KeyFix5M0() { 1656 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_M0); 1657 assertEquals("6 key fix 5 columns", 5, params.mNumColumns); 1658 assertEquals("6 key fix 5 rows", 2, params.mNumRows); 1659 assertEquals("6 key fix 5 left", 2, params.mLeftKeys); 1660 assertEquals("6 key fix 5 right", 3, params.mRightKeys); 1661 assertEquals("6 key fix 5 [1]", -2, params.getColumnPos(0)); 1662 assertEquals("6 key fix 5 [2]", -1, params.getColumnPos(1)); 1663 assertEquals("6 key fix 5 <3>", 0, params.getColumnPos(2)); 1664 assertEquals("6 key fix 5 [4]", 1, params.getColumnPos(3)); 1665 assertEquals("6 key fix 5 [5]", 2, params.getColumnPos(4)); 1666 assertEquals("6 key fix 5 [6]", 0, params.getColumnPos(5)); 1667 assertEquals("6 key fix 5 adjust", 0, params.mTopRowAdjustment); 1668 assertEquals("6 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1669 } 1670 1671 // |[6] 1672 // |<1> [2] [3] [4] [5] 1673 public void testLayout6KeyFix5L0() { 1674 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L0); 1675 assertEquals("6 key fix 5 L0 columns", 5, params.mNumColumns); 1676 assertEquals("6 key fix 5 L0 rows", 2, params.mNumRows); 1677 assertEquals("6 key fix 5 L0 left", 0, params.mLeftKeys); 1678 assertEquals("6 key fix 5 L0 right", 5, params.mRightKeys); 1679 assertEquals("6 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1680 assertEquals("6 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1681 assertEquals("6 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1682 assertEquals("6 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1683 assertEquals("6 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1684 assertEquals("6 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 1685 assertEquals("6 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1686 assertEquals("6 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1687 } 1688 1689 // |___ [6] 1690 // |___ <1> [2] [3] [4] [5] 1691 public void testLayout6KeyFix5L1() { 1692 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L1); 1693 assertEquals("6 key fix 5 L1 columns", 5, params.mNumColumns); 1694 assertEquals("6 key fix 5 L1 rows", 2, params.mNumRows); 1695 assertEquals("6 key fix 5 L1 left", 0, params.mLeftKeys); 1696 assertEquals("6 key fix 5 L1 right", 5, params.mRightKeys); 1697 assertEquals("6 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1698 assertEquals("6 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1699 assertEquals("6 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1700 assertEquals("6 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1701 assertEquals("6 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1702 assertEquals("6 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 1703 assertEquals("6 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1704 assertEquals("6 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1705 } 1706 1707 // |___ [6] 1708 // |___ [1] <2> [3] [4] [5] 1709 public void testLayout6KeyFix5L2() { 1710 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L2); 1711 assertEquals("6 key fix 5 L2 columns", 5, params.mNumColumns); 1712 assertEquals("6 key fix 5 L2 rows", 2, params.mNumRows); 1713 assertEquals("6 key fix 5 L2 left", 1, params.mLeftKeys); 1714 assertEquals("6 key fix 5 L2 right", 4, params.mRightKeys); 1715 assertEquals("6 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1716 assertEquals("6 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1717 assertEquals("6 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1718 assertEquals("6 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1719 assertEquals("6 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1720 assertEquals("6 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 1721 assertEquals("6 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1722 assertEquals("6 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1723 } 1724 1725 // [6]| 1726 // [1] [2] [3] [4] <5>| 1727 public void testLayout6KeyFix5R0() { 1728 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R0); 1729 assertEquals("6 key fix 5 R0 columns", 5, params.mNumColumns); 1730 assertEquals("6 key fix 5 R0 rows", 2, params.mNumRows); 1731 assertEquals("6 key fix 5 R0 left", 4, params.mLeftKeys); 1732 assertEquals("6 key fix 5 R0 right", 1, params.mRightKeys); 1733 assertEquals("6 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1734 assertEquals("6 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1735 assertEquals("6 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1736 assertEquals("6 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1737 assertEquals("6 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1738 assertEquals("6 key fix 5 R0 [6]", 0, params.getColumnPos(5)); 1739 assertEquals("6 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1740 assertEquals("6 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1741 } 1742 1743 // [6] ___| 1744 // [1] [2] [3] [4] <5> ___| 1745 public void testLayout6KeyFix5R1() { 1746 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R1); 1747 assertEquals("6 key fix 5 R1 columns", 5, params.mNumColumns); 1748 assertEquals("6 key fix 5 R1 rows", 2, params.mNumRows); 1749 assertEquals("6 key fix 5 R1 left", 4, params.mLeftKeys); 1750 assertEquals("6 key fix 5 R1 right", 1, params.mRightKeys); 1751 assertEquals("6 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1752 assertEquals("6 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1753 assertEquals("6 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 1754 assertEquals("6 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 1755 assertEquals("6 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 1756 assertEquals("6 key fix 5 R1 [6]", 0, params.getColumnPos(5)); 1757 assertEquals("6 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1758 assertEquals("6 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1759 } 1760 1761 // [6] ___| 1762 // [1] [2] [3] <4> [5] ___| 1763 public void testLayout6KeyFix5R2() { 1764 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R2); 1765 assertEquals("6 key fix 5 R2 columns", 5, params.mNumColumns); 1766 assertEquals("6 key fix 5 R2 rows", 2, params.mNumRows); 1767 assertEquals("6 key fix 5 R2 left", 3, params.mLeftKeys); 1768 assertEquals("6 key fix 5 R2 right", 2, params.mRightKeys); 1769 assertEquals("6 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 1770 assertEquals("6 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 1771 assertEquals("6 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 1772 assertEquals("6 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 1773 assertEquals("6 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 1774 assertEquals("6 key fix 5 R2 [6]", 0, params.getColumnPos(5)); 1775 assertEquals("6 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1776 assertEquals("6 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1777 } 1778 1779 // [6] [7] 1780 // [1] [2] <3> [4] [5] 1781 public void testLayout7KeyFix5M0() { 1782 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_M0); 1783 assertEquals("7 key fix 5 columns", 5, params.mNumColumns); 1784 assertEquals("7 key fix 5 rows", 2, params.mNumRows); 1785 assertEquals("7 key fix 5 left", 2, params.mLeftKeys); 1786 assertEquals("7 key fix 5 right", 3, params.mRightKeys); 1787 assertEquals("7 key fix 5 [1]", -2, params.getColumnPos(0)); 1788 assertEquals("7 key fix 5 [2]", -1, params.getColumnPos(1)); 1789 assertEquals("7 key fix 5 <3>", 0, params.getColumnPos(2)); 1790 assertEquals("7 key fix 5 [4]", 1, params.getColumnPos(3)); 1791 assertEquals("7 key fix 5 [5]", 2, params.getColumnPos(4)); 1792 assertEquals("7 key fix 5 [6]", 0, params.getColumnPos(5)); 1793 assertEquals("7 key fix 5 [7]", 1, params.getColumnPos(6)); 1794 assertEquals("7 key fix 5 adjust", -1, params.mTopRowAdjustment); 1795 assertEquals("7 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1796 } 1797 1798 // |[6] [7] 1799 // |<1> [2] [3] [4] [5] 1800 public void testLayout7KeyFix5L0() { 1801 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L0); 1802 assertEquals("7 key fix 5 L0 columns", 5, params.mNumColumns); 1803 assertEquals("7 key fix 5 L0 rows", 2, params.mNumRows); 1804 assertEquals("7 key fix 5 L0 left", 0, params.mLeftKeys); 1805 assertEquals("7 key fix 5 L0 right", 5, params.mRightKeys); 1806 assertEquals("7 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1807 assertEquals("7 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1808 assertEquals("7 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1809 assertEquals("7 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1810 assertEquals("7 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1811 assertEquals("7 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 1812 assertEquals("7 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 1813 assertEquals("7 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1814 assertEquals("7 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1815 } 1816 1817 // |___ [6] [7] 1818 // |___ <1> [2] [3] [4] [5] 1819 public void testLayout7KeyFix5L1() { 1820 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L1); 1821 assertEquals("7 key fix 5 L1 columns", 5, params.mNumColumns); 1822 assertEquals("7 key fix 5 L1 rows", 2, params.mNumRows); 1823 assertEquals("7 key fix 5 L1 left", 0, params.mLeftKeys); 1824 assertEquals("7 key fix 5 L1 right", 5, params.mRightKeys); 1825 assertEquals("7 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1826 assertEquals("7 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1827 assertEquals("7 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1828 assertEquals("7 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1829 assertEquals("7 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1830 assertEquals("7 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 1831 assertEquals("7 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 1832 assertEquals("7 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1833 assertEquals("7 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1834 } 1835 1836 // |___ [6] [7] 1837 // |___ [1] <2> [3] [4] [5] 1838 public void testLayout7KeyFix5L2() { 1839 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L2); 1840 assertEquals("7 key fix 5 L2 columns", 5, params.mNumColumns); 1841 assertEquals("7 key fix 5 L2 rows", 2, params.mNumRows); 1842 assertEquals("7 key fix 5 L2 left", 1, params.mLeftKeys); 1843 assertEquals("7 key fix 5 L2 right", 4, params.mRightKeys); 1844 assertEquals("7 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1845 assertEquals("7 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1846 assertEquals("7 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1847 assertEquals("7 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1848 assertEquals("7 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1849 assertEquals("7 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 1850 assertEquals("7 key fix 5 L2 [7]", 1, params.getColumnPos(6)); 1851 assertEquals("7 key fix 5 L2 adjust", -1, params.mTopRowAdjustment); 1852 assertEquals("7 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1853 } 1854 1855 // [6] [7]| 1856 // [1] [2] [3] [4] <5>| 1857 public void testLayout7KeyFix5R0() { 1858 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R0); 1859 assertEquals("7 key fix 5 R0 columns", 5, params.mNumColumns); 1860 assertEquals("7 key fix 5 R0 rows", 2, params.mNumRows); 1861 assertEquals("7 key fix 5 R0 left", 4, params.mLeftKeys); 1862 assertEquals("7 key fix 5 R0 right", 1, params.mRightKeys); 1863 assertEquals("7 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1864 assertEquals("7 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1865 assertEquals("7 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1866 assertEquals("7 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1867 assertEquals("7 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1868 assertEquals("7 key fix 5 R0 [6]", -1, params.getColumnPos(5)); 1869 assertEquals("7 key fix 5 R0 [7]", 0, params.getColumnPos(6)); 1870 assertEquals("7 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1871 assertEquals("7 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1872 } 1873 1874 // [6] [7] ___| 1875 // [1] [2] [3] [4] <5> ___| 1876 public void testLayout7KeyFix5R1() { 1877 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R1); 1878 assertEquals("7 key fix 5 R1 columns", 5, params.mNumColumns); 1879 assertEquals("7 key fix 5 R1 rows", 2, params.mNumRows); 1880 assertEquals("7 key fix 5 R1 left", 4, params.mLeftKeys); 1881 assertEquals("7 key fix 5 R1 right", 1, params.mRightKeys); 1882 assertEquals("7 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1883 assertEquals("7 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1884 assertEquals("7 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 1885 assertEquals("7 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 1886 assertEquals("7 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 1887 assertEquals("7 key fix 5 R1 [6]", -1, params.getColumnPos(5)); 1888 assertEquals("7 key fix 5 R1 [7]", 0, params.getColumnPos(6)); 1889 assertEquals("7 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1890 assertEquals("7 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1891 } 1892 1893 // [6] [7] ___| 1894 // [1] [2] [3] <4> [5] ___| 1895 public void testLayout7KeyFix5R2() { 1896 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R2); 1897 assertEquals("7 key fix 5 R2 columns",5, params.mNumColumns); 1898 assertEquals("7 key fix 5 R2 rows", 2, params.mNumRows); 1899 assertEquals("7 key fix 5 R2 left", 3, params.mLeftKeys); 1900 assertEquals("7 key fix 5 R2 right", 2, params.mRightKeys); 1901 assertEquals("7 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 1902 assertEquals("7 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 1903 assertEquals("7 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 1904 assertEquals("7 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 1905 assertEquals("7 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 1906 assertEquals("7 key fix 5 R2 [6]", 0, params.getColumnPos(5)); 1907 assertEquals("7 key fix 5 R2 [7]", 1, params.getColumnPos(6)); 1908 assertEquals("7 key fix 5 R2 adjust", -1, params.mTopRowAdjustment); 1909 assertEquals("7 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1910 } 1911 1912 // [6] [7] [8] 1913 // [1] [2] <3> [4] [5] 1914 public void testLayout8KeyFix5M0() { 1915 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_M0); 1916 assertEquals("8 key fix 5 M0 columns", 5, params.mNumColumns); 1917 assertEquals("8 key fix 5 M0 rows", 2, params.mNumRows); 1918 assertEquals("8 key fix 5 M0 left", 2, params.mLeftKeys); 1919 assertEquals("8 key fix 5 M0 right", 3, params.mRightKeys); 1920 assertEquals("8 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 1921 assertEquals("8 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 1922 assertEquals("8 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 1923 assertEquals("8 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 1924 assertEquals("8 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 1925 assertEquals("8 key fix 5 M0 [6]", -1, params.getColumnPos(5)); 1926 assertEquals("8 key fix 5 M0 [7]", 0, params.getColumnPos(6)); 1927 assertEquals("8 key fix 5 M0 [8]", 1, params.getColumnPos(7)); 1928 assertEquals("8 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 1929 assertEquals("8 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1930 } 1931 1932 // |[6] [7] [8] 1933 // |<1> [2] [3] [4] [5] 1934 public void testLayout8KeyFix5L0() { 1935 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L0); 1936 assertEquals("8 key fix 5 L0 columns", 5, params.mNumColumns); 1937 assertEquals("8 key fix 5 L0 rows", 2, params.mNumRows); 1938 assertEquals("8 key fix 5 L0 left", 0, params.mLeftKeys); 1939 assertEquals("8 key fix 5 L0 right", 5, params.mRightKeys); 1940 assertEquals("8 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1941 assertEquals("8 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1942 assertEquals("8 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1943 assertEquals("8 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1944 assertEquals("8 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1945 assertEquals("8 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 1946 assertEquals("8 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 1947 assertEquals("8 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 1948 assertEquals("8 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1949 assertEquals("8 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1950 } 1951 1952 // |___ [6] [7] [8] 1953 // |___ <1> [2] [3] [4] [5] 1954 public void testLayout8KeyFix5L1() { 1955 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L1); 1956 assertEquals("8 key fix 5 L1 columns", 5, params.mNumColumns); 1957 assertEquals("8 key fix 5 L1 rows", 2, params.mNumRows); 1958 assertEquals("8 key fix 5 L1 left", 0, params.mLeftKeys); 1959 assertEquals("8 key fix 5 L1 right", 5, params.mRightKeys); 1960 assertEquals("8 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1961 assertEquals("8 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1962 assertEquals("8 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1963 assertEquals("8 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1964 assertEquals("8 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1965 assertEquals("8 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 1966 assertEquals("8 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 1967 assertEquals("8 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 1968 assertEquals("8 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1969 assertEquals("8 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1970 } 1971 1972 // |___ [6] [7] [8] 1973 // |___ [1] <2> [3] [4] [5] 1974 public void testLayout8KeyFix5L2() { 1975 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L2); 1976 assertEquals("8 key fix 5 L2 columns", 5, params.mNumColumns); 1977 assertEquals("8 key fix 5 L2 rows", 2, params.mNumRows); 1978 assertEquals("8 key fix 5 L2 left", 1, params.mLeftKeys); 1979 assertEquals("8 key fix 5 L2 right", 4, params.mRightKeys); 1980 assertEquals("8 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1981 assertEquals("8 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1982 assertEquals("8 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1983 assertEquals("8 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1984 assertEquals("8 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1985 assertEquals("8 key fix 5 L2 [6]", -1, params.getColumnPos(5)); 1986 assertEquals("8 key fix 5 L2 [7]", 0, params.getColumnPos(6)); 1987 assertEquals("8 key fix 5 L2 [8]", 1, params.getColumnPos(7)); 1988 assertEquals("8 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1989 assertEquals("8 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1990 } 1991 1992 // [6] [7] [8]| 1993 // [1] [2] [3] [4] <5>| 1994 public void testLayout8KeyFix5R0() { 1995 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R0); 1996 assertEquals("8 key fix 5 R0 columns", 5, params.mNumColumns); 1997 assertEquals("8 key fix 5 R0 rows", 2, params.mNumRows); 1998 assertEquals("8 key fix 5 R0 left", 4, params.mLeftKeys); 1999 assertEquals("8 key fix 5 R0 right", 1, params.mRightKeys); 2000 assertEquals("8 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2001 assertEquals("8 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2002 assertEquals("8 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2003 assertEquals("8 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2004 assertEquals("8 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2005 assertEquals("8 key fix 5 R0 [6]", -2, params.getColumnPos(5)); 2006 assertEquals("8 key fix 5 R0 [7]", -1, params.getColumnPos(6)); 2007 assertEquals("8 key fix 5 R0 [8]", 0, params.getColumnPos(7)); 2008 assertEquals("8 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2009 assertEquals("8 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2010 } 2011 2012 // [6] [7] [8] ___| 2013 // [1] [2] [3] [4] <5> ___| 2014 public void testLayout8KeyFix5R1() { 2015 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R1); 2016 assertEquals("8 key fix 5 R1 columns", 5, params.mNumColumns); 2017 assertEquals("8 key fix 5 R1 rows", 2, params.mNumRows); 2018 assertEquals("8 key fix 5 R1 left", 4, params.mLeftKeys); 2019 assertEquals("8 key fix 5 R1 right", 1, params.mRightKeys); 2020 assertEquals("8 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2021 assertEquals("8 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2022 assertEquals("8 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2023 assertEquals("8 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2024 assertEquals("8 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2025 assertEquals("8 key fix 5 R1 [6]", -2, params.getColumnPos(5)); 2026 assertEquals("8 key fix 5 R1 [7]", -1, params.getColumnPos(6)); 2027 assertEquals("8 key fix 5 R1 [8]", 0, params.getColumnPos(7)); 2028 assertEquals("8 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2029 assertEquals("8 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2030 } 2031 2032 // [6] [7] [8] ___| 2033 // [1] [2] [3] <4> [5] ___| 2034 public void testLayout8KeyFix5R2() { 2035 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R2); 2036 assertEquals("8 key fix 5 R2 columns", 5, params.mNumColumns); 2037 assertEquals("8 key fix 5 R2 rows", 2, params.mNumRows); 2038 assertEquals("8 key fix 5 R2 left", 3, params.mLeftKeys); 2039 assertEquals("8 key fix 5 R2 right", 2, params.mRightKeys); 2040 assertEquals("8 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2041 assertEquals("8 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2042 assertEquals("8 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2043 assertEquals("8 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2044 assertEquals("8 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2045 assertEquals("8 key fix 5 R2 [6]", -1, params.getColumnPos(5)); 2046 assertEquals("8 key fix 5 R2 [7]", 0, params.getColumnPos(6)); 2047 assertEquals("8 key fix 5 R2 [8]", 1, params.getColumnPos(7)); 2048 assertEquals("8 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 2049 assertEquals("8 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2050 } 2051 2052 // [6] [7] [8] [9] 2053 // [1] [2] <3> [4] [5] 2054 public void testLayout9KeyFix5M0() { 2055 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_M0); 2056 assertEquals("9 key fix 5 M0 columns", 5, params.mNumColumns); 2057 assertEquals("9 key fix 5 M0 rows", 2, params.mNumRows); 2058 assertEquals("9 key fix 5 M0 left", 2, params.mLeftKeys); 2059 assertEquals("9 key fix 5 M0 right", 3, params.mRightKeys); 2060 assertEquals("9 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2061 assertEquals("9 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2062 assertEquals("9 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2063 assertEquals("9 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2064 assertEquals("9 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2065 assertEquals("9 key fix 5 M0 [6]", -1, params.getColumnPos(5)); 2066 assertEquals("9 key fix 5 M0 [7]", 0, params.getColumnPos(6)); 2067 assertEquals("9 key fix 5 M0 [8]", 1, params.getColumnPos(7)); 2068 assertEquals("9 key fix 5 M0 [9]", 2, params.getColumnPos(8)); 2069 assertEquals("9 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2070 assertEquals("9 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2071 } 2072 2073 // |[6] [7] [8] [9] 2074 // |<1> [2] [3] [4] [5] 2075 public void testLayout9KeyFix5L0() { 2076 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L0); 2077 assertEquals("9 key fix 5 L0 columns", 5, params.mNumColumns); 2078 assertEquals("9 key fix 5 L0 rows", 2, params.mNumRows); 2079 assertEquals("9 key fix 5 L0 left", 0, params.mLeftKeys); 2080 assertEquals("9 key fix 5 L0 right", 5, params.mRightKeys); 2081 assertEquals("9 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 2082 assertEquals("9 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 2083 assertEquals("9 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 2084 assertEquals("9 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 2085 assertEquals("9 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 2086 assertEquals("9 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 2087 assertEquals("9 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 2088 assertEquals("9 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 2089 assertEquals("9 key fix 5 L0 [9]", 3, params.getColumnPos(8)); 2090 assertEquals("9 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 2091 assertEquals("9 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2092 } 2093 2094 // |___ [6] [7] [8] [9] 2095 // |___ <1> [2] [3] [4] [5] 2096 public void testLayout9KeyFix5L1() { 2097 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L1); 2098 assertEquals("9 key fix 5 L1 columns", 5, params.mNumColumns); 2099 assertEquals("9 key fix 5 L1 rows", 2, params.mNumRows); 2100 assertEquals("9 key fix 5 L1 left", 0, params.mLeftKeys); 2101 assertEquals("9 key fix 5 L1 right", 5, params.mRightKeys); 2102 assertEquals("9 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 2103 assertEquals("9 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 2104 assertEquals("9 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 2105 assertEquals("9 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 2106 assertEquals("9 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 2107 assertEquals("9 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 2108 assertEquals("9 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 2109 assertEquals("9 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 2110 assertEquals("9 key fix 5 L1 [9]", 3, params.getColumnPos(8)); 2111 assertEquals("9 key fix 5 L1 adjust",0, params.mTopRowAdjustment); 2112 assertEquals("9 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2113 } 2114 2115 // |___ [6] [7] [8] [9] 2116 // |___ [1] <2> [3] [4] [5] 2117 public void testLayout9KeyFix5L2() { 2118 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L2); 2119 assertEquals("9 key fix 5 L2 columns", 5, params.mNumColumns); 2120 assertEquals("9 key fix 5 L2 rows", 2, params.mNumRows); 2121 assertEquals("9 key fix 5 L2 left", 1, params.mLeftKeys); 2122 assertEquals("9 key fix 5 L2 right", 4, params.mRightKeys); 2123 assertEquals("9 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 2124 assertEquals("9 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 2125 assertEquals("9 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 2126 assertEquals("9 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 2127 assertEquals("9 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 2128 assertEquals("9 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 2129 assertEquals("9 key fix 5 L2 [7]", 1, params.getColumnPos(6)); 2130 assertEquals("9 key fix 5 L2 [8]", 2, params.getColumnPos(7)); 2131 assertEquals("9 key fix 5 L2 [9]", 3, params.getColumnPos(8)); 2132 assertEquals("9 key fix 5 L2 adjust", -1, params.mTopRowAdjustment); 2133 assertEquals("9 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2134 } 2135 2136 // [6] [7] [8] [9]| 2137 // [1] [2] [3] [4] <5>| 2138 public void testLayout9KeyFix5R0() { 2139 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R0); 2140 assertEquals("9 key fix 5 R0 columns", 5, params.mNumColumns); 2141 assertEquals("9 key fix 5 R0 rows", 2, params.mNumRows); 2142 assertEquals("9 key fix 5 R0 left", 4, params.mLeftKeys); 2143 assertEquals("9 key fix 5 R0 right", 1, params.mRightKeys); 2144 assertEquals("9 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2145 assertEquals("9 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2146 assertEquals("9 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2147 assertEquals("9 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2148 assertEquals("9 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2149 assertEquals("9 key fix 5 R0 [6]", -3, params.getColumnPos(5)); 2150 assertEquals("9 key fix 5 R0 [7]", -2, params.getColumnPos(6)); 2151 assertEquals("9 key fix 5 R0 [8]", -1, params.getColumnPos(7)); 2152 assertEquals("9 key fix 5 R0 [9]", 0, params.getColumnPos(8)); 2153 assertEquals("9 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2154 assertEquals("9 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2155 } 2156 2157 // [6] [7] [8] [9] ___| 2158 // [1] [2] [3] [4] <5> ___| 2159 public void testLayout9KeyFix5R1() { 2160 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R1); 2161 assertEquals("9 key fix 5 R1 columns", 5, params.mNumColumns); 2162 assertEquals("9 key fix 5 R1 rows", 2, params.mNumRows); 2163 assertEquals("9 key fix 5 R1 left", 4, params.mLeftKeys); 2164 assertEquals("9 key fix 5 R1 right", 1, params.mRightKeys); 2165 assertEquals("9 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2166 assertEquals("9 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2167 assertEquals("9 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2168 assertEquals("9 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2169 assertEquals("9 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2170 assertEquals("9 key fix 5 R1 [6]", -3, params.getColumnPos(5)); 2171 assertEquals("9 key fix 5 R1 [7]", -2, params.getColumnPos(6)); 2172 assertEquals("9 key fix 5 R1 [8]", -1, params.getColumnPos(7)); 2173 assertEquals("9 key fix 5 R1 [9]", 0, params.getColumnPos(8)); 2174 assertEquals("9 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2175 assertEquals("9 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2176 } 2177 2178 // [6] [7] [8] [9] ___| 2179 // [1] [2] [3] <4> [5] ___| 2180 public void testLayout9KeyFix5R2() { 2181 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R2); 2182 assertEquals("9 key fix 5 R2 columns", 5, params.mNumColumns); 2183 assertEquals("9 key fix 5 R2 rows", 2, params.mNumRows); 2184 assertEquals("9 key fix 5 R2 left", 3, params.mLeftKeys); 2185 assertEquals("9 key fix 5 R2 right", 2, params.mRightKeys); 2186 assertEquals("9 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2187 assertEquals("9 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2188 assertEquals("9 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2189 assertEquals("9 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2190 assertEquals("9 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2191 assertEquals("9 key fix 5 R2 [6]", -2, params.getColumnPos(5)); 2192 assertEquals("9 key fix 5 R2 [7]", -1, params.getColumnPos(6)); 2193 assertEquals("9 key fix 5 R2 [8]", 0, params.getColumnPos(7)); 2194 assertEquals("9 key fix 5 R2 [9]", 1, params.getColumnPos(8)); 2195 assertEquals("9 key fix 5 R2 adjust", -1, params.mTopRowAdjustment); 2196 assertEquals("9 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2197 } 2198 2199 // [6] [7] [8] [9] [A] 2200 // [1] [2] <3> [4] [5] 2201 public void testLayout10KeyFix5M0() { 2202 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_M0); 2203 assertEquals("10 key fix 5 M0 columns", 5, params.mNumColumns); 2204 assertEquals("10 key fix 5 M0 rows", 2, params.mNumRows); 2205 assertEquals("10 key fix 5 M0 left", 2, params.mLeftKeys); 2206 assertEquals("10 key fix 5 M0 right", 3, params.mRightKeys); 2207 assertEquals("10 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2208 assertEquals("10 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2209 assertEquals("10 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2210 assertEquals("10 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2211 assertEquals("10 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2212 assertEquals("10 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2213 assertEquals("10 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2214 assertEquals("10 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2215 assertEquals("10 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2216 assertEquals("10 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2217 assertEquals("10 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2218 assertEquals("10 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2219 } 2220 2221 // |[6] [7] [8] [9] [A] 2222 // |<1> [2] [3] [4] [5] 2223 public void testLayout10KeyFix5L0() { 2224 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L0); 2225 assertEquals("10 key fix 5 L0 columns", 5, params.mNumColumns); 2226 assertEquals("10 key fix 5 L0 rows", 2, params.mNumRows); 2227 assertEquals("10 key fix 5 L0 left", 0, params.mLeftKeys); 2228 assertEquals("10 key fix 5 L0 right", 5, params.mRightKeys); 2229 assertEquals("10 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 2230 assertEquals("10 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 2231 assertEquals("10 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 2232 assertEquals("10 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 2233 assertEquals("10 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 2234 assertEquals("10 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 2235 assertEquals("10 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 2236 assertEquals("10 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 2237 assertEquals("10 key fix 5 L0 [9]", 3, params.getColumnPos(8)); 2238 assertEquals("10 key fix 5 L0 [A]", 4, params.getColumnPos(9)); 2239 assertEquals("10 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 2240 assertEquals("10 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2241 } 2242 2243 // |___ [6] [7] [8] [9] [A] 2244 // |___ <1> [2] [3] [4] [5] 2245 public void testLayout10KeyFix5L1() { 2246 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L1); 2247 assertEquals("10 key fix 5 L1 columns", 5, params.mNumColumns); 2248 assertEquals("10 key fix 5 L1 rows", 2, params.mNumRows); 2249 assertEquals("10 key fix 5 L1 left", 0, params.mLeftKeys); 2250 assertEquals("10 key fix 5 L1 right", 5, params.mRightKeys); 2251 assertEquals("10 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 2252 assertEquals("10 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 2253 assertEquals("10 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 2254 assertEquals("10 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 2255 assertEquals("10 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 2256 assertEquals("10 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 2257 assertEquals("10 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 2258 assertEquals("10 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 2259 assertEquals("10 key fix 5 L1 [9]", 3, params.getColumnPos(8)); 2260 assertEquals("10 key fix 5 L1 [A]", 4, params.getColumnPos(9)); 2261 assertEquals("10 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 2262 assertEquals("10 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2263 } 2264 2265 // |___ [6] [7] [8] [9] [A] 2266 // |___ [1] <2> [3] [4] [5] 2267 public void testLayout10KeyFix5L2() { 2268 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L2); 2269 assertEquals("10 key fix 5 L2 columns", 5, params.mNumColumns); 2270 assertEquals("10 key fix 5 L2 rows", 2, params.mNumRows); 2271 assertEquals("10 key fix 5 L2 left", 1, params.mLeftKeys); 2272 assertEquals("10 key fix 5 L2 right", 4, params.mRightKeys); 2273 assertEquals("10 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 2274 assertEquals("10 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 2275 assertEquals("10 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 2276 assertEquals("10 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 2277 assertEquals("10 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 2278 assertEquals("10 key fix 5 L2 [6]", -1, params.getColumnPos(5)); 2279 assertEquals("10 key fix 5 L2 [7]", 0, params.getColumnPos(6)); 2280 assertEquals("10 key fix 5 L2 [8]", 1, params.getColumnPos(7)); 2281 assertEquals("10 key fix 5 L2 [9]", 2, params.getColumnPos(8)); 2282 assertEquals("10 key fix 5 L2 [A]", 3, params.getColumnPos(9)); 2283 assertEquals("10 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 2284 assertEquals("10 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2285 } 2286 2287 // [6] [7] [8] [9] [A]| 2288 // [1] [2] [3] [4] <5>| 2289 public void testLayout10KeyFix5R0() { 2290 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R0); 2291 assertEquals("10 key fix 5 R0 columns", 5, params.mNumColumns); 2292 assertEquals("10 key fix 5 R0 rows", 2, params.mNumRows); 2293 assertEquals("10 key fix 5 R0 left", 4, params.mLeftKeys); 2294 assertEquals("10 key fix 5 R0 right", 1, params.mRightKeys); 2295 assertEquals("10 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2296 assertEquals("10 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2297 assertEquals("10 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2298 assertEquals("10 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2299 assertEquals("10 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2300 assertEquals("10 key fix 5 R0 [6]", -4, params.getColumnPos(5)); 2301 assertEquals("10 key fix 5 R0 [7]", -3, params.getColumnPos(6)); 2302 assertEquals("10 key fix 5 R0 [8]", -2, params.getColumnPos(7)); 2303 assertEquals("10 key fix 5 R0 [9]", -1, params.getColumnPos(8)); 2304 assertEquals("10 key fix 5 R0 [A]", 0, params.getColumnPos(9)); 2305 assertEquals("10 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2306 assertEquals("10 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2307 } 2308 2309 // [6] [7] [8] [9] [A] ___| 2310 // [1] [2] [3] [4] <5> ___| 2311 public void testLayout10KeyFix5R1() { 2312 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R1); 2313 assertEquals("10 key fix 5 R1 columns", 5, params.mNumColumns); 2314 assertEquals("10 key fix 5 R1 rows", 2, params.mNumRows); 2315 assertEquals("10 key fix 5 R1 left", 4, params.mLeftKeys); 2316 assertEquals("10 key fix 5 R1 right", 1, params.mRightKeys); 2317 assertEquals("10 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2318 assertEquals("10 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2319 assertEquals("10 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2320 assertEquals("10 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2321 assertEquals("10 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2322 assertEquals("10 key fix 5 R1 [6]", -4, params.getColumnPos(5)); 2323 assertEquals("10 key fix 5 R1 [7]", -3, params.getColumnPos(6)); 2324 assertEquals("10 key fix 5 R1 [8]", -2, params.getColumnPos(7)); 2325 assertEquals("10 key fix 5 R1 [9]", -1, params.getColumnPos(8)); 2326 assertEquals("10 key fix 5 R1 [A]", 0, params.getColumnPos(9)); 2327 assertEquals("10 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2328 assertEquals("10 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2329 } 2330 2331 // [6] [7] [8] [9] [A] ___| 2332 // [1] [2] [3] <4> [5] ___| 2333 public void testLayout10KeyFix5R2() { 2334 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R2); 2335 assertEquals("10 key fix 5 R2 columns", 5, params.mNumColumns); 2336 assertEquals("10 key fix 5 R2 rows", 2, params.mNumRows); 2337 assertEquals("10 key fix 5 R2 left", 3, params.mLeftKeys); 2338 assertEquals("10 key fix 5 R2 right", 2, params.mRightKeys); 2339 assertEquals("10 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2340 assertEquals("10 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2341 assertEquals("10 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2342 assertEquals("10 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2343 assertEquals("10 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2344 assertEquals("10 key fix 5 R2 [6]", -3, params.getColumnPos(5)); 2345 assertEquals("10 key fix 5 R2 [7]", -2, params.getColumnPos(6)); 2346 assertEquals("10 key fix 5 R2 [8]", -1, params.getColumnPos(7)); 2347 assertEquals("10 key fix 5 R2 [9]", 0, params.getColumnPos(8)); 2348 assertEquals("10 key fix 5 R2 [A]", 1, params.getColumnPos(9)); 2349 assertEquals("10 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 2350 assertEquals("10 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2351 } 2352 2353 // [B] 2354 // [6] [7] [8] [9] [A] 2355 // [1] [2] <3> [4] [5] 2356 public void testLayout11KeyFix5M0() { 2357 MoreKeysKeyboardParams params = createParams(11, 5, XPOS_M0); 2358 assertEquals("11 key fix 5 M0 columns", 5, params.mNumColumns); 2359 assertEquals("11 key fix 5 M0 rows", 3, params.mNumRows); 2360 assertEquals("11 key fix 5 M0 left", 2, params.mLeftKeys); 2361 assertEquals("11 key fix 5 M0 right", 3, params.mRightKeys); 2362 assertEquals("11 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2363 assertEquals("11 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2364 assertEquals("11 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2365 assertEquals("11 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2366 assertEquals("11 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2367 assertEquals("11 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2368 assertEquals("11 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2369 assertEquals("11 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2370 assertEquals("11 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2371 assertEquals("11 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2372 assertEquals("11 key fix 5 M0 [B]", 0, params.getColumnPos(10)); 2373 assertEquals("11 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2374 assertEquals("11 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2375 } 2376 2377 // [B] [C] 2378 // [6] [7] [8] [9] [A] 2379 // [1] [2] <3> [4] [5] 2380 public void testLayout12KeyFix5M0() { 2381 MoreKeysKeyboardParams params = createParams(12, 5, XPOS_M0); 2382 assertEquals("12 key fix 5 M0 columns", 5, params.mNumColumns); 2383 assertEquals("12 key fix 5 M0 rows", 3, params.mNumRows); 2384 assertEquals("12 key fix 5 M0 left", 2, params.mLeftKeys); 2385 assertEquals("12 key fix 5 M0 right", 3, params.mRightKeys); 2386 assertEquals("12 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2387 assertEquals("12 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2388 assertEquals("12 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2389 assertEquals("12 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2390 assertEquals("12 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2391 assertEquals("12 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2392 assertEquals("12 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2393 assertEquals("12 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2394 assertEquals("12 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2395 assertEquals("12 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2396 assertEquals("12 key fix 5 M0 [B]", 0, params.getColumnPos(10)); 2397 assertEquals("12 key fix 5 M0 [C]", 1, params.getColumnPos(11)); 2398 assertEquals("12 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2399 assertEquals("12 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2400 } 2401 2402 // [B] [C] [D] 2403 // [6] [7] [8] [9] [A] 2404 // [1] [2] <3> [4] [5] 2405 public void testLayout13KeyFix5M0() { 2406 MoreKeysKeyboardParams params = createParams(13, 5, XPOS_M0); 2407 assertEquals("13 key fix 5 M0 columns", 5, params.mNumColumns); 2408 assertEquals("13 key fix 5 M0 rows", 3, params.mNumRows); 2409 assertEquals("13 key fix 5 M0 left", 2, params.mLeftKeys); 2410 assertEquals("13 key fix 5 M0 right", 3, params.mRightKeys); 2411 assertEquals("13 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2412 assertEquals("13 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2413 assertEquals("13 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2414 assertEquals("13 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2415 assertEquals("13 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2416 assertEquals("13 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2417 assertEquals("13 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2418 assertEquals("13 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2419 assertEquals("13 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2420 assertEquals("13 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2421 assertEquals("13 key fix 5 M0 [B]", -1, params.getColumnPos(10)); 2422 assertEquals("13 key fix 5 M0 [C]", 0, params.getColumnPos(11)); 2423 assertEquals("13 key fix 5 M0 [D]", 1, params.getColumnPos(12)); 2424 assertEquals("13 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2425 assertEquals("13 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2426 } 2427 2428 // [B] [C] [D] [E] 2429 // [6] [7] [8] [9] [A] 2430 // [1] [2] <3> [4] [5] 2431 public void testLayout14KeyFix5M0() { 2432 MoreKeysKeyboardParams params = createParams(14, 5, XPOS_M0); 2433 assertEquals("14 key fix 5 M0 columns", 5, params.mNumColumns); 2434 assertEquals("14 key fix 5 M0 rows", 3, params.mNumRows); 2435 assertEquals("14 key fix 5 M0 left", 2, params.mLeftKeys); 2436 assertEquals("14 key fix 5 M0 right", 3, params.mRightKeys); 2437 assertEquals("14 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2438 assertEquals("14 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2439 assertEquals("14 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2440 assertEquals("14 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2441 assertEquals("14 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2442 assertEquals("14 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2443 assertEquals("14 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2444 assertEquals("14 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2445 assertEquals("14 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2446 assertEquals("14 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2447 assertEquals("14 key fix 5 M0 [B]", -1, params.getColumnPos(10)); 2448 assertEquals("14 key fix 5 M0 [C]", 0, params.getColumnPos(11)); 2449 assertEquals("14 key fix 5 M0 [D]", 1, params.getColumnPos(12)); 2450 assertEquals("14 key fix 5 M0 [E]", 2, params.getColumnPos(13)); 2451 assertEquals("14 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2452 assertEquals("14 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2453 } 2454 2455 // |<1> [2] [3] [4] [5] [6] [7] 2456 public void testLayout7KeyFix7L0() { 2457 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L0); 2458 assertEquals("7 key fix 7 L0 columns", 7, params.mNumColumns); 2459 assertEquals("7 key fix 7 L0 rows", 1, params.mNumRows); 2460 assertEquals("7 key fix 7 L0 left", 0, params.mLeftKeys); 2461 assertEquals("7 key fix 7 L0 right", 7, params.mRightKeys); 2462 assertEquals("7 key fix 7 L0 <1>", 0, params.getColumnPos(0)); 2463 assertEquals("7 key fix 7 L0 [2]", 1, params.getColumnPos(1)); 2464 assertEquals("7 key fix 7 L0 [3]", 2, params.getColumnPos(2)); 2465 assertEquals("7 key fix 7 L0 [4]", 3, params.getColumnPos(3)); 2466 assertEquals("7 key fix 7 L0 [5]", 4, params.getColumnPos(4)); 2467 assertEquals("7 key fix 7 L0 [6]", 5, params.getColumnPos(5)); 2468 assertEquals("7 key fix 7 L0 [7]", 6, params.getColumnPos(6)); 2469 assertEquals("7 key fix 7 L0 adjust", 0, params.mTopRowAdjustment); 2470 assertEquals("7 key fix 7 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2471 } 2472 2473 // |___ <1> [2] [3] [4] [5] [6] [7] 2474 public void testLayout7KeyFix7L1() { 2475 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L1); 2476 assertEquals("7 key fix 7 L1 columns", 7, params.mNumColumns); 2477 assertEquals("7 key fix 7 L1 rows", 1, params.mNumRows); 2478 assertEquals("7 key fix 7 L1 left", 0, params.mLeftKeys); 2479 assertEquals("7 key fix 7 L1 right", 7, params.mRightKeys); 2480 assertEquals("7 key fix 7 L1 <1>", 0, params.getColumnPos(0)); 2481 assertEquals("7 key fix 7 L1 [2]", 1, params.getColumnPos(1)); 2482 assertEquals("7 key fix 7 L1 [3]", 2, params.getColumnPos(2)); 2483 assertEquals("7 key fix 7 L1 [4]", 3, params.getColumnPos(3)); 2484 assertEquals("7 key fix 7 L1 [5]", 4, params.getColumnPos(4)); 2485 assertEquals("7 key fix 7 L1 [6]", 5, params.getColumnPos(5)); 2486 assertEquals("7 key fix 7 L1 [7]", 6, params.getColumnPos(6)); 2487 assertEquals("7 key fix 7 L1 adjust", 0, params.mTopRowAdjustment); 2488 assertEquals("7 key fix 7 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2489 } 2490 2491 // |___ [1] <2> [3] [4] [5] [6] [7] 2492 public void testLayout7KeyFix7L2() { 2493 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L2); 2494 assertEquals("7 key fix 7 L2 columns", 7, params.mNumColumns); 2495 assertEquals("7 key fix 7 L2 rows", 1, params.mNumRows); 2496 assertEquals("7 key fix 7 L2 left", 1, params.mLeftKeys); 2497 assertEquals("7 key fix 7 L2 right", 6, params.mRightKeys); 2498 assertEquals("7 key fix 7 L2 [1]", -1, params.getColumnPos(0)); 2499 assertEquals("7 key fix 7 L2 <2>", 0, params.getColumnPos(1)); 2500 assertEquals("7 key fix 7 L2 [3]", 1, params.getColumnPos(2)); 2501 assertEquals("7 key fix 7 L2 [4]", 2, params.getColumnPos(3)); 2502 assertEquals("7 key fix 7 L2 [5]", 3, params.getColumnPos(4)); 2503 assertEquals("7 key fix 7 L2 [6]", 4, params.getColumnPos(5)); 2504 assertEquals("7 key fix 7 L2 [7]", 5, params.getColumnPos(6)); 2505 assertEquals("7 key fix 7 L2 adjust", 0, params.mTopRowAdjustment); 2506 assertEquals("7 key fix 7 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2507 } 2508 2509 // |___ [1] [2] <3> [4] [5] [6] [7] 2510 public void testLayout7KeyFix7L3() { 2511 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L3); 2512 assertEquals("7 key fix 7 L3 columns", 7, params.mNumColumns); 2513 assertEquals("7 key fix 7 L3 rows", 1, params.mNumRows); 2514 assertEquals("7 key fix 7 L3 left", 2, params.mLeftKeys); 2515 assertEquals("7 key fix 7 L3 right", 5, params.mRightKeys); 2516 assertEquals("7 key fix 7 L3 [1]", -2, params.getColumnPos(0)); 2517 assertEquals("7 key fix 7 L3 [2]", -1, params.getColumnPos(1)); 2518 assertEquals("7 key fix 7 L3 <3>", 0, params.getColumnPos(2)); 2519 assertEquals("7 key fix 7 L3 [4]", 1, params.getColumnPos(3)); 2520 assertEquals("7 key fix 7 L3 [5]", 2, params.getColumnPos(4)); 2521 assertEquals("7 key fix 7 L3 [6]", 3, params.getColumnPos(5)); 2522 assertEquals("7 key fix 7 L3 [7]", 4, params.getColumnPos(6)); 2523 assertEquals("7 key fix 7 L3 adjust", 0, params.mTopRowAdjustment); 2524 assertEquals("7 key fix 7 L3 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2525 } 2526 2527 // |___ [1] [2] [3] <4> [5] [6] [7] ___ ___| 2528 public void testLayout7KeyFix7M0() { 2529 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M0); 2530 assertEquals("7 key fix 7 M0 columns", 7, params.mNumColumns); 2531 assertEquals("7 key fix 7 M0 rows", 1, params.mNumRows); 2532 assertEquals("7 key fix 7 M0 left", 3, params.mLeftKeys); 2533 assertEquals("7 key fix 7 M0 right", 4, params.mRightKeys); 2534 assertEquals("7 key fix 7 M0 [1]", -3, params.getColumnPos(0)); 2535 assertEquals("7 key fix 7 M0 [2]", -2, params.getColumnPos(1)); 2536 assertEquals("7 key fix 7 M0 [3]", -1, params.getColumnPos(2)); 2537 assertEquals("7 key fix 7 M0 <4>", 0, params.getColumnPos(3)); 2538 assertEquals("7 key fix 7 M0 [5]", 1, params.getColumnPos(4)); 2539 assertEquals("7 key fix 7 M0 [6]", 2, params.getColumnPos(5)); 2540 assertEquals("7 key fix 7 M0 [7]", 3, params.getColumnPos(6)); 2541 assertEquals("7 key fix 7 M0 adjust", 0, params.mTopRowAdjustment); 2542 assertEquals("7 key fix 7 M0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2543 } 2544 2545 // |___ ___ [1] [2] [3] <4> [5] [6] [7] ___| 2546 public void testLayout7KeyFix7M1() { 2547 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M1); 2548 assertEquals("7 key fix 7 M1 columns", 7, params.mNumColumns); 2549 assertEquals("7 key fix 7 M1 rows", 1, params.mNumRows); 2550 assertEquals("7 key fix 7 M1 left", 3, params.mLeftKeys); 2551 assertEquals("7 key fix 7 M1 right", 4, params.mRightKeys); 2552 assertEquals("7 key fix 7 M1 [1]", -3, params.getColumnPos(0)); 2553 assertEquals("7 key fix 7 M1 [2]", -2, params.getColumnPos(1)); 2554 assertEquals("7 key fix 7 M1 [3]", -1, params.getColumnPos(2)); 2555 assertEquals("7 key fix 7 M1 <4>", 0, params.getColumnPos(3)); 2556 assertEquals("7 key fix 7 M1 [5]", 1, params.getColumnPos(4)); 2557 assertEquals("7 key fix 7 M1 [6]", 2, params.getColumnPos(5)); 2558 assertEquals("7 key fix 7 M1 [7]", 3, params.getColumnPos(6)); 2559 assertEquals("7 key fix 7 M1 adjust", 0, params.mTopRowAdjustment); 2560 assertEquals("7 key fix 7 M1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2561 } 2562 2563 // [1] [2] [3] [4] <5> [6] [7] ___| 2564 public void testLayout7KeyFix7R3() { 2565 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R3); 2566 assertEquals("7 key fix 7 R3 columns", 7, params.mNumColumns); 2567 assertEquals("7 key fix 7 R3 rows", 1, params.mNumRows); 2568 assertEquals("7 key fix 7 R3 left", 4, params.mLeftKeys); 2569 assertEquals("7 key fix 7 R3 right", 3, params.mRightKeys); 2570 assertEquals("7 key fix 7 R3 [1]", -4, params.getColumnPos(0)); 2571 assertEquals("7 key fix 7 R3 [2]", -3, params.getColumnPos(1)); 2572 assertEquals("7 key fix 7 R3 [3]", -2, params.getColumnPos(2)); 2573 assertEquals("7 key fix 7 R3 [4]", -1, params.getColumnPos(3)); 2574 assertEquals("7 key fix 7 R3 <5>", 0, params.getColumnPos(4)); 2575 assertEquals("7 key fix 7 R3 [6]", 1, params.getColumnPos(5)); 2576 assertEquals("7 key fix 7 R3 [7]", 2, params.getColumnPos(6)); 2577 assertEquals("7 key fix 7 R3 adjust", 0, params.mTopRowAdjustment); 2578 assertEquals("7 key fix 7 R3 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2579 } 2580 2581 // [1] [2] [3] [4] [5] <6> [7] ___| 2582 public void testLayout7KeyFix7R2() { 2583 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R2); 2584 assertEquals("7 key fix 7 R2 columns", 7, params.mNumColumns); 2585 assertEquals("7 key fix 7 R2 rows", 1, params.mNumRows); 2586 assertEquals("7 key fix 7 R2 left", 5, params.mLeftKeys); 2587 assertEquals("7 key fix 7 R2 right", 2, params.mRightKeys); 2588 assertEquals("7 key fix 7 R2 [1]", -5, params.getColumnPos(0)); 2589 assertEquals("7 key fix 7 R2 [2]", -4, params.getColumnPos(1)); 2590 assertEquals("7 key fix 7 R2 [3]", -3, params.getColumnPos(2)); 2591 assertEquals("7 key fix 7 R2 [4]", -2, params.getColumnPos(3)); 2592 assertEquals("7 key fix 7 R2 [5]", -1, params.getColumnPos(4)); 2593 assertEquals("7 key fix 7 R2 <6>", 0, params.getColumnPos(5)); 2594 assertEquals("7 key fix 7 R2 [7]", 1, params.getColumnPos(6)); 2595 assertEquals("7 key fix 7 R2 adjust", 0, params.mTopRowAdjustment); 2596 assertEquals("7 key fix 7 R2 default", WIDTH * 5, params.getDefaultKeyCoordX()); 2597 } 2598 2599 // [1] [2] [3] [4] [5] [6] <7> ___| 2600 public void testLayout7KeyFix7R1() { 2601 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R1); 2602 assertEquals("7 key fix 7 R1 columns", 7, params.mNumColumns); 2603 assertEquals("7 key fix 7 R1 rows", 1, params.mNumRows); 2604 assertEquals("7 key fix 7 R1 left", 6, params.mLeftKeys); 2605 assertEquals("7 key fix 7 R1 right", 1, params.mRightKeys); 2606 assertEquals("7 key fix 7 R1 [1]", -6, params.getColumnPos(0)); 2607 assertEquals("7 key fix 7 R1 [2]", -5, params.getColumnPos(1)); 2608 assertEquals("7 key fix 7 R1 [3]", -4, params.getColumnPos(2)); 2609 assertEquals("7 key fix 7 R1 [4]", -3, params.getColumnPos(3)); 2610 assertEquals("7 key fix 7 R1 [5]", -2, params.getColumnPos(4)); 2611 assertEquals("7 key fix 7 R1 [6]", -1, params.getColumnPos(5)); 2612 assertEquals("7 key fix 7 R1 <7>", 0, params.getColumnPos(6)); 2613 assertEquals("7 key fix 7 R1 adjust", 0, params.mTopRowAdjustment); 2614 assertEquals("7 key fix 7 R1 default", WIDTH * 6, params.getDefaultKeyCoordX()); 2615 } 2616 2617 // [1] [2] [3] [4] [5] [6] <7>| 2618 public void testLayout7KeyFix7R0() { 2619 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R0); 2620 assertEquals("7 key fix 7 R0 columns", 7, params.mNumColumns); 2621 assertEquals("7 key fix 7 R0 rows", 1, params.mNumRows); 2622 assertEquals("7 key fix 7 R0 left", 6, params.mLeftKeys); 2623 assertEquals("7 key fix 7 R0 right", 1, params.mRightKeys); 2624 assertEquals("7 key fix 7 R0 [1]", -6, params.getColumnPos(0)); 2625 assertEquals("7 key fix 7 R0 [2]", -5, params.getColumnPos(1)); 2626 assertEquals("7 key fix 7 R0 [3]", -4, params.getColumnPos(2)); 2627 assertEquals("7 key fix 7 R0 [4]", -3, params.getColumnPos(3)); 2628 assertEquals("7 key fix 7 R0 [5]", -2, params.getColumnPos(4)); 2629 assertEquals("7 key fix 7 R0 [6]", -1, params.getColumnPos(5)); 2630 assertEquals("7 key fix 7 R0 <7>", 0, params.getColumnPos(6)); 2631 assertEquals("7 key fix 7 R0 adjust", 0, params.mTopRowAdjustment); 2632 assertEquals("7 key fix 7 R0 default", WIDTH * 6, params.getDefaultKeyCoordX()); 2633 } 2634 } 2635