Skip to content
Browse files

added function page

  • Loading branch information...
1 parent 05fe614 commit 36d0c18b214d9965e5f47ab517e50162bf9769b4 @Xlythe committed
Showing with 824 additions and 189 deletions.
  1. +9 −0 .classpath
  2. +33 −0 .project
  3. +6 −3 AndroidManifest.xml
  4. BIN arity-2.1.2.jar
  5. BIN bin/android_packages_apps_Calculator.apk
  6. BIN bin/classes.dex
  7. BIN bin/classes/com/android/calculator3/BuildConfig.class
  8. BIN bin/classes/com/android/calculator3/Calculator$PageAdapter.class
  9. BIN bin/classes/com/android/calculator3/Calculator.class
  10. BIN bin/classes/com/android/calculator3/CalculatorDisplay$1.class
  11. BIN bin/classes/com/android/calculator3/CalculatorDisplay$Scroll.class
  12. BIN bin/classes/com/android/calculator3/CalculatorDisplay.class
  13. BIN bin/classes/com/android/calculator3/CalculatorEditText$MenuHandler.class
  14. BIN bin/classes/com/android/calculator3/CalculatorEditText$NoTextSelectionMode.class
  15. BIN bin/classes/com/android/calculator3/CalculatorEditText.class
  16. BIN bin/classes/com/android/calculator3/CalculatorEditable$Factory.class
  17. BIN bin/classes/com/android/calculator3/CalculatorEditable.class
  18. BIN bin/classes/com/android/calculator3/CalculatorViewPager.class
  19. BIN bin/classes/com/android/calculator3/ColorButton.class
  20. BIN bin/classes/com/android/calculator3/EventListener.class
  21. BIN bin/classes/com/android/calculator3/History.class
  22. BIN bin/classes/com/android/calculator3/HistoryAdapter.class
  23. BIN bin/classes/com/android/calculator3/HistoryEntry.class
  24. BIN bin/classes/com/android/calculator3/Logic$Listener.class
  25. BIN bin/classes/com/android/calculator3/Logic.class
  26. BIN bin/classes/com/android/calculator3/PanelSwitcher$1.class
  27. BIN bin/classes/com/android/calculator3/PanelSwitcher$Listener.class
  28. BIN bin/classes/com/android/calculator3/PanelSwitcher.class
  29. BIN bin/classes/com/android/calculator3/Persist.class
  30. BIN bin/classes/com/android/calculator3/R$array.class
  31. BIN bin/classes/com/android/calculator3/R$attr.class
  32. BIN bin/classes/com/android/calculator3/R$color.class
  33. BIN bin/classes/com/android/calculator3/R$dimen.class
  34. BIN bin/classes/com/android/calculator3/R$drawable.class
  35. BIN bin/classes/com/android/calculator3/R$id.class
  36. BIN bin/classes/com/android/calculator3/R$integer.class
  37. BIN bin/classes/com/android/calculator3/R$layout.class
  38. BIN bin/classes/com/android/calculator3/R$menu.class
  39. BIN bin/classes/com/android/calculator3/R$mipmap.class
  40. BIN bin/classes/com/android/calculator3/R$string.class
  41. BIN bin/classes/com/android/calculator3/R$style.class
  42. BIN bin/classes/com/android/calculator3/R.class
  43. +3 −0 bin/jarlist.cache
  44. BIN bin/res/drawable-hdpi/advanced.png
  45. BIN bin/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png
  46. BIN bin/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png
  47. BIN bin/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png
  48. BIN bin/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png
  49. BIN bin/res/drawable-hdpi/calc_clear_symbol.png
  50. BIN bin/res/drawable-hdpi/calculator_input_field.9.png
  51. BIN bin/res/drawable-hdpi/clear_history.png
  52. BIN bin/res/drawable-hdpi/function.png
  53. BIN bin/res/drawable-hdpi/ic_menu_overflow.png
  54. BIN bin/res/drawable-hdpi/simple.png
  55. BIN bin/res/drawable-mdpi/advanced.png
  56. BIN bin/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png
  57. BIN bin/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png
  58. BIN bin/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png
  59. BIN bin/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png
  60. BIN bin/res/drawable-mdpi/calc_clear_symbol.png
  61. BIN bin/res/drawable-mdpi/calculator_input_field.9.png
  62. BIN bin/res/drawable-mdpi/clear_history.png
  63. BIN bin/res/drawable-mdpi/ic_menu_overflow.png
  64. BIN bin/res/drawable-mdpi/simple.png
  65. BIN bin/res/drawable-sw600dp-hdpi/calc_clear_symbol.png
  66. BIN bin/res/drawable-sw600dp-hdpi/calculator_input_field.9.png
  67. BIN bin/res/drawable-sw600dp-mdpi/calc_clear_symbol.png
  68. BIN bin/res/drawable-sw600dp-mdpi/calculator_input_field.9.png
  69. BIN bin/res/drawable-xhdpi/btn_keyboard_key_dark_normal_holo.9.png
  70. BIN bin/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_holo.9.png
  71. BIN bin/res/drawable-xhdpi/btn_keyboard_key_light_normal_holo.9.png
  72. BIN bin/res/drawable-xhdpi/btn_keyboard_key_light_pressed_holo.9.png
  73. BIN bin/res/drawable-xhdpi/calc_clear_symbol.png
  74. BIN bin/res/drawable-xhdpi/calculator_input_field.9.png
  75. BIN bin/res/drawable-xhdpi/ic_menu_overflow.png
  76. BIN bin/res/mipmap-hdpi/ic_launcher_calculator.png
  77. BIN bin/res/mipmap-mdpi/ic_launcher_calculator.png
  78. BIN bin/res/mipmap-xhdpi/ic_launcher_calculator.png
  79. BIN bin/resources.ap_
  80. +11 −0 default.properties
  81. +6 −0 gen/com/android/calculator3/BuildConfig.java
  82. +265 −0 gen/com/android/calculator3/R.java
  83. BIN libs/android-support-v4.jar
  84. BIN libs/arity-2.1.6.jar
  85. +14 −0 project.properties
  86. BIN res/drawable-hdpi/function.png
  87. +11 −11 res/layout-land/advanced_pad.xml
  88. +98 −0 res/layout-land/function_pad.xml
  89. +7 −7 res/layout-land/main.xml
  90. +18 −18 res/layout-land/simple_pad.xml
  91. +12 −12 res/layout-port/advanced_pad.xml
  92. +143 −0 res/layout-port/function_pad.xml
  93. +7 −7 res/layout-port/main.xml
  94. +16 −16 res/layout-port/simple_pad.xml
  95. +5 −0 res/menu/menu.xml
  96. +111 −93 res/values/strings.xml
  97. +35 −8 src/com/android/{calculator2 → calculator3}/Calculator.java
  98. +1 −1 src/com/android/{calculator2 → calculator3}/CalculatorDisplay.java
  99. +1 −1 src/com/android/{calculator2 → calculator3}/CalculatorEditText.java
  100. +1 −1 src/com/android/{calculator2 → calculator3}/CalculatorEditable.java
  101. +1 −1 src/com/android/{calculator2 → calculator3}/CalculatorViewPager.java
  102. +1 −1 src/com/android/{calculator2 → calculator3}/ColorButton.java
  103. +1 −1 src/com/android/{calculator2 → calculator3}/EventListener.java
  104. +1 −1 src/com/android/{calculator2 → calculator3}/History.java
  105. +1 −1 src/com/android/{calculator2 → calculator3}/HistoryAdapter.java
  106. +1 −1 src/com/android/{calculator2 → calculator3}/HistoryEntry.java
  107. +3 −3 src/com/android/{calculator2 → calculator3}/Logic.java
  108. +1 −1 src/com/android/{calculator2 → calculator3}/PanelSwitcher.java
  109. +1 −1 src/com/android/{calculator2 → calculator3}/Persist.java
