Skip to content

Commit

Permalink
- Adding support for use of StringRes, ColorRes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank02051997 committed Sep 17, 2020
1 parent ad15992 commit a6238d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add this to your module's `build.gradle` file (make sure the version matches the
```gradle
dependencies {
...
implementation 'com.github.Shashank02051997:FancyGifDialog-Android:1.2'
implementation 'com.github.Shashank02051997:FancyGifDialog-Android:1.3'
}
```
## Fancy Gif Dialog
Expand All @@ -40,12 +40,12 @@ Dialog with two buttons:

``` java
new FancyGifDialog.Builder(this)
.setTitle("Granny eating chocolate dialog box")
.setMessage("This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog.")
.setNegativeBtnText("Cancel")
.setPositiveBtnBackground("#FF4081")
.setPositiveBtnText("Ok")
.setNegativeBtnBackground("#FFA9A7A8")
.setTitle("Granny eating chocolate dialog box") // You can also send title like R.string.from_resources
.setMessage("This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog.") // or pass like R.string.description_from_resources
.setNegativeBtnText("Cancel") // or pass it like android.R.string.cancel
.setPositiveBtnBackground("#FF4081") // or pass it like R.color.positiveButton
.setPositiveBtnText("Ok") // or pass it like android.R.string.ok
.setNegativeBtnBackground("#FFA9A7A8") // or pass it like R.color.negativeButton
.setGifResource(R.drawable.gif1) //Pass your Gif here
.isCancellable(true)
.OnPositiveClicked(new FancyGifDialogListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.ColorRes;
Expand Down Expand Up @@ -139,7 +138,6 @@ public Builder setGifResource(int gifImageResource) {

public FancyGifDialog build() {
TextView message1, title1;
ImageView iconImg;
Button nBtn, pBtn;
GifImageView gifImageView;

Expand Down
8 changes: 4 additions & 4 deletions fancygifdialoglib/src/main/res/layout/fancygifdialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
tools:text="Granny eating chocolate dialog box"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="16dp" />
android:textSize="16dp"
tools:text="Granny eating chocolate dialog box" />

<TextView
android:id="@+id/message"
Expand All @@ -67,9 +67,9 @@
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
tools:text="This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog."
android:textAlignment="center"
android:textSize="14dp" />
android:textSize="14dp"
tools:text="This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog." />

<LinearLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit a6238d8

Please sign in to comment.