summaryrefslogtreecommitdiffstats
path: root/res/layout
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2015-05-31 12:19:05 -0700
committerHans Boehm <hboehm@google.com>2015-06-02 11:51:09 -0700
commit4db31b490443e4454d98a5ae2bc44b87149accfe (patch)
tree9843640804505c092ea1f883928b5871f7b56591 /res/layout
parente125edff83b7f73cadaa7a0a007cccec6bd059b2 (diff)
downloadandroid_packages_apps_ExactCalculator-4db31b490443e4454d98a5ae2bc44b87149accfe.tar.gz
android_packages_apps_ExactCalculator-4db31b490443e4454d98a5ae2bc44b87149accfe.tar.bz2
android_packages_apps_ExactCalculator-4db31b490443e4454d98a5ae2bc44b87149accfe.zip
Implement percent and new inverse functions
Bug: 21493470 Add x^2 10^x and e^x functions, to make the recently added INV key work as expected. Implement % functionality. 10^x is essentially just macro expansions for now. % and x^2 need trivial evaluator support to provide reasonable display syntax. We decided to add evaluator support for exp() as well. Add corresponding exp() support to BoundedRational and its tests. Tiny incidental changes for problems uncovered in the process: Fix bug in tests/README.txt Evaluate the constant e only once. Add one more power test along with the exp() test. Fix proguard.flags so BRTest runs again. Change-Id: I26cfcaf6d99aeec11387297cc5586e2ddcab6add
Diffstat (limited to 'res/layout')
-rw-r--r--res/layout/pad_advanced.xml27
-rw-r--r--res/layout/pad_advanced_tablet_port.xml27
2 files changed, 54 insertions, 0 deletions
diff --git a/res/layout/pad_advanced.xml b/res/layout/pad_advanced.xml
index bd2f30a..0d6168a 100644
--- a/res/layout/pad_advanced.xml
+++ b/res/layout/pad_advanced.xml
@@ -107,6 +107,15 @@
android:text="@string/fun_ln" />
<Button
+ android:id="@+id/fun_exp"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="2"
+ android:layout_column="0"
+ android:contentDescription="@string/desc_fun_exp"
+ android:text="@string/fun_exp"
+ android:visibility="gone" />
+
+ <Button
android:id="@+id/fun_log"
style="@style/PadButtonStyle.Advanced"
android:layout_row="2"
@@ -115,6 +124,15 @@
android:text="@string/fun_log" />
<Button
+ android:id="@+id/fun_10pow"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="2"
+ android:layout_column="1"
+ android:contentDescription="@string/desc_fun_10pow"
+ android:text="@string/fun_10pow"
+ android:visibility="gone" />
+
+ <Button
android:id="@+id/op_fact"
style="@style/PadButtonStyle.Advanced"
android:layout_row="2"
@@ -170,4 +188,13 @@
android:contentDescription="@string/desc_op_sqrt"
android:text="@string/op_sqrt" />
+ <Button
+ android:id="@+id/op_sqr"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="4"
+ android:layout_column="2"
+ android:contentDescription="@string/desc_op_sqr"
+ android:text="@string/op_sqr"
+ android:visibility="gone" />
+
</GridLayout>
diff --git a/res/layout/pad_advanced_tablet_port.xml b/res/layout/pad_advanced_tablet_port.xml
index 00b0a70..bccc44c 100644
--- a/res/layout/pad_advanced_tablet_port.xml
+++ b/res/layout/pad_advanced_tablet_port.xml
@@ -107,6 +107,15 @@
android:text="@string/fun_ln" />
<Button
+ android:id="@+id/fun_exp"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="1"
+ android:layout_column="1"
+ android:contentDescription="@string/desc_fun_exp"
+ android:text="@string/fun_exp"
+ android:visibility="gone" />
+
+ <Button
android:id="@+id/fun_log"
style="@style/PadButtonStyle.Advanced"
android:layout_row="1"
@@ -115,6 +124,15 @@
android:text="@string/fun_log" />
<Button
+ android:id="@+id/fun_10pow"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="1"
+ android:layout_column="2"
+ android:contentDescription="@string/desc_fun_10pow"
+ android:text="@string/fun_10pow"
+ android:visibility="gone" />
+
+ <Button
android:id="@+id/op_fact"
style="@style/PadButtonStyle.Advanced"
android:layout_row="1"
@@ -170,4 +188,13 @@
android:contentDescription="@string/desc_op_sqrt"
android:text="@string/op_sqrt" />
+ <Button
+ android:id="@+id/op_sqr"
+ style="@style/PadButtonStyle.Advanced"
+ android:layout_row="2"
+ android:layout_column="4"
+ android:contentDescription="@string/desc_op_sqr"
+ android:text="@string/op_sqr"
+ android:visibility="gone" />
+
</GridLayout>