Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Far5had70 committed Nov 19, 2018
1 parent 01791aa commit 4b22af1
Showing 1 changed file with 13 additions and 85 deletions.
98 changes: 13 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
"# CalculatorAlert"

<img src="https://raw.githubusercontent.com/Far5had70/Falert/master/recorded.gif" height="480" width="270">

CalculatorAlert is a beautiful dialog for Android.



# Featuresnegative

type(single button , double button)

Background (button)

icon(drawable)

customView (View)

Button (size , color , text)

Radius (alert , button)

TypeFace(directory: Assets/sampleFont.ttf)


<img src="https://raw.githubusercontent.com/Far5had70/CalculatorDialog/master/record.gif" height="480" width="270">

CalculatorDialog is a beautiful calculator dialog for Android.

# Installation

Expand All @@ -34,7 +13,7 @@ Add it in your root build.gradle at the end of repositories:

```gradle
dependencies {
implementation 'com.github.Far5had70:Falert:1.5.0'
implementation 'com.github.Far5had70:CalculatorAlert:1.0.0'
}
```

Expand All @@ -54,7 +33,7 @@ Step 2. Add the dependency

## Demo

You can try it out here [Sample Application](https://github.com/Far5had70/Falert/blob/master/app/src/main/java/com/shaygan/customalert/MainActivity.java)
You can try it out here [Sample Application](https://github.com/Far5had70/CalculatorDialog/blob/master/app/src/main/java/com/sharjbook/calculator/MainActivity.java)



Expand All @@ -63,76 +42,25 @@ You can try it out here [Sample Application](https://github.com/Far5had70/Falert



**With Double Button Example:**
**Example:**

```java
LayoutInflater inflaterr = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View customView = inflaterr.inflate(R.layout.custom_view, null, false); // init custum view

Falert falert = new Falert(this)
.setButtonType(FalertButtonType.Double_BUTTON) // FalertButtonType.Double_BUTTON OR FalertButtonType.ONE_BUTTON
.customView(customView) // set your custom view here
.setAutoDismiss(true) // button rule, when user click on this
.setPositiveText("بلی") // set positive text
.setNegativeText("خیر") // set negative text
.setPositiveButtonBackground(getResources().getColor(R.color.falert_green)) // button (positive) background color
.setNegativeButtonBackground(getResources().getColor(R.color.falert_red)) // button (negative) background color
.setButtonTextColor(getResources().getColor(R.color.falert_white)) // button (all) text color
.setHeaderIcon(getResources().getDrawable(R.drawable.luncher)) // header icon drawable
.setAlertRadius(40) // set radius for alert view
.setButtonRadius(80) // set radius for button
.setButtonTextSize(13) // button (all) text size
.setHeaderIconEnable(true) // visible Or invisible Icon Header
.setButtonEnable(true) // visible Or invisible Buttons
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf")) // set typeface
.setDoubleButtonListener(new DoubleButtonListener() {
@Override
public void onClickPositive() {
Toast.makeText(MainActivity.this, "Positive", Toast.LENGTH_SHORT).show();
}

CalculatorDialog calculatorDialog = new CalculatorDialog()
.setAlertRadius(30)
.setCalc("0")
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf"))
.setListener(new Listener() {
@Override
public void onClickNegative() {
Toast.makeText(MainActivity.this, "Negative", Toast.LENGTH_SHORT).show();
public void OnSelectListener(int result) {
Toast.makeText(MainActivity.this, ""+result, Toast.LENGTH_SHORT).show();
}
});
falert.show(getSupportFragmentManager() , "");
```



**With Single Button Example:**
calculatorDialog.show(getSupportFragmentManager() , "");

```java
LayoutInflater inflaterr = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View customView = inflaterr.inflate(R.layout.custom_view, null, false); // init custum view

Falert falert = new Falert(this)
.setButtonType(FalertButtonType.ONE_BUTTON) // FalertButtonType.Double_BUTTON OR FalertButtonType.ONE_BUTTON
.customView(customView) // set your custom view here
.setAutoDismiss(true) // button rule, when user click on this
.setSingleButtonBackground(getResources().getColor(R.color.falert_green)) // button background color
.setButtonTextColor(getResources().getColor(R.color.falert_white)) // button text color
.setPositiveText("بلی") // set button text
.setHeaderIcon(getResources().getDrawable(R.drawable.luncher)) // header icon drawable
.setAlertRadius(40) // set radius for alert view
.setButtonRadius(80) // set radius for button
.setButtonTextSize(13) // button (all) text size
.setHeaderIconEnable(true) // visible Or invisible Icon Header
.setButtonEnable(true) // visible Or invisible Buttons
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf")) // set typeface
.setSingleButtonListener(new SingleButtonListener() {
@Override
public void onClick() {
Toast.makeText(MainActivity.this, "click", Toast.LENGTH_SHORT).show();
}
});
falert.show(getSupportFragmentManager() , "");
```




# Developed By

Farshad Asgharzadeh
Expand Down

0 comments on commit 4b22af1

Please sign in to comment.