Show toolbar when DEG/RAD mode matters
Bug: 27926287
Bug: 28086262
Continue to show the toolbar when entering a formula containing trig
function calls.
This also changes the toolbar hiding logic a bit to make physical
keyboard input more like button presses.
No longer makes the tool bar visible on a long press, reserving
that for COPY or PASTE.
Change-Id: I30cb3d747e45b8fe24e35b20805a1d04bdf7b8c9
diff --git a/src/com/android/calculator2/KeyMaps.java b/src/com/android/calculator2/KeyMaps.java
index 896225a..6a12f80 100644
--- a/src/com/android/calculator2/KeyMaps.java
+++ b/src/com/android/calculator2/KeyMaps.java
@@ -183,10 +183,10 @@
}
/**
- * Does a button id correspond to a function that introduces an implicit lparen?
+ * Does a button id correspond to a trig function?
* Pure function.
*/
- public static boolean isFunc(int id) {
+ public static boolean isTrigFunc(int id) {
switch(id) {
case R.id.fun_sin:
case R.id.fun_cos:
@@ -194,6 +194,21 @@
case R.id.fun_arcsin:
case R.id.fun_arccos:
case R.id.fun_arctan:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Does a button id correspond to a function that introduces an implicit lparen?
+ * Pure function.
+ */
+ public static boolean isFunc(int id) {
+ if (isTrigFunc(id)) {
+ return true;
+ }
+ switch(id) {
case R.id.fun_ln:
case R.id.fun_log:
case R.id.fun_exp: