diff --git a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocator.java b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocator.java index 0d911403..ef3f49a1 100644 --- a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocator.java +++ b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocator.java @@ -16,7 +16,8 @@ public interface CalculatorLocator { @NotNull CalculatorNotifier notifier, @NotNull CalculatorHistory history, @NotNull CalculatorLogger logger, - @NotNull CalculatorPreferenceService preferenceService); + @NotNull CalculatorPreferenceService preferenceService, + @NotNull CalculatorKeyboard keyboard); @NotNull Calculator getCalculator(); diff --git a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocatorImpl.java b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocatorImpl.java index 68d519ab..e427a45e 100644 --- a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocatorImpl.java +++ b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorLocatorImpl.java @@ -53,7 +53,8 @@ public class CalculatorLocatorImpl implements CalculatorLocator { @NotNull CalculatorNotifier notifier, @NotNull CalculatorHistory history, @NotNull CalculatorLogger logger, - @NotNull CalculatorPreferenceService preferenceService) { + @NotNull CalculatorPreferenceService preferenceService, + @NotNull CalculatorKeyboard keyboard) { this.calculator = calculator; this.calculatorEngine = engine; @@ -65,7 +66,7 @@ public class CalculatorLocatorImpl implements CalculatorLocator { calculatorEditor = new CalculatorEditorImpl(this.calculator); calculatorDisplay = new CalculatorDisplayImpl(this.calculator); - calculatorKeyboard = new CalculatorKeyboardImpl(this.calculator); + calculatorKeyboard = keyboard; } @NotNull diff --git a/calculatorpp-core/src/test/java/org/solovyev/android/calculator/AbstractCalculatorTest.java b/calculatorpp-core/src/test/java/org/solovyev/android/calculator/AbstractCalculatorTest.java index 80547dbe..4483804e 100644 --- a/calculatorpp-core/src/test/java/org/solovyev/android/calculator/AbstractCalculatorTest.java +++ b/calculatorpp-core/src/test/java/org/solovyev/android/calculator/AbstractCalculatorTest.java @@ -11,7 +11,7 @@ import org.solovyev.android.calculator.history.CalculatorHistory; public class AbstractCalculatorTest { protected void setUp() throws Exception { - CalculatorLocatorImpl.getInstance().init(new CalculatorImpl(), CalculatorTestUtils.newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class)); + CalculatorLocatorImpl.getInstance().init(new CalculatorImpl(), CalculatorTestUtils.newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class), Mockito.mock(CalculatorKeyboard.class)); CalculatorLocatorImpl.getInstance().getEngine().init(); } diff --git a/calculatorpp-core/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java b/calculatorpp-core/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java index 01f02041..d024db58 100644 --- a/calculatorpp-core/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java +++ b/calculatorpp-core/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java @@ -23,7 +23,7 @@ public class CalculatorTestUtils { public static final int TIMEOUT = 3; public static void staticSetUp() throws Exception { - CalculatorLocatorImpl.getInstance().init(new CalculatorImpl(), newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class)); + CalculatorLocatorImpl.getInstance().init(new CalculatorImpl(), newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class), Mockito.mock(CalculatorKeyboard.class)); CalculatorLocatorImpl.getInstance().getEngine().init(); } diff --git a/calculatorpp/res/layout/function_add_param.xml b/calculatorpp/res/layout/function_add_param.xml index 9846a28e..8c1232c0 100644 --- a/calculatorpp/res/layout/function_add_param.xml +++ b/calculatorpp/res/layout/function_add_param.xml @@ -8,7 +8,13 @@