From 4a9e8bf78a7b36a25924bbd116b58ceb3d95737d Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 30 Jan 2016 14:00:28 +0100 Subject: [PATCH] Fixes --- .../android/calculator/FloatingCalculatorKeyboard.java | 2 +- .../android/calculator/functions/FunctionsActivity.java | 4 +++- .../android/calculator/variables/GreekFloatingKeyboard.java | 2 +- .../android/calculator/variables/VariablesActivity.java | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/FloatingCalculatorKeyboard.java b/app/src/main/java/org/solovyev/android/calculator/FloatingCalculatorKeyboard.java index bffff88a..9306bd9e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/FloatingCalculatorKeyboard.java +++ b/app/src/main/java/org/solovyev/android/calculator/FloatingCalculatorKeyboard.java @@ -172,6 +172,7 @@ public class FloatingCalculatorKeyboard extends BaseFloatingKeyboard { @Override public void onClick(@NonNull View v) { + v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); switch (v.getId()) { case R.id.cpp_kb_button_divide: user.insertOperator('/'); @@ -215,7 +216,6 @@ public class FloatingCalculatorKeyboard extends BaseFloatingKeyboard { break; } user.getEditor().requestFocus(); - v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); } private void onDefaultClick(@NonNull View v) { diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java index 0676e2a4..0e1cc0ff 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java @@ -52,7 +52,9 @@ public class FunctionsActivity extends BaseActivity { if (savedInstanceState == null) { final Bundle extras = getIntent().getExtras(); final CppFunction function = extras != null ? (CppFunction) extras.getParcelable(EXTRA_FUNCTION) : null; - EditFunctionFragment.showDialog(function, this); + if (function != null) { + EditFunctionFragment.showDialog(function, this); + } } } diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/GreekFloatingKeyboard.java b/app/src/main/java/org/solovyev/android/calculator/variables/GreekFloatingKeyboard.java index b15e610a..62515e36 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/GreekFloatingKeyboard.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/GreekFloatingKeyboard.java @@ -118,6 +118,7 @@ public class GreekFloatingKeyboard extends BaseFloatingKeyboard implements View. @Override public void onClick(View v) { + v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); switch (v.getId()) { case R.id.cpp_kb_button_close: user.done(); @@ -137,7 +138,6 @@ public class GreekFloatingKeyboard extends BaseFloatingKeyboard implements View. break; } user.getEditor().requestFocus(); - v.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP); } private void changeCase(@NonNull Button button) { diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java index 73ed8b11..f80b5497 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java @@ -49,7 +49,9 @@ public class VariablesActivity extends BaseActivity implements CalculatorEventLi if (savedInstanceState == null) { final Bundle extras = getIntent().getExtras(); final CppVariable variable = extras != null ? (CppVariable) extras.getParcelable(EXTRA_VARIABLE) : null; - EditVariableFragment.showDialog(variable, this); + if (variable != null) { + EditVariableFragment.showDialog(variable, this); + } } }