View
9 .classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="lib" path="U:/workspace/android_packages_apps_Calculator/libs/arity-2.1.6.jar"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
33 .project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>android_packages_apps_Calculator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
9 AndroidManifest.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.calculator2">
+ package="com.android.calculator3"
+ android:versionCode="1"
+ android:versionName="1.0"
+ android:installLocation="auto">
- <original-package android:name="com.android.calculator2" />
+ <original-package android:name="com.android.calculator3" />
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher_calculator">
- <activity android:name="Calculator"
+ <activity android:name="com.android.calculator3.Calculator"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
View
BIN arity-2.1.2.jar
Binary file not shown.
View
BIN bin/android_packages_apps_Calculator.apk
Binary file not shown.
View
BIN bin/classes.dex
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/BuildConfig.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/Calculator$PageAdapter.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/Calculator.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorDisplay$1.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorDisplay$Scroll.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorDisplay.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorEditText$MenuHandler.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorEditText$NoTextSelectionMode.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorEditText.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorEditable$Factory.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorEditable.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/CalculatorViewPager.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/ColorButton.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/EventListener.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/History.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/HistoryAdapter.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/HistoryEntry.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/Logic$Listener.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/Logic.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/PanelSwitcher$1.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/PanelSwitcher$Listener.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/PanelSwitcher.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/Persist.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$array.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$attr.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$color.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$dimen.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$drawable.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$id.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$integer.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$layout.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$menu.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$mipmap.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$string.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R$style.class
Binary file not shown.
View
BIN bin/classes/com/android/calculator3/R.class
Binary file not shown.
View
3 bin/jarlist.cache
@@ -0,0 +1,3 @@
+# cache for current jar dependecy. DO NOT EDIT.
+# format is <lastModified> <length> <SHA-1> <path>
+# Encoding is UTF-8
View
BIN bin/res/drawable-hdpi/advanced.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/calc_clear_symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/calculator_input_field.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/clear_history.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/function.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/ic_menu_overflow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-hdpi/simple.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/advanced.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/calc_clear_symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/calculator_input_field.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/clear_history.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/ic_menu_overflow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-mdpi/simple.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-sw600dp-hdpi/calc_clear_symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-sw600dp-hdpi/calculator_input_field.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-sw600dp-mdpi/calc_clear_symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-sw600dp-mdpi/calculator_input_field.9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bin/res/drawable-xhdpi/btn_keyboard_key_dark_normal_holo.9.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_holo.9.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/btn_keyboard_key_light_normal_holo.9.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/btn_keyboard_key_light_pressed_holo.9.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/calc_clear_symbol.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/calculator_input_field.9.png
Diff not rendered.
View
BIN bin/res/drawable-xhdpi/ic_menu_overflow.png
Diff not rendered.
View
BIN bin/res/mipmap-hdpi/ic_launcher_calculator.png
Diff not rendered.
View
BIN bin/res/mipmap-mdpi/ic_launcher_calculator.png
Diff not rendered.
View
BIN bin/res/mipmap-xhdpi/ic_launcher_calculator.png
Diff not rendered.
View
BIN bin/resources.ap_
Binary file not shown.
View
11 default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
View
6 gen/com/android/calculator3/BuildConfig.java
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.android.calculator3;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
View
265 gen/com/android/calculator3/R.java
@@ -0,0 +1,265 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.android.calculator3;
+
+public final class R {
+ public static final class array {
+ public static final int advanced_buttons=0x7f050001;
+ public static final int buttons=0x7f050002;
+ public static final int simple_buttons=0x7f050000;
+ }
+ public static final class attr {
+ }
+ public static final class color {
+ public static final int button_text=0x7f060001;
+ public static final int magic_flame=0x7f060000;
+ }
+ public static final class dimen {
+ public static final int btn_clear_text_size=0x7f090003;
+ public static final int btn_digit_text_size=0x7f090000;
+ public static final int btn_function_text_size=0x7f090002;
+ public static final int btn_operation_text_size=0x7f090001;
+ public static final int display_text_size=0x7f090004;
+ public static final int group_padding=0x7f090007;
+ public static final int left_right_padding=0x7f090005;
+ public static final int top_bottom_padding=0x7f090006;
+ }
+ public static final class drawable {
+ public static final int advanced=0x7f020000;
+ public static final int btn_digit=0x7f020001;
+ public static final int btn_function=0x7f020002;
+ public static final int btn_keyboard_key_dark_normal_holo=0x7f020003;
+ public static final int btn_keyboard_key_dark_pressed_holo=0x7f020004;
+ public static final int btn_keyboard_key_light_normal_holo=0x7f020005;
+ public static final int btn_keyboard_key_light_pressed_holo=0x7f020006;
+ public static final int calc_clear_symbol=0x7f020007;
+ public static final int calculator_input_field=0x7f020008;
+ public static final int clear_history=0x7f020009;
+ public static final int function=0x7f02000a;
+ public static final int ic_menu_overflow=0x7f02000b;
+ public static final int simple=0x7f02000c;
+ }
+ public static final class id {
+ public static final int X=0x7f0c000d;
+ public static final int Y=0x7f0c000e;
+ public static final int Z=0x7f0c000f;
+ public static final int advanced=0x7f0c0038;
+ public static final int advancedPad=0x7f0c0000;
+ public static final int basic=0x7f0c0039;
+ public static final int clear=0x7f0c0022;
+ public static final int clear_history=0x7f0c0036;
+ public static final int cos=0x7f0c0002;
+ public static final int del=0x7f0c0023;
+ public static final int digit0=0x7f0c0031;
+ public static final int digit1=0x7f0c002d;
+ public static final int digit2=0x7f0c002e;
+ public static final int digit3=0x7f0c002f;
+ public static final int digit4=0x7f0c0029;
+ public static final int digit5=0x7f0c002a;
+ public static final int digit6=0x7f0c002b;
+ public static final int digit7=0x7f0c0025;
+ public static final int digit8=0x7f0c0026;
+ public static final int digit9=0x7f0c0027;
+ public static final int display=0x7f0c0020;
+ public static final int div=0x7f0c0028;
+ public static final int dot=0x7f0c0032;
+ public static final int dx=0x7f0c0011;
+ public static final int dy=0x7f0c0019;
+ public static final int dz=0x7f0c001b;
+ public static final int e=0x7f0c0008;
+ public static final int equal=0x7f0c0034;
+ public static final int factorial=0x7f0c0005;
+ public static final int fractionOrDecimal=0x7f0c001c;
+ public static final int function=0x7f0c0037;
+ public static final int functionPad=0x7f0c0017;
+ public static final int graph=0x7f0c0016;
+ public static final int historyExpr=0x7f0c001e;
+ public static final int historyResult=0x7f0c001f;
+ public static final int integral=0x7f0c0010;
+ public static final int leftParen=0x7f0c000b;
+ public static final int lg=0x7f0c0007;
+ public static final int ln=0x7f0c0006;
+ public static final int matrix=0x7f0c0015;
+ public static final int minus=0x7f0c0030;
+ public static final int mod=0x7f0c001a;
+ public static final int mul=0x7f0c002c;
+ public static final int overflow_menu=0x7f0c0021;
+ public static final int panelswitch=0x7f0c0024;
+ public static final int parentheses=0x7f0c0018;
+ public static final int pi=0x7f0c0004;
+ public static final int plus=0x7f0c0033;
+ public static final int power=0x7f0c0009;
+ public static final int rightParen=0x7f0c000c;
+ public static final int shapes=0x7f0c001d;
+ public static final int simplePad=0x7f0c0035;
+ public static final int sin=0x7f0c0001;
+ public static final int solveForX=0x7f0c0012;
+ public static final int solveForY=0x7f0c0013;
+ public static final int solveForZ=0x7f0c0014;
+ public static final int sqrt=0x7f0c000a;
+ public static final int tan=0x7f0c0003;
+ }
+ public static final class integer {
+ public static final int max_digits=0x7f070000;
+ }
+ public static final class layout {
+ public static final int advanced_pad=0x7f040000;
+ public static final int function_pad=0x7f040001;
+ public static final int history_item=0x7f040002;
+ public static final int main=0x7f040003;
+ public static final int simple_pad=0x7f040004;
+ }
+ public static final class menu {
+ public static final int menu=0x7f0b0000;
+ }
+ public static final class mipmap {
+ public static final int ic_launcher_calculator=0x7f030000;
+ }
+ public static final class string {
+ public static final int X=0x7f080025;
+ public static final int Y=0x7f080026;
+ public static final int Z=0x7f080027;
+ /** Menu item text to take user to the screen with the advanced functions, such as sin, cos, ln, log, etc.
+ */
+ public static final int advanced=0x7f080022;
+ /** Application name
+ */
+ public static final int app_name=0x7f080000;
+ /** Menu item text to take user to the screen with the basic digits and operators.
+ */
+ public static final int basic=0x7f080021;
+ /** Button name on screen to clear the entire calculation field. [CHAR LIMIT=6]
+ */
+ public static final int clear=0x7f08000d;
+ /** Menu item text to clear the calculation history.
+ */
+ public static final int clear_history=0x7f080023;
+ /** Displayed on buttons on screen for the cos function.
+ */
+ public static final int cos=0x7f080016;
+ public static final int d=0x7f080028;
+ /** Button name on screen to delete the last entered digit or operator
+ */
+ public static final int del=0x7f08000c;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit0=0x7f080002;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit1=0x7f080003;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit2=0x7f080004;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit3=0x7f080005;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit4=0x7f080006;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit5=0x7f080007;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit6=0x7f080008;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit7=0x7f080009;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit8=0x7f08000a;
+ /** Displayed numbers for the digit buttons
+ */
+ public static final int digit9=0x7f08000b;
+ /** Do not translate. Unicode division sign; don't translate. Displayed as button on screen.
+ */
+ public static final int div=0x7f08000e;
+ /** Do not translate. Decimal point; don't translate. Displayed as button on screen.
+ */
+ public static final int dot=0x7f080012;
+ public static final int dx=0x7f080029;
+ public static final int dy=0x7f08002a;
+ public static final int dz=0x7f08002b;
+ /** Displayed on buttons on screen for the e function.
+ */
+ public static final int e=0x7f080019;
+ /** Do not translate. Down arrow; don't translate. Displayed as button on screen.
+ */
+ public static final int enter=0x7f080014;
+ /** Do not translate. Equal sign; don't translate. Displayed as button on screen.
+ */
+ public static final int equal=0x7f080013;
+ /** If there is a syntax error in the user entered calculation, an error dialog will appear. This is the title.
+ */
+ public static final int error=0x7f080001;
+ /** Do not translate.
+ */
+ public static final int factorial=0x7f080020;
+ public static final int fractionOrDecimal=0x7f080032;
+ public static final int function=0x7f080036;
+ public static final int graph=0x7f080035;
+ public static final int integral=0x7f08002f;
+ /** Displayed on buttons on screen for a left parenthesis.
+ */
+ public static final int leftParen=0x7f08001c;
+ /** Displayed on buttons on screen for the log function.
+ */
+ public static final int lg=0x7f08001b;
+ /** Displayed on buttons on screen for the ln function.
+ */
+ public static final int ln=0x7f08001a;
+ public static final int matrix=0x7f080034;
+ /** Do not translate. Unicode minus sign; don't translate. Displayed as button on screen.
+ */
+ public static final int minus=0x7f080011;
+ public static final int mod=0x7f080031;
+ /** Do not translate. Unicode multiplication sign; don't translate. Displayed as button on screen.
+ */
+ public static final int mul=0x7f08000f;
+ public static final int parentheses=0x7f080030;
+ /** Do not translate. Unicode pi sign; don't translate. Displayed as button on screen.
+ */
+ public static final int pi=0x7f080018;
+ /** Do not translate. Plus sign, displayed as button on screen
+ */
+ public static final int plus=0x7f080010;
+ /** Do not translate. Displayed on buttons on screen.
+ */
+ public static final int power=0x7f08001f;
+ /** Displayed on buttons on screen for a right parenthesis.
+ */
+ public static final int rightParen=0x7f08001d;
+ public static final int shapes=0x7f080033;
+ /** Displayed on buttons on screen for the sin function.
+ */
+ public static final int sin=0x7f080015;
+ public static final int solveForX=0x7f08002c;
+ public static final int solveForY=0x7f08002d;
+ public static final int solveForZ=0x7f08002e;
+ /** Do not translate. Unicode square root sign; don't translate. Displayed on button on screen.
+ */
+ public static final int sqrt=0x7f08001e;
+ /** Displayed on buttons on screen for the tan function.
+ */
+ public static final int tan=0x7f080017;
+ /** Toast shown when text is copied to the clipboard.
+ */
+ public static final int text_copied_toast=0x7f080024;
+ }
+ public static final class style {
+ public static final int btn_clear=0x7f0a0008;
+ public static final int btn_digit_cell_style=0x7f0a0007;
+ public static final int btn_function_cell_style=0x7f0a0005;
+ public static final int btn_operation_cell_style=0x7f0a0006;
+ public static final int btn_row_style=0x7f0a0004;
+ public static final int button_small_style=0x7f0a0002;
+ public static final int button_style=0x7f0a0000;
+ public static final int digit_button_style=0x7f0a0001;
+ public static final int display_style=0x7f0a0003;
+ }
+}
View
BIN libs/android-support-v4.jar
Binary file not shown.
View
BIN libs/arity-2.1.6.jar
Binary file not shown.
View
14 project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-15
View
BIN res/drawable-hdpi/function.png
Diff not rendered.
View
22 res/layout-land/advanced_pad.xml
@@ -32,27 +32,27 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/sin"
android:text="@string/sin"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/cos"
android:text="@string/cos"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/tan"
android:text="@string/tan"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/pi"
android:text="@string/pi"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/factorial"
android:text="@string/factorial"
style="@style/button_style"
@@ -64,30 +64,30 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/ln"
android:text="@string/ln"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/lg"
android:text="@string/lg"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/e"
android:text="@string/e"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/power"
android:text="@string/power"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/sqrt"
android:text="@string/sqrt"
style="@style/button_style"
/>
</LinearLayout>
-</LinearLayout>
+</LinearLayout>
View
98 res/layout-land/function_pad.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+/*
+* Copyright (C) 2011, The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/advancedPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:layout_gravity="center"
+ >
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android.calculator3.ColorButton
+ android:id="@+id/X"
+ android:text="@string/X"
+ style="@style/digit_button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/Y"
+ android:text="@string/Y"
+ style="@style/digit_button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/Z"
+ android:text="@string/Z"
+ style="@style/digit_button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/integral"
+ android:text="@string/integral"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/dx"
+ android:text="@string/dx"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForX"
+ android:text="@string/solveForX"
+ android:textSize="20dp"
+ style="@style/button_small_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForY"
+ android:text="@string/solveForY"
+ android:textSize="20dp"
+ style="@style/button_small_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForZ"
+ android:text="@string/solveForZ"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/matrix"
+ android:text="@string/matrix"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/graph"
+ android:text="@string/graph"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+</LinearLayout>
View
14 res/layout-land/main.xml
@@ -29,19 +29,19 @@
android:layout_weight="2"
>
- <com.android.calculator2.CalculatorDisplay
+ <com.android.calculator3.CalculatorDisplay
android:id="@+id/display"
android:layout_width="0dp"
android:layout_weight="5"
android:layout_height="match_parent"
maxDigits="@integer/max_digits">
- <com.android.calculator2.CalculatorEditText
+ <com.android.calculator3.CalculatorEditText
style="@style/display_style" />
- <com.android.calculator2.CalculatorEditText
+ <com.android.calculator3.CalculatorEditText
style="@style/display_style" />
- </com.android.calculator2.CalculatorDisplay>
+ </com.android.calculator3.CalculatorDisplay>
<ImageButton android:id="@+id/overflow_menu"
android:layout_width="48dip"
android:layout_height="match_parent"
@@ -54,7 +54,7 @@
android:layout_weight="1"
android:layout_height="match_parent">
<!-- marginRight has to be 0 to catch border-touch -->
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/clear"
android:text="@string/clear"
android:layout_width="match_parent"
@@ -64,7 +64,7 @@
style="@style/button_style"
/>
<!-- marginRight has to be 0 to catch border-touch -->
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/del"
android:text="@string/del"
android:layout_width="match_parent"
@@ -76,7 +76,7 @@
</FrameLayout>
</LinearLayout>
- <com.android.calculator2.CalculatorViewPager
+ <com.android.calculator3.CalculatorViewPager
android:id="@+id/panelswitch"
android:layout_width="match_parent"
android:layout_height="0dp"
View
36 res/layout-land/simple_pad.xml
@@ -30,32 +30,32 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit7"
android:text="@string/digit7"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit8"
android:text="@string/digit8"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit9"
android:text="@string/digit9"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/leftParen"
android:text="@string/leftParen"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/rightParen"
android:text="@string/rightParen"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/mul"
android:text="@string/mul"
style="@style/button_style"
@@ -67,32 +67,32 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit4"
android:text="@string/digit4"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit5"
android:text="@string/digit5"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit6"
android:text="@string/digit6"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/dot"
android:text="@string/dot"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/div"
android:text="@string/div"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/minus"
android:text="@string/minus"
style="@style/button_style"
@@ -104,32 +104,32 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit1"
android:text="@string/digit1"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit2"
android:text="@string/digit2"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit3"
android:text="@string/digit3"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit0"
android:text="@string/digit0"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/equal"
android:text="@string/equal"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/plus"
android:text="@string/plus"
style="@style/button_style"
View
24 res/layout-port/advanced_pad.xml
@@ -31,17 +31,17 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/sin"
android:text="@string/sin"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/cos"
android:text="@string/cos"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/tan"
android:text="@string/tan"
style="@style/button_small_style"
@@ -53,17 +53,17 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/ln"
android:text="@string/ln"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/lg"
android:text="@string/lg"
style="@style/button_small_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/factorial"
android:text="@string/factorial"
style="@style/button_style"
@@ -75,17 +75,17 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/pi"
android:text="@string/pi"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/e"
android:text="@string/e"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/power"
android:text="@string/power"
style="@style/button_style"
@@ -97,17 +97,17 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/leftParen"
android:text="@string/leftParen"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/rightParen"
android:text="@string/rightParen"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/sqrt"
android:text="@string/sqrt"
style="@style/button_style"
View
143 res/layout-port/function_pad.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+/*
+* Copyright (C) 2011, The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/functionPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:layout_gravity="center"
+ >
+
+ <LinearLayout
+ android:layout_weight="3"
+ android:layout_width="match_parent"
+ android:layout_height="0dp">
+ <com.android.calculator3.ColorButton
+ android:id="@+id/integral"
+ android:text="@string/integral"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/dx"
+ android:text="@string/dx"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForX"
+ android:text="@string/solveForX"
+ android:textSize="14dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/X"
+ android:text="@string/X"
+ style="@style/digit_button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="3"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android.calculator3.ColorButton
+ android:id="@+id/parentheses"
+ android:text="@string/parentheses"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/dy"
+ android:text="@string/dy"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForY"
+ android:text="@string/solveForY"
+ android:textSize="14dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/Y"
+ android:text="@string/Y"
+ style="@style/digit_button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="3"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android.calculator3.ColorButton
+ android:id="@+id/mod"
+ android:text="@string/mod"
+ android:textSize="26dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/dz"
+ android:text="@string/dz"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/solveForZ"
+ android:text="@string/solveForZ"
+ android:textSize="14dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/Z"
+ android:text="@string/Z"
+ style="@style/digit_button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="3"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android.calculator3.ColorButton
+ android:id="@+id/fractionOrDecimal"
+ android:text="@string/fractionOrDecimal"
+ android:textSize="8dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/shapes"
+ android:text="@string/shapes"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/matrix"
+ android:text="@string/matrix"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ <com.android.calculator3.ColorButton
+ android:id="@+id/graph"
+ android:text="@string/graph"
+ android:textSize="20dp"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+</LinearLayout>
View
14 res/layout-port/main.xml
@@ -32,19 +32,19 @@
android:layout_gravity="center_vertical"
android:gravity="center_vertical">
- <com.android.calculator2.CalculatorDisplay
+ <com.android.calculator3.CalculatorDisplay
android:id="@+id/display"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
maxDigits="@integer/max_digits">
- <com.android.calculator2.CalculatorEditText
+ <com.android.calculator3.CalculatorEditText
style="@style/display_style" />
- <com.android.calculator2.CalculatorEditText
+ <com.android.calculator3.CalculatorEditText
style="@style/display_style" />
- </com.android.calculator2.CalculatorDisplay>
+ </com.android.calculator3.CalculatorDisplay>
<ImageButton android:id="@+id/overflow_menu"
android:layout_width="48dip"
android:layout_height="match_parent"
@@ -71,7 +71,7 @@
android:layout_weight="1"
android:layout_height="match_parent">
<!-- marginRight has to be 0 to catch border-touch -->
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/clear"
android:text="@string/clear"
android:layout_width="match_parent"
@@ -81,7 +81,7 @@
style="@style/button_style"
/>
<!-- marginRight has to be 0 to catch border-touch -->
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/del"
android:text="@string/del"
android:layout_width="match_parent"
@@ -93,7 +93,7 @@
</FrameLayout>
</LinearLayout>
- <com.android.calculator2.CalculatorViewPager
+ <com.android.calculator3.CalculatorViewPager
android:id="@+id/panelswitch"
android:layout_width="match_parent"
android:layout_height="0dp"
View
32 res/layout-port/simple_pad.xml
@@ -30,22 +30,22 @@
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp">
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit7"
android:text="@string/digit7"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit8"
android:text="@string/digit8"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit9"
android:text="@string/digit9"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/div"
android:text="@string/div"
style="@style/button_style"
@@ -57,22 +57,22 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit4"
android:text="@string/digit4"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit5"
android:text="@string/digit5"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit6"
android:text="@string/digit6"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/mul"
android:text="@string/mul"
style="@style/button_style"
@@ -84,22 +84,22 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit1"
android:text="@string/digit1"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit2"
android:text="@string/digit2"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit3"
android:text="@string/digit3"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/minus"
android:text="@string/minus"
style="@style/button_style"
@@ -111,22 +111,22 @@
android:layout_width="match_parent"
android:layout_height="0dp"
>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/dot"
android:text="@string/dot"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/digit0"
android:text="@string/digit0"
style="@style/digit_button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/equal"
android:text="@string/equal"
style="@style/button_style"
/>
- <com.android.calculator2.ColorButton
+ <com.android.calculator3.ColorButton
android:id="@+id/plus"
android:text="@string/plus"
style="@style/button_style"
View
5 res/menu/menu.xml
@@ -23,6 +23,11 @@
android:showAsAction="ifRoom|withText"
android:icon="@drawable/clear_history"
android:title="@string/clear_history"/>
+
+ <item android:id="@+id/function"
+ android:showAsAction="ifRoom|withText"
+ android:icon="@drawable/function"
+ android:title="@string/function"/>
<item android:id="@+id/advanced"
android:showAsAction="ifRoom|withText"
View
204 res/values/strings.xml
@@ -1,93 +1,111 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources>
- <!-- Application name -->
- <string name="app_name">Calculator</string>
- <!-- If there is a syntax error in the user entered calculation, an error dialog will appear. This is the title. -->
- <string name="error">Error</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit0">0</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit1">1</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit2">2</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit3">3</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit4">4</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit5">5</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit6">6</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit7">7</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit8">8</string>
- <!-- Displayed numbers for the digit buttons -->
- <string name="digit9">9</string>
- <!-- Button name on screen to delete the last entered digit or operator -->
- <string name="del">DELETE</string>
- <!-- Button name on screen to clear the entire calculation field. [CHAR LIMIT=6] -->
- <string name="clear">CLR</string>
- <!-- Do not translate. Unicode division sign; don't translate. Displayed as button on screen. -->
- <string name="div">\u00f7</string>
- <!-- Do not translate. Unicode multiplication sign; don't translate. Displayed as button on screen. -->
- <string name="mul">\u00d7</string>
- <!-- Do not translate. Plus sign, displayed as button on screen -->
- <string name="plus">+</string>
- <!-- Do not translate. Unicode minus sign; don't translate. Displayed as button on screen. -->
- <string name="minus">\u2212</string>
- <!-- Do not translate. Decimal point; don't translate. Displayed as button on screen. -->
- <string name="dot">.</string>
- <!-- Do not translate. Equal sign; don't translate. Displayed as button on screen. -->
- <string name="equal">=</string>
- <!-- Do not translate. Down arrow; don't translate. Displayed as button on screen. -->
- <string name="enter">\u2193</string>
- <!-- Displayed on buttons on screen for the sin function. -->
- <string name="sin">sin</string>
- <!-- Displayed on buttons on screen for the cos function. -->
- <string name="cos">cos</string>
- <!-- Displayed on buttons on screen for the tan function. -->
- <string name="tan">tan</string>
-
- <!-- Do not translate. Unicode pi sign; don't translate. Displayed as button on screen. -->
- <string name="pi">\u03c0</string>
- <!-- Displayed on buttons on screen for the e function. -->
- <string name="e">e</string>
- <!-- Displayed on buttons on screen for the ln function. -->
- <string name="ln">ln</string>
- <!-- Displayed on buttons on screen for the log function. -->
- <string name="lg">log</string>
- <!-- Displayed on buttons on screen for a left parenthesis. -->
- <string name="leftParen">(</string>
- <!-- Displayed on buttons on screen for a right parenthesis. -->
- <string name="rightParen">)</string>
- <!-- Do not translate. Unicode square root sign; don't translate. Displayed on button on screen. -->
- <string name="sqrt">\u221a</string>
- <!-- Do not translate. Displayed on buttons on screen. -->
- <string name="power">^</string>
- <!-- Do not translate. -->
- <string name="factorial">!</string>
- <!-- Menu item text to take user to the screen with the basic digits and operators. -->
- <string name="basic">Basic panel</string>
- <!-- Menu item text to take user to the screen with the advanced functions, such as sin, cos, ln, log, etc. -->
- <string name="advanced">Advanced panel</string>
- <!-- Menu item text to clear the calculation history. -->
- <string name="clear_history">Clear history</string>
- <!-- Toast shown when text is copied to the clipboard. -->
- <string name="text_copied_toast">Text copied.</string>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <!-- Application name -->
+ <string name="app_name">Calculator</string>
+ <!-- If there is a syntax error in the user entered calculation, an error dialog will appear. This is the title. -->
+ <string name="error">Error</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit0">0</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit1">1</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit2">2</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit3">3</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit4">4</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit5">5</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit6">6</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit7">7</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit8">8</string>
+ <!-- Displayed numbers for the digit buttons -->
+ <string name="digit9">9</string>
+ <!-- Button name on screen to delete the last entered digit or operator -->
+ <string name="del">DELETE</string>
+ <!-- Button name on screen to clear the entire calculation field. [CHAR LIMIT=6] -->
+ <string name="clear">CLR</string>
+ <!-- Do not translate. Unicode division sign; don't translate. Displayed as button on screen. -->
+ <string name="div">\u00f7</string>
+ <!-- Do not translate. Unicode multiplication sign; don't translate. Displayed as button on screen. -->
+ <string name="mul">\u00d7</string>
+ <!-- Do not translate. Plus sign, displayed as button on screen -->
+ <string name="plus">+</string>
+ <!-- Do not translate. Unicode minus sign; don't translate. Displayed as button on screen. -->
+ <string name="minus">\u2212</string>
+ <!-- Do not translate. Decimal point; don't translate. Displayed as button on screen. -->
+ <string name="dot">.</string>
+ <!-- Do not translate. Equal sign; don't translate. Displayed as button on screen. -->
+ <string name="equal">=</string>
+ <!-- Do not translate. Down arrow; don't translate. Displayed as button on screen. -->
+ <string name="enter">\u2193</string>
+ <!-- Displayed on buttons on screen for the sin function. -->
+ <string name="sin">sin</string>
+ <!-- Displayed on buttons on screen for the cos function. -->
+ <string name="cos">cos</string>
+ <!-- Displayed on buttons on screen for the tan function. -->
+ <string name="tan">tan</string>
+
+ <!-- Do not translate. Unicode pi sign; don't translate. Displayed as button on screen. -->
+ <string name="pi">\u03c0</string>
+ <!-- Displayed on buttons on screen for the e function. -->
+ <string name="e">e</string>
+ <!-- Displayed on buttons on screen for the ln function. -->
+ <string name="ln">ln</string>
+ <!-- Displayed on buttons on screen for the log function. -->
+ <string name="lg">log</string>
+ <!-- Displayed on buttons on screen for a left parenthesis. -->
+ <string name="leftParen">(</string>
+ <!-- Displayed on buttons on screen for a right parenthesis. -->
+ <string name="rightParen">)</string>
+ <!-- Do not translate. Unicode square root sign; don't translate. Displayed on button on screen. -->
+ <string name="sqrt">\u221a</string>
+ <!-- Do not translate. Displayed on buttons on screen. -->
+ <string name="power">^</string>
+ <!-- Do not translate. -->
+ <string name="factorial">!</string>
+ <!-- Menu item text to take user to the screen with the basic digits and operators. -->
+ <string name="basic">Basic panel</string>
+ <!-- Menu item text to take user to the screen with the advanced functions, such as sin, cos, ln, log, etc. -->
+ <string name="advanced">Advanced panel</string>
+ <!-- Menu item text to clear the calculation history. -->
+ <string name="clear_history">Clear history</string>
+ <!-- Toast shown when text is copied to the clipboard. -->
+ <string name="text_copied_toast">Text copied.</string>
+
+ <string name="X">X</string>
+ <string name="Y">Y</string>
+ <string name="Z">Z</string>
+ <string name="d">d</string>
+ <string name="dx">dx</string>
+ <string name="dy">dy</string>
+ <string name="dz">dz</string>
+ <string name="solveForX">Solve for X</string>
+ <string name="solveForY">Solve for Y</string>
+ <string name="solveForZ">Solve for Z</string>
+ <string name="integral">\u222B</string>
+ <string name="parentheses">( )</string>
+ <string name="mod">Mod</string>
+ <string name="fractionOrDecimal">Fraction or Decimal</string>
+ <string name="shapes">Shapes</string>
+ <string name="matrix">Matrix</string>
+ <string name="graph">Graph</string>
+ <string name="function">Function panel</string>
View
43 src/com/android/calculator2/Calculator.java → src/com/android/calculator3/Calculator.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.calculator2;
+package com.android.calculator3;
import android.app.Activity;
import android.content.res.Resources;
@@ -48,8 +48,9 @@
private View mBackspaceButton;
private View mOverflowMenuButton;
- static final int BASIC_PANEL = 0;
- static final int ADVANCED_PANEL = 1;
+ static final int FUNCTION_PANEL = 0;
+ static final int BASIC_PANEL = 1;
+ static final int ADVANCED_PANEL = 2;
private static final String LOG_TAG = "Calculator";
private static final boolean DEBUG = false;
@@ -105,7 +106,7 @@ public void onCreate(Bundle state) {
mHistory.setObserver(historyAdapter);
if (mPager != null) {
- mPager.setCurrentItem(state == null ? 0 : state.getInt(STATE_CURRENT_VIEW, 0));
+ mPager.setCurrentItem(state == null ? 1 : state.getInt(STATE_CURRENT_VIEW, 1));
}
mListener.setHandler(mLogic, mPager);
@@ -144,6 +145,10 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
+ MenuItem mFunctionPanel = menu.findItem(R.id.function);
+ if(mFunctionPanel != null){
+ mFunctionPanel.setVisible(!getFunctionVisibility());
+ }
MenuItem mBasicPanel = menu.findItem(R.id.basic);
if(mBasicPanel != null){
mBasicPanel.setVisible(!getBasicVisibility());
@@ -191,6 +196,10 @@ public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelected(item);
}
+ private boolean getFunctionVisibility() {
+ return mPager != null && mPager.getCurrentItem() == FUNCTION_PANEL;
+ }
+
private boolean getBasicVisibility() {
return mPager != null && mPager.getCurrentItem() == BASIC_PANEL;
}
@@ -218,6 +227,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
mPager.setCurrentItem(ADVANCED_PANEL);
}
break;
+
+ case R.id.function:
+ if (!getFunctionVisibility()) {
+ mPager.setCurrentItem(FUNCTION_PANEL);
+ }
}
return super.onOptionsItemSelected(item);
}
@@ -267,13 +281,16 @@ public void onDeleteModeChange() {
class PageAdapter extends PagerAdapter {
private View mSimplePage;
private View mAdvancedPage;
+ private View mFunctionPage;
public PageAdapter(ViewPager parent) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View simplePage = inflater.inflate(R.layout.simple_pad, parent, false);
final View advancedPage = inflater.inflate(R.layout.advanced_pad, parent, false);
+ final View functionPage = inflater.inflate(R.layout.function_pad, parent, false);
mSimplePage = simplePage;
mAdvancedPage = advancedPage;
+ mFunctionPage = functionPage;
final Resources res = getResources();
final TypedArray simpleButtons = res.obtainTypedArray(R.array.simple_buttons);
@@ -301,7 +318,7 @@ public PageAdapter(ViewPager parent) {
@Override
public int getCount() {
- return 2;
+ return 3;
}
@Override
@@ -310,9 +327,19 @@ public void startUpdate(View container) {
@Override
public Object instantiateItem(View container, int position) {
- final View page = position == 0 ? mSimplePage : mAdvancedPage;
- ((ViewGroup) container).addView(page);
- return page;
+ if(position == 0){
+ ((ViewGroup) container).addView(mFunctionPage);
+ return mFunctionPage;
+ }
+ else if(position == 1){
+ ((ViewGroup) container).addView(mSimplePage);
+ return mSimplePage;
+ }
+ else if(position == 2){
+ ((ViewGroup) container).addView(mAdvancedPage);
+ return mAdvancedPage;
+ }
+ return null;
}
@Override
View
2 ...ndroid/calculator2/CalculatorDisplay.java → ...ndroid/calculator3/CalculatorDisplay.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.calculator2;
+package com.android.calculator3;