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:
@@ -31,7 +31,7 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public interface CalculatorKeyboard {
|
||||
|
||||
void buttonPressed(@Nullable String text);
|
||||
boolean buttonPressed(@Nullable String text);
|
||||
|
||||
void roundBracketsButtonPressed();
|
||||
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user