diff --git a/README.md b/README.md index 8eb5983..1bf4b53 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ You can try it out here [Sample Application](https://github.com/Far5had70/Calcul CalculatorDialog calculatorDialog = new CalculatorDialog() .setAlertRadius(30) .setCalc("0") + .setTextButton("ثبت") .setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf")) .setListener(new Listener() { @Override diff --git a/app/src/main/java/com/sharjbook/calculator/MainActivity.java b/app/src/main/java/com/sharjbook/calculator/MainActivity.java index 5cc7758..7fcf90c 100644 --- a/app/src/main/java/com/sharjbook/calculator/MainActivity.java +++ b/app/src/main/java/com/sharjbook/calculator/MainActivity.java @@ -26,6 +26,7 @@ public void onClick(View v) { CalculatorDialog calculatorDialog = new CalculatorDialog() .setAlertRadius(30) .setCalc(editText.getText().toString()) + .setTextButton("ثبت") .setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf")) .setListener(new Listener() { @Override diff --git a/calculator/src/main/java/com/waspar/calculator/CalculatorDialog.java b/calculator/src/main/java/com/waspar/calculator/CalculatorDialog.java index 1ca006d..a1d6b56 100644 --- a/calculator/src/main/java/com/waspar/calculator/CalculatorDialog.java +++ b/calculator/src/main/java/com/waspar/calculator/CalculatorDialog.java @@ -25,6 +25,7 @@ public class CalculatorDialog extends DialogFragment { private Listener listener; private Typeface typeFace; private String number = ""; + private String textButton = "ثبت"; TextView button0, button1, button2, button3, button4, button5, button6, button7, button8, button9, buttonAdd, buttonSub, buttonDivision, @@ -104,6 +105,8 @@ private void init() { crunchifyEditText.setText(""+number); } + Submit.setText(textButton); + button1.setOnClickListener(new View.OnClickListener() { @Override @@ -365,6 +368,11 @@ public CalculatorDialog setCalc(String number) { return this; } + public CalculatorDialog setTextButton(String textButton) { + this.textButton = textButton; + return this; + } + }