cpp-124: Phone vibrates even if button action is not triggered

Vibration is now requested manually from places where needed

Fixes #124
This commit is contained in:
serso
2015-02-16 21:56:45 +01:00
parent 08add4f17e
commit 70f4ec953a
19 changed files with 141 additions and 82 deletions

View File

@@ -31,7 +31,7 @@ import javax.annotation.Nullable;
*/
public interface CalculatorKeyboard {
void buttonPressed(@Nullable String text);
boolean buttonPressed(@Nullable String text);
void roundBracketsButtonPressed();

View File

@@ -43,7 +43,7 @@ public class CalculatorKeyboardImpl implements CalculatorKeyboard {
}
@Override
public void buttonPressed(@Nullable final String text) {
public boolean buttonPressed(@Nullable final String text) {
if (!Strings.isEmpty(text)) {
if (text == null) throw new AssertionError();
@@ -53,7 +53,9 @@ public class CalculatorKeyboardImpl implements CalculatorKeyboard {
if (!processed) {
processText(prepareText(text));
}
return true;
}
return false;
}
private void processText(@Nonnull String text) {