Add this to your module's build.gradle
file:
dependencies {
...
implementation 'com.bestsoft32.tayyab:tt-fancy-gif-dialog:1.0.2'
}
new TTFancyGifDialog.Builder(MainActivity.this)
.setTitle("Online Shopping")
.setMessage("You don't have time for shopping, Visit our website for online shopping with discount price.")
.setPositiveBtnText("Ok")
.setPositiveBtnBackground("#22b573")
.setNegativeBtnText("Cancel")
.setNegativeBtnBackground("#c1272d")
.setGifResource(R.drawable.gif1) //pass your gif, png or jpg
.isCancellable(true)
.OnPositiveClicked(new TTFancyGifDialogListener() {
@Override
public void OnClick() {
Toast.makeText(MainActivity.this,"Ok",Toast.LENGTH_SHORT).show();
}
})
.OnNegativeClicked(new TTFancyGifDialogListener() {
@Override
public void OnClick() {
Toast.makeText(MainActivity.this,"Cancel",Toast.LENGTH_SHORT).show();
}
})
.build();
new TTFancyGifDialog.Builder(MainActivity.this)
.setTitle("Online Shopping")
.setMessage("You don't have time for shopping, Visit our website for online shopping with discount price.")
.setPositiveBtnText("Ok")
.setPositiveBtnBackground("#22b573")
.setGifResource(R.drawable.gif1) //pass your gif, png or jpg
.isCancellable(true)
.OnPositiveClicked(new TTFancyGifDialogListener() {
@Override
public void OnClick() {
Toast.makeText(MainActivity.this,"Ok",Toast.LENGTH_SHORT).show();
}
})
.build();
Please click the image below to enlarge.
存在github的releases上
http://blog.csdn.net/lib739449500/article/details/55261225
存到bintray上
上传到组织 https://www.jianshu.com/p/b5d3462407fc
上传到个人 https://www.jianshu.com/p/9f81d5b5a451