EditFunctionDialog

This commit is contained in:
serso 2016-01-17 22:09:40 +01:00
parent b5600114ed
commit 498b2f5429
11 changed files with 222 additions and 251 deletions

View File

@ -5,6 +5,7 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.DialogFragment; import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -45,4 +46,14 @@ public abstract class BaseDialogFragment extends DialogFragment {
@NonNull @NonNull
protected abstract View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState); protected abstract View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState);
protected static void setError(@NonNull TextInputLayout textInput, @NonNull String error) {
textInput.setError(error);
textInput.setErrorEnabled(true);
}
protected static void clearError(@NonNull TextInputLayout textInput) {
textInput.setError(null);
textInput.setErrorEnabled(false);
}
} }

View File

@ -33,16 +33,12 @@ import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import jscl.math.Generic;
import org.solovyev.android.Activities; import org.solovyev.android.Activities;
import org.solovyev.android.calculator.about.CalculatorAboutActivity; import org.solovyev.android.calculator.about.CalculatorAboutActivity;
import org.solovyev.android.calculator.function.FunctionEditDialogFragment; import org.solovyev.android.calculator.function.EditFunctionFragment;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity; import org.solovyev.android.calculator.history.CalculatorHistoryActivity;
import org.solovyev.android.calculator.math.edit.CalculatorFunctionsActivity; import org.solovyev.android.calculator.math.edit.*;
import org.solovyev.android.calculator.math.edit.CalculatorOperatorsActivity;
import org.solovyev.android.calculator.math.edit.CalculatorVarsActivity;
import org.solovyev.android.calculator.math.edit.VarsFragment;
import org.solovyev.android.calculator.math.edit.VarEditDialogFragment;
import org.solovyev.android.calculator.matrix.CalculatorMatrixActivity; import org.solovyev.android.calculator.matrix.CalculatorMatrixActivity;
import org.solovyev.android.calculator.plot.CalculatorPlotActivity; import org.solovyev.android.calculator.plot.CalculatorPlotActivity;
import org.solovyev.android.calculator.plot.CalculatorPlotter; import org.solovyev.android.calculator.plot.CalculatorPlotter;
@ -51,12 +47,9 @@ import org.solovyev.common.msg.Message;
import org.solovyev.common.msg.MessageType; import org.solovyev.common.msg.MessageType;
import org.solovyev.common.text.Strings; import org.solovyev.common.text.Strings;
import java.util.List;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List;
import jscl.math.Generic;
/** /**
* User: serso * User: serso
@ -168,7 +161,7 @@ public final class CalculatorActivityLauncher implements CalculatorEventListener
if (viewState.valid) { if (viewState.valid) {
final String functionValue = viewState.text; final String functionValue = viewState.text;
if (!Strings.isEmpty(functionValue)) { if (!Strings.isEmpty(functionValue)) {
FunctionEditDialogFragment.showDialog(FunctionEditDialogFragment.Input.newFromDisplay(viewState), context); EditFunctionFragment.showDialog(EditFunctionFragment.Input.newFromDisplay(viewState), context);
} else { } else {
getNotifier().showMessage(R.string.empty_function_error, MessageType.error); getNotifier().showMessage(R.string.empty_function_error, MessageType.error);
} }

View File

@ -23,17 +23,22 @@
package org.solovyev.android.calculator.function; package org.solovyev.android.calculator.function;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.v4.app.DialogFragment; import android.support.annotation.NonNull;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import butterknife.Bind;
import butterknife.ButterKnife;
import jscl.math.Generic; import jscl.math.Generic;
import jscl.math.function.Constant; import jscl.math.function.Constant;
import jscl.math.function.CustomFunction; import jscl.math.function.CustomFunction;
@ -43,6 +48,7 @@ import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.math.edit.CalculatorFunctionsActivity; import org.solovyev.android.calculator.math.edit.CalculatorFunctionsActivity;
import org.solovyev.android.calculator.math.edit.FunctionsFragment; import org.solovyev.android.calculator.math.edit.FunctionsFragment;
import org.solovyev.android.calculator.math.edit.MathEntityRemover; import org.solovyev.android.calculator.math.edit.MathEntityRemover;
import org.solovyev.android.calculator.math.edit.VarEditorSaver;
import org.solovyev.android.calculator.model.AFunction; import org.solovyev.android.calculator.model.AFunction;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@ -51,23 +57,24 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
/** public class EditFunctionFragment extends BaseDialogFragment implements CalculatorEventListener {
* User: serso
* Date: 11/13/12
* Time: 11:34 PM
*/
public class FunctionEditDialogFragment extends DialogFragment implements CalculatorEventListener {
private static final String INPUT = "input";
private static final String ARG_INPUT = "input";
@Bind(R.id.function_params)
FunctionParamsView paramsView;
@Bind(R.id.function_name_label)
TextInputLayout nameLabel;
@Bind(R.id.function_name)
EditText nameView;
@Bind(R.id.function_body)
EditText bodyView;
@Bind(R.id.function_description)
EditText descriptionView;
private Input input; private Input input;
public FunctionEditDialogFragment() {
}
@Nonnull @Nonnull
public static FunctionEditDialogFragment create(@Nonnull Input input) { public static EditFunctionFragment create(@Nonnull Input input) {
final FunctionEditDialogFragment fragment = new FunctionEditDialogFragment(); final EditFunctionFragment fragment = new EditFunctionFragment();
fragment.input = input; fragment.input = input;
final Bundle args = new Bundle(); final Bundle args = new Bundle();
args.putParcelable("input", input); args.putParcelable("input", input);
@ -76,8 +83,8 @@ public class FunctionEditDialogFragment extends DialogFragment implements Calcul
} }
public static void showDialog(@Nonnull Input input, @Nonnull Context context) { public static void showDialog(@Nonnull Input input, @Nonnull Context context) {
if (context instanceof ActionBarActivity) { if (context instanceof AppCompatActivity) {
FunctionEditDialogFragment.showDialog(input, ((ActionBarActivity) context).getSupportFragmentManager()); EditFunctionFragment.showDialog(input, ((AppCompatActivity) context).getSupportFragmentManager());
} else { } else {
final Intent intent = new Intent(context, CalculatorFunctionsActivity.class); final Intent intent = new Intent(context, CalculatorFunctionsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@ -93,41 +100,84 @@ public class FunctionEditDialogFragment extends DialogFragment implements Calcul
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
input = getArguments().getParcelable(ARG_INPUT);
if (input == null) {
input = getArguments().getParcelable("input");
if (input == null) throw new AssertionError();
}
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) {
final View result = inflater.inflate(R.layout.function_edit, container, false); builder.setNegativeButton(R.string.c_cancel, null);
builder.setPositiveButton(R.string.ok, null);
if (savedInstanceState != null) { final AFunction function = input.getFunction();
final Parcelable input = savedInstanceState.getParcelable(INPUT); builder.setTitle(function == null ? R.string.function_create_function : R.string.function_edit_function);
if (input instanceof Input) { if(function != null) {
this.input = (Input) input; builder.setNeutralButton(R.string.c_remove, null);
} }
} }
return result; @NonNull
}
@Override @Override
public void onViewCreated(@Nonnull View root, Bundle savedInstanceState) { public AlertDialog onCreateDialog(Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState); final AlertDialog dialog = super.onCreateDialog(savedInstanceState);
dialog.setCanceledOnTouchOutside(false);
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface d) {
nameView.requestFocus();
nameView.selectAll();
final FunctionParamsView paramsView = (FunctionParamsView) root.findViewById(R.id.function_params_layout); final Button ok = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
ok.setOnClickListener(new View.OnClickListener() {
final AFunction.Builder builder; @Override
public void onClick(View v) {
tryClose();
}
});
final AFunction function = input.getFunction(); final AFunction function = input.getFunction();
if (function != null) { if (function != null) {
builder = new AFunction.Builder(function); final Function customFunction = new CustomFunction.Builder(function).create();
} else { final Button neutral = dialog.getButton(AlertDialog.BUTTON_NEUTRAL);
builder = new AFunction.Builder(); neutral.setOnClickListener(MathEntityRemover.newFunctionRemover(customFunction, null, getActivity(), EditFunctionFragment.this));
}
}
});
return dialog;
} }
private void tryClose() {
if (validate()) {
applyData();
dismiss();
}
}
private void applyData() {
}
private boolean validate() {
if (!validateName()) {
return false;
}
return true;
}
private boolean validateName() {
final String name = nameView.getText().toString();
if (!VarEditorSaver.isValidName(name)) {
setError(nameLabel, getString(R.string.function_name_is_not_valid));
return false;
}
clearError(nameLabel);
return true;
}
@NonNull
@Override
protected View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_function_edit, null);
ButterKnife.bind(this, view);
if (savedInstanceState == null) {
final List<String> parameterNames = input.getParameterNames(); final List<String> parameterNames = input.getParameterNames();
if (parameterNames != null) { if (parameterNames != null) {
paramsView.init(parameterNames); paramsView.init(parameterNames);
@ -135,45 +185,12 @@ public class FunctionEditDialogFragment extends DialogFragment implements Calcul
paramsView.init(); paramsView.init();
} }
final EditText editName = (EditText) root.findViewById(R.id.function_edit_name); nameView.setText(input.getName());
// show soft keyboard automatically descriptionView.setText(input.getDescription());
editName.requestFocus(); bodyView.setText(input.getContent());
editName.setText(input.getName());
final EditText editDescription = (EditText) root.findViewById(R.id.function_edit_description);
editDescription.setText(input.getDescription());
final EditText editContent = (EditText) root.findViewById(R.id.function_edit_value);
editContent.setText(input.getContent());
root.findViewById(R.id.cancel_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
root.findViewById(R.id.save_button).setOnClickListener(new FunctionEditorSaver(builder, function, root, Locator.getInstance().getEngine().getFunctionsRegistry(), this));
if (function == null) {
// CREATE MODE
getDialog().setTitle(R.string.function_create_function);
root.findViewById(R.id.remove_button).setVisibility(View.GONE);
} else {
// EDIT MODE
getDialog().setTitle(R.string.function_edit_function);
final Function customFunction = new CustomFunction.Builder(function).create();
root.findViewById(R.id.remove_button).setOnClickListener(MathEntityRemover.newFunctionRemover(customFunction, null, this.getActivity(), FunctionEditDialogFragment.this));
}
} }
@Override return view;
public void onSaveInstanceState(@Nonnull Bundle out) {
super.onSaveInstanceState(out);
out.putParcelable(INPUT, FunctionEditorSaver.readInput(input.getFunction(), getView()));
} }
@Override @Override
@ -196,7 +213,7 @@ public class FunctionEditDialogFragment extends DialogFragment implements Calcul
case function_removed: case function_removed:
case function_added: case function_added:
case function_changed: case function_changed:
if (calculatorEventData.getSource() == FunctionEditDialogFragment.this) { if (calculatorEventData.getSource() == EditFunctionFragment.this) {
dismiss(); dismiss();
} }
break; break;

