Skip to content
Snippets Groups Projects
Commit a2dbc448 authored by Sandeep Siddhartha's avatar Sandeep Siddhartha Committed by Android (Google) Code Review
Browse files

Merge "Handle split layout tests for phones"

parents 064ba6bc b036224d
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.inputmethod.keyboard.layout.tests;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import java.util.Locale;
public class EnglishSplitCustomizer extends EnglishCustomizer {
EnglishSplitCustomizer(Locale locale) {
super(locale);
}
@Override
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
return LayoutBase.joinKeys(
LayoutBase.LANGUAGE_SWITCH_KEY, LayoutBase.SPACE_KEY, LayoutBase.SPACE_KEY);
}
}
...@@ -23,6 +23,7 @@ import android.view.inputmethod.InputMethodSubtype; ...@@ -23,6 +23,7 @@ import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.keyboard.KeyboardLayoutSet; import com.android.inputmethod.keyboard.KeyboardLayoutSet;
import com.android.inputmethod.keyboard.layout.LayoutBase; import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty; import com.android.inputmethod.keyboard.layout.Qwerty;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import java.util.Locale; import java.util.Locale;
...@@ -44,4 +45,20 @@ public class TestsSplitLayoutQwertyEnglishUS extends LayoutTestsBase { ...@@ -44,4 +45,20 @@ public class TestsSplitLayoutQwertyEnglishUS extends LayoutTestsBase {
@Override @Override
LayoutBase getLayout() { return LAYOUT; } LayoutBase getLayout() { return LAYOUT; }
private static class EnglishSplitCustomizer extends EnglishCustomizer {
EnglishSplitCustomizer(Locale locale) {
super(locale);
}
@Override
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
if (isPhone) {
return super.getSpaceKeys(isPhone);
} else {
return LayoutBase.joinKeys(
LayoutBase.LANGUAGE_SWITCH_KEY, LayoutBase.SPACE_KEY, LayoutBase.SPACE_KEY);
}
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment