User defined functions support

This commit is contained in:
Sergey Solovyev
2012-11-14 18:24:08 +04:00
parent 791eac433b
commit 357eed9f3e
15 changed files with 713 additions and 70 deletions

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_height="wrap_content"
a:layout_width="match_parent"
a:orientation="horizontal">
<Button
a:id="@+id/function_add_param_button"
a:layout_height="wrap_content"
a:layout_width="wrap_content"
a:text="+" />
</LinearLayout>

View File

@@ -33,15 +33,10 @@
style="@style/default_text_size"
a:text="@string/c_function_parameters"/>
<LinearLayout
a:id="@+id/function_params_layout"
<org.solovyev.android.calculator.function.FunctionParamsView
a:id="@+id/function_params_layout"
a:layout_height="wrap_content"
a:layout_width="match_parent"
a:orientation="vertical">
<include layout="@layout/function_edit_param" />
</LinearLayout>
a:layout_width="match_parent"/>
<TextView a:layout_height="wrap_content"
a:layout_width="match_parent"

View File

@@ -5,21 +5,27 @@
a:layout_width="match_parent"
a:orientation="horizontal">
<Button
a:id="@+id/function_add_param_button"
a:layout_height="wrap_content"
a:layout_width="wrap_content"
a:text="+" />
<Button
a:id="@+id/function_remove_param_button"
a:layout_height="wrap_content"
a:layout_width="wrap_content"
a:visibility="gone"
a:text="-" />
<Button
a:id="@+id/function_up_param_button"
a:layout_height="wrap_content"
a:layout_width="wrap_content"
a:text="^" />
<Button
a:id="@+id/function_down_param_button"
a:layout_height="wrap_content"
a:layout_width="wrap_content"
a:text="v" />
<EditText
a:layout_height="wrap_content"
a:id="@+id/function_param_edit_text"
a:layout_height="wrap_content"
a:layout_width="match_parent"
style="@style/default_text_size"
a:inputType="text" />

View File

@@ -239,4 +239,12 @@
<string name="c_function_description">Description</string>
<string name="c_function_parameters">Parameters</string>
<string name="function_create_function">Create function</string>
<string name="function_edit_function">Edit function</string>
<string name="function_name_is_not_valid">Name of function is not valid: name must start with letter, can contain letters, digits and underscore.</string>
<string name="function_already_exists">Function with same name already exists!</string>
<string name="function_name_clashes">Function name clashes with function name!</string>
<string name="function_is_empty">Function body could not be empty!</string>
<string name="function_param_not_empty">Function parameter should not be empty!</string>
</resources>