Android自定义Dialog----CoolDialog

作者: 宛丘之上兮 | 来源:发表于2018-02-08 17:28 被阅读194次

最近完成了一个开源项目:CoolDialog,github代码地址,代码很少,只有两个kotlin类:CoolDialog.ktCoolStyle.kt

CoolDialog能够满足大部分样式需求,包括:

  1. 自定义背景withBgAndTopbg
  2. 自定义头部背景withBgAndTopbg
  3. 自定义标题和icon withTitlewithIcon
  4. 自定义“取消”和“确定”按钮withNegativeBtnwithPositiveBtn
  5. 自定义对话框内容withMsgwithMsgSubwithContentCustom
  6. 自定义对话框动画withCustomAnim,库中提供的动画参考了这个项目
  7. 自定义Gravity和左上右下的边距show(gravity: Int = Gravity.CENTER, paddingLeft: Int = mPadding, paddingTop: Int = mPadding, paddingRight: Int = mPadding, paddingBottom: Int = mPadding)
图1 cooldialogAnim.gif

使用

maven:

<dependency>
  <groupId>com.zzh.cooldialog</groupId>
  <artifactId>cooldialog</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

gradle:

compile 'com.zzh.cooldialog:cooldialog:1.0.0'

Ivy:

<dependency org='com.zzh.cooldialog' name='cooldialog' rev='1.0.0'>
  <artifact name='cooldialog' ext='pom' ></artifact>
</dependency>

相关文章

网友评论

    本文标题:Android自定义Dialog----CoolDialog

    本文链接:https://www.haomeiwen.com/subject/vbzzzxtx.html