diff --git a/android-app/res/layout/var_edit.xml b/android-app/res/layout/var_edit.xml
index 91ac4823..06df2ea1 100644
--- a/android-app/res/layout/var_edit.xml
+++ b/android-app/res/layout/var_edit.xml
@@ -46,6 +46,69 @@
style="@style/cpp_default_text_size"
a:inputType="text"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
exten
public static final String MATH_ENTITY_CATEGORY_EXTRA_STRING = "org.solovyev.android.calculator.CalculatorVarsActivity_math_entity_category";
- protected final static List acceptableChars = Arrays.asList(Strings.toObjects("1234567890abcdefghijklmnopqrstuvwxyzйцукенгшщзхъфывапролджэячсмитьбюё_".toCharArray()));
-
/*
**********************************************************************
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/math/edit/VarEditDialogFragment.java b/android-app/src/main/java/org/solovyev/android/calculator/math/edit/VarEditDialogFragment.java
index b01d9fd9..b53ae91c 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/math/edit/VarEditDialogFragment.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/math/edit/VarEditDialogFragment.java
@@ -22,6 +22,7 @@
package org.solovyev.android.calculator.math.edit;
+import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
@@ -30,17 +31,24 @@ import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.WindowManager;
+import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import jscl.math.function.IConstant;
+import java.util.Arrays;
+import java.util.List;
+
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.solovyev.android.Views;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.model.Var;
import org.solovyev.android.sherlock.AndroidSherlockUtils;
+import org.solovyev.common.text.Strings;
+
+import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE;
/**
* User: Solovyev_S
@@ -49,6 +57,8 @@ import org.solovyev.android.sherlock.AndroidSherlockUtils;
*/
public class VarEditDialogFragment extends DialogFragment implements CalculatorEventListener {
+ private final static List acceptableChars = Arrays.asList(Strings.toObjects("1234567890abcdefghijklmnopqrstuvwxyzйцукенгшщзхъфывапролджэячсмитьбюёαβγδεζηθικλμνξοπρστυφχψω_".toCharArray()));
+
@Nonnull
private final Input input;
@@ -101,7 +111,7 @@ public class VarEditDialogFragment extends DialogFragment implements CalculatorE
public void afterTextChanged(Editable s) {
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if (!AbstractMathEntityListFragment.acceptableChars.contains(c)) {
+ if (!acceptableChars.contains(c)) {
s.delete(i, i + 1);
Toast.makeText(getActivity(), String.format(errorMsg, c), Toast.LENGTH_SHORT).show();
}
@@ -109,9 +119,12 @@ public class VarEditDialogFragment extends DialogFragment implements CalculatorE
}
});
+ processGreekButtons(root, editName, R.id.var_edit_greek_buttons_1);
+ processGreekButtons(root, editName, R.id.var_edit_greek_buttons_2);
+
// show soft keyboard automatically
editName.requestFocus();
- getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+ getDialog().getWindow().setSoftInputMode(SOFT_INPUT_STATE_VISIBLE);
final EditText editValue = (EditText) root.findViewById(R.id.var_edit_value);
editValue.setText(input.getValue());
@@ -149,6 +162,21 @@ public class VarEditDialogFragment extends DialogFragment implements CalculatorE
}
}
+ private void processGreekButtons(@Nonnull View root, @Nonnull final EditText editName, int greekButtonsViewId) {
+ final ViewGroup greekButtons = (ViewGroup) root.findViewById(greekButtonsViewId);
+ Views.processViewsOfType(greekButtons, Button.class, new Views.ViewProcessor