Skip to content

lichao3140/GifDialog

Repository files navigation

Gif Dialog Android动画对话框

platform API License

Dependency

Add this to your module's build.gradle file:

dependencies {
	...
	implementation 'com.bestsoft32.tayyab:tt-fancy-gif-dialog:1.0.2'
}

Gif Dialog

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();

Gif Dialog Without Negative Button

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();

Screenshots

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