yilylong / Cbdialog
一个快速创建对话框的工具类库
Stars: ✭ 246
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Cbdialog
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+5562.2%)
Mutual labels: dialog
Dialogx
💬DialogX对话框组件库,更加方便易用,可自定义程度更高,扩展性更强,轻松实现各种对话框、菜单和提示效果,更有iOS、MIUI等主题扩展可选
Stars: ✭ 227 (-7.72%)
Mutual labels: dialog
Arbitrary Text To Image Papers
A collection of arbitrary text to image papers with code (constantly updating)
Stars: ✭ 196 (-20.33%)
Mutual labels: dialog
Wc Messagebox
基于 Vue 2.0 开发的 Alert, Toast, Confirm 插件, UI仿照 iOS 原生
Stars: ✭ 203 (-17.48%)
Mutual labels: dialog
Fabulousfilter
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa
Stars: ✭ 2,477 (+906.91%)
Mutual labels: dialog
Modali
A delightful modal dialog component for React, built from the ground up to support React Hooks.
Stars: ✭ 183 (-25.61%)
Mutual labels: dialog
Alertview
A library to create simple alerts easily with some customization.
Stars: ✭ 222 (-9.76%)
Mutual labels: dialog
React Native Simple Dialogs
⚛ Cross-platform React Native dialogs based on the Modal component
Stars: ✭ 218 (-11.38%)
Mutual labels: dialog
Progress dialog
A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it.
Stars: ✭ 196 (-20.33%)
Mutual labels: dialog
Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (-25.61%)
Mutual labels: dialog
Dialogrpt
EMNLP 2020: "Dialogue Response Ranking Training with Large-Scale Human Feedback Data"
Stars: ✭ 216 (-12.2%)
Mutual labels: dialog
Focus Layers
Tiny React hooks for isolating focus within subsections of the DOM.
Stars: ✭ 238 (-3.25%)
Mutual labels: dialog
Dialogsheet
An Android library to create fully material designed bottom dialogs similar to the Android Pay app.
Stars: ✭ 236 (-4.07%)
Mutual labels: dialog
CBDialog
一个快速创建对话框的工具类库
支持各种样式的配置
集成了sweet-alert-dialog
集成了Titanic的进度框动画样式
集成了AVLoadingIndicatorView的动画样式
How To Useage
引入依赖
step1.Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.yilylong:CBDialog:1.1.0'
}
code
new CBDialogBuilder(this)
.setTouchOutSideCancelable(true)
.showCancelButton(true)
.setTitle("这是一个普通样式的对话框")
.setMessage("this is a normal CBDialog")
.setConfirmButtonText("确定")
.setCancelButtonText("取消")
.setDialogAnimation(CBDialogBuilder.DIALOG_ANIM_SLID_BOTTOM)
.create().show();
可以传入不同的样式
CBDialogBuilder.DIALOG_STYLE_NORMAL
CBDialogBuilder.DIALOG_STYLE_PROGRESS
CBDialogBuilder.DIALOG_STYLE_PROGRESS_TITANIC
CBDialogBuilder.DIALOG_STYLE_PROGRESS_AVLOADING
new CBDialogBuilder(this, CBDialogBuilder.DIALOG_STYLE_PROGRESS_TITANIC).create();
.setTouchOutSideCancelable(true) 设置是否点击对话框以外的区域dismiss对话框
.showCancelButton(true) 是否显示取消按钮
.setDialogAnimation(CBDialogBuilder.DIALOG_ANIM_SLID_BOTTOM) 设置对话框的动画样式
.setDialoglocation(CBDialogBuilder.DIALOG_LOCATION_BOTTOM) 设置对话框位于屏幕的位置
.setButtonClickListener(true, new CBDialogBuilder.onDialogbtnClickListener() { 添加按钮回调监听
@Override
public void onDialogbtnClick(Context context, Dialog dialog, int whichBtn) {
switch (whichBtn) {
case BUTTON_CONFIRM:
Toast.makeText(context, "点击了确认按钮", Toast.LENGTH_SHORT).show();
break;
case BUTTON_CANCEL:
Toast.makeText(context, "点击了取消按钮", Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
})
设置一个列表 和 列表项选中回调监听
.setItems(new String[]{"较小", "中等", "较大", "巨无霸"}, new CBDialogBuilder.onDialogItemClickListener() {
@Override
public void onDialogItemClick(CBDialogBuilder.DialogItemAdapter ItemAdapter,Context context, CBDialogBuilder dialogbuilder, Dialog dialog,int position) {
//TODO 保存选中设置
dialog.dismiss();
}
}, 2)
设置一个进度框的超时监听
.setOnProgressOutTimeListener(5, new CBDialogBuilder.onProgressOutTimeListener() {
@Override
public void onProgressOutTime(Dialog dialog, TextView dialogMsgTextView) {
// do your work
}
})
设置avloading进度框动画样式颜色
.setProgressIndicatorColor(0xaa198675)
.setProgressIndicator(CBDialogBuilder.INDICATOR_BallRotate)
设置自定义的dialog布局文件
在构建的时候传入R.layout.layout_custom_dialog_layout自定义布局文件即可,但是里面的个控件(标题,消息,按钮)的ID要跟cb_dialog.xml 里面一致
new CBDialogBuilder(this, R.layout.layout_custom_dialog_layout, 1.0f)
...
.create().show();
设置自定义消息布局文件 --
.setView(R.layout.custom_msg_view)
自定义消息布局的运用示例
更多配置方法参考DEMO
感谢
sweet-alert-dialog
Titanic的进度框动画样式
AVLoadingIndicatorView的动画样式
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].