View File

@ -24,9 +24,11 @@ package org.solovyev.android.calculator.function;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import jscl.CustomFunctionCalculationException;
import org.solovyev.android.calculator.FunctionsRegistry; import jscl.math.function.Function;
import jscl.math.function.IFunction;
import org.solovyev.android.calculator.EntitiesRegistry; import org.solovyev.android.calculator.EntitiesRegistry;
import org.solovyev.android.calculator.FunctionsRegistry;
import org.solovyev.android.calculator.Locator; import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.math.edit.VarEditorSaver; import org.solovyev.android.calculator.math.edit.VarEditorSaver;
@ -34,15 +36,10 @@ import org.solovyev.android.calculator.model.AFunction;
import org.solovyev.common.msg.MessageType; import org.solovyev.common.msg.MessageType;
import org.solovyev.common.text.Strings; import org.solovyev.common.text.Strings;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Collections;
import jscl.CustomFunctionCalculationException; import java.util.List;
import jscl.math.function.Function;
import jscl.math.function.IFunction;
public class FunctionEditorSaver implements View.OnClickListener { public class FunctionEditorSaver implements View.OnClickListener {
@ -76,27 +73,27 @@ public class FunctionEditorSaver implements View.OnClickListener {
} }
@Nonnull @Nonnull
public static FunctionEditDialogFragment.Input readInput(@Nullable IFunction function, @Nonnull View root) { public static EditFunctionFragment.Input readInput(@Nullable IFunction function, @Nonnull View root) {
final EditText editName = (EditText) root.findViewById(R.id.function_edit_name); final EditText editName = (EditText) root.findViewById(R.id.function_name);
String name = editName.getText().toString(); String name = editName.getText().toString();
final EditText editValue = (EditText) root.findViewById(R.id.function_edit_value); final EditText editValue = (EditText) root.findViewById(R.id.function_body);
String content = editValue.getText().toString(); String content = editValue.getText().toString();
final EditText editDescription = (EditText) root.findViewById(R.id.function_edit_description); final EditText editDescription = (EditText) root.findViewById(R.id.function_description);
String description = editDescription.getText().toString(); String description = editDescription.getText().toString();
final FunctionParamsView editParams = (FunctionParamsView) root.findViewById(R.id.function_params_layout); final FunctionParamsView editParams = (FunctionParamsView) root.findViewById(R.id.function_params);
List<String> parameterNames = editParams.getParameterNames(); List<String> parameterNames = editParams.getParameterNames();
return FunctionEditDialogFragment.Input.newInstance(function, name, content, description, parameterNames); return EditFunctionFragment.Input.newInstance(function, name, content, description, parameterNames);
} }
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final Integer error; final Integer error;
final FunctionEditDialogFragment.Input input = readInput(null, view); final EditFunctionFragment.Input input = readInput(null, view);
final String name = input.getName(); final String name = input.getName();
final String content = input.getContent(); final String content = input.getContent();

View File

@ -32,17 +32,14 @@ import android.view.ViewGroup;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import jscl.text.MutableInt;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.ArrayList;
import jscl.text.MutableInt; import java.util.Collections;
import java.util.List;
public class FunctionParamsView extends LinearLayout { public class FunctionParamsView extends LinearLayout {
@ -98,7 +95,7 @@ public class FunctionParamsView extends LinearLayout {
final Integer id = paramsCount.intValue(); final Integer id = paramsCount.intValue();
final View editParamView = inflater.inflate(R.layout.function_edit_param, null); final View editParamView = inflater.inflate(R.layout.fragment_function_edit_param, null);
editParamView.setTag(getParamTag(id)); editParamView.setTag(getParamTag(id));

View File

@ -5,7 +5,6 @@ import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -38,9 +37,6 @@ public class EditHistoryFragment extends BaseDialogFragment {
@Bind(R.id.history_comment) @Bind(R.id.history_comment)
EditText commentView; EditText commentView;
@Bind(R.id.history_comment_label)
TextInputLayout commentLabel;
public static void show(@NonNull HistoryState state, boolean newState, @NonNull FragmentManager fm) { public static void show(@NonNull HistoryState state, boolean newState, @NonNull FragmentManager fm) {
final EditHistoryFragment fragment = new EditHistoryFragment(); final EditHistoryFragment fragment = new EditHistoryFragment();
final Bundle args = new Bundle(); final Bundle args = new Bundle();

View File

@ -31,7 +31,7 @@ import android.view.View;
import jscl.math.function.Function; import jscl.math.function.Function;
import jscl.math.function.IFunction; import jscl.math.function.IFunction;
import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.function.FunctionEditDialogFragment; import org.solovyev.android.calculator.function.EditFunctionFragment;
import org.solovyev.common.text.Strings; import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@ -55,9 +55,9 @@ public class FunctionsFragment extends BaseEntitiesFragment<Function> {
final Bundle bundle = getArguments(); final Bundle bundle = getArguments();
if (bundle != null) { if (bundle != null) {
final FunctionEditDialogFragment.Input input = bundle.getParcelable(EXTRA_FUNCTION); final EditFunctionFragment.Input input = bundle.getParcelable(EXTRA_FUNCTION);
if (input != null) { if (input != null) {
FunctionEditDialogFragment.showDialog(input, getFragmentManager()); EditFunctionFragment.showDialog(input, getFragmentManager());
// in order to stop intent for other tabs // in order to stop intent for other tabs
bundle.remove(EXTRA_FUNCTION); bundle.remove(EXTRA_FUNCTION);
} }
@ -73,7 +73,7 @@ public class FunctionsFragment extends BaseEntitiesFragment<Function> {
fab.setOnClickListener(new View.OnClickListener() { fab.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
FunctionEditDialogFragment.showDialog(FunctionEditDialogFragment.Input.newInstance(), getFragmentManager()); EditFunctionFragment.showDialog(EditFunctionFragment.Input.newInstance(), getFragmentManager());
} }
}); });
} }
@ -106,7 +106,7 @@ public class FunctionsFragment extends BaseEntitiesFragment<Function> {
return true; return true;
case R.string.c_edit: case R.string.c_edit:
if (function instanceof IFunction) { if (function instanceof IFunction) {
FunctionEditDialogFragment.showDialog(FunctionEditDialogFragment.Input.newFromFunction((IFunction) function), activity.getSupportFragmentManager()); EditFunctionFragment.showDialog(EditFunctionFragment.Input.newFromFunction((IFunction) function), activity.getSupportFragmentManager());
} }
return true; return true;
case R.string.c_remove: case R.string.c_remove:

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 serso aka se.solovyev
~
~ 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.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<ScrollView xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="wrap_content">
<LinearLayout
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:orientation="vertical">
<android.support.design.widget.TextInputLayout
a:id="@+id/function_name_label"
a:layout_width="match_parent"
a:layout_height="wrap_content">
<EditText
a:id="@+id/function_name"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:hint="@string/c_function_name"
a:inputType="text" />
</android.support.design.widget.TextInputLayout>
<org.solovyev.android.calculator.function.FunctionParamsView
a:id="@+id/function_params"
a:layout_width="match_parent"
a:layout_height="wrap_content" />
<android.support.design.widget.TextInputLayout
a:id="@+id/function_body_label"
a:layout_width="match_parent"
a:layout_height="wrap_content">
<EditText
a:id="@+id/function_body"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:hint="@string/c_function_value"
a:inputType="text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
a:layout_width="match_parent"
a:layout_height="wrap_content">
<EditText
a:id="@+id/function_description"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:hint="@string/c_function_description"
a:inputType="text" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</ScrollView>

View File

@ -43,7 +43,6 @@
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
a:id="@+id/history_comment_label"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="wrap_content"> a:layout_height="wrap_content">

View File

@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 serso aka se.solovyev
~
~ 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.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<ScrollView xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:minWidth="300dp">
<LinearLayout
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:orientation="vertical">
<TextView
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:padding="6dp"
a:text="@string/c_function_name" />
<EditText
a:id="@+id/function_edit_name"
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:inputType="text" />
<TextView
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:padding="6dp"
a:text="@string/c_function_parameters" />
<org.solovyev.android.calculator.function.FunctionParamsView
a:id="@+id/function_params_layout"
a:layout_width="match_parent"
a:layout_height="wrap_content" />
<TextView
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:padding="6dp"
a:text="@string/c_function_value" />
<EditText
a:id="@+id/function_edit_value"
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:inputType="text" />
<TextView
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:padding="6dp"
a:text="@string/c_function_description" />
<EditText
a:id="@+id/function_edit_description"
style="@style/cpp_default_text_size"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:inputType="text" />
<LinearLayout
a:layout_width="match_parent"
a:layout_height="wrap_content">
<Button
a:id="@+id/cancel_button"
a:layout_width="0dp"
a:layout_height="wrap_content"
a:layout_weight="1"
a:text="@string/c_cancel" />
<Button
a:id="@+id/remove_button"
a:layout_width="0dp"
a:layout_height="wrap_content"
a:layout_weight="1"
a:text="@string/c_remove" />
<Button
a:id="@+id/save_button"
a:layout_width="0dp"
a:layout_height="wrap_content"
a:layout_weight="1"
a:text="@string/c_save" />
</LinearLayout>
</LinearLayout>
</ScrollView>