All Projects → shaoshuai904 → XStyleDialog

shaoshuai904 / XStyleDialog

Licence: other
可定制化样式的Android Dialog

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to XStyleDialog

Android-Dialog
Android Dialog(BaseDialog、AlertDialog、ProgressDialog、SuccessDdialog、ErrorDialog、BottomDialog)
Stars: ✭ 36 (-2.7%)
Mutual labels:  dialog, alertdialog
KotlinDialogs
对话框工具,Dialog集合工具,引用了V7包的AlertDialog 使用的 kotlin_version = '1.3.11'写的
Stars: ✭ 16 (-56.76%)
Mutual labels:  dialog, alertdialog
CompatAlertDialog
No description or website provided.
Stars: ✭ 27 (-27.03%)
Mutual labels:  dialog, alertdialog
vue2-dialog
A mobile Vue plugin for VueDialog
Stars: ✭ 21 (-43.24%)
Mutual labels:  dialog
android-suspend-dialogs
A helper library for Android to display Dialogs by suspending the coroutine till finish of the dialog.
Stars: ✭ 32 (-13.51%)
Mutual labels:  dialog
CircularDialogs
Its a library for the creating simple success and warning dialogs for android
Stars: ✭ 34 (-8.11%)
Mutual labels:  dialog
cookie-consent-js
A simple dialog and framework to handle the German and EU law about cookies in a website (December 2021)
Stars: ✭ 55 (+48.65%)
Mutual labels:  dialog
Toaster-Library
🎫 Android library, Custom toast and dialog (2018)
Stars: ✭ 14 (-62.16%)
Mutual labels:  dialog
dialogbot
dialogbot, provide search-based dialogue, task-based dialogue and generative dialogue model. 对话机器人,基于问答型对话、任务型对话、聊天型对话等模型实现,支持网络检索问答,领域知识问答,任务引导问答,闲聊问答,开箱即用。
Stars: ✭ 96 (+159.46%)
Mutual labels:  dialog
flickabledialog
This dialog can flick and make it easy to dismiss sensuously.
Stars: ✭ 84 (+127.03%)
Mutual labels:  dialog
angular-custom-modal
Angular2+ Modal / Dialog (with inner component support).
Stars: ✭ 30 (-18.92%)
Mutual labels:  dialog
whatisnewdialog
An Android library for displaying a dialog where it presents new features in the app.
Stars: ✭ 22 (-40.54%)
Mutual labels:  dialog
focus-trap
A lightweight web component that traps focus within a DOM node
Stars: ✭ 44 (+18.92%)
Mutual labels:  dialog
probabilistic nlg
Tensorflow Implementation of Stochastic Wasserstein Autoencoder for Probabilistic Sentence Generation (NAACL 2019).
Stars: ✭ 28 (-24.32%)
Mutual labels:  dialog
Color-O-Matic
Beautiful color picker dialog for Android 9+
Stars: ✭ 43 (+16.22%)
Mutual labels:  dialog
babi tools
Augmentation scripts for the bAbI Dialog Tasks dataset
Stars: ✭ 14 (-62.16%)
Mutual labels:  dialog
vaadin-dialog
High quality web component for modal dialogs. Part of the Vaadin platform.
Stars: ✭ 15 (-59.46%)
Mutual labels:  dialog
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-62.16%)
Mutual labels:  dialog
FancyDialog
Kotlin + DSL风格代替传统的Builder模式 诸多可配置项 高阶函数代替自定义回调接口 书写起来超级顺手
Stars: ✭ 24 (-35.14%)
Mutual labels:  dialog
HeaderDialog
An android library to display a material-designed dialog with header.
Stars: ✭ 64 (+72.97%)
Mutual labels:  dialog

X style Dialog - 万能样式Dialog

API jitpack

下载demo.apk

XStyleDialog中内置多种常见样式的Dialog。

以AlertDialog为例,可以自定义整体大小比例背景TitleMessageLeft/Right Button字体颜色大小是否加粗上下左右间距,以及分割线颜色粗细

支持链式调用。需要那个设置那个,自动管理按钮的显示隐藏。以最简单的方式,实现Dialog的快速使用。

同时提供具体View的获取方法,可以满足任意需求的改造。而不失优雅。

快速使用

Step 1. 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 {
	// for Support
	implementation 'com.github.shaoshuai904:XStyleDialog:1.5.1'
	// for androidx
	implementation 'com.github.shaoshuai904:XStyleDialog:2.0.5'
}

show_01

show_02

show_05

show_03

show_04

  • 基础风格确定

通过重写AlertDialog的Config类,实现对Dialog样式的基础定义。以满足自己app的风格。

示例用法 -(自定义风格Config类 传送门)

  • 基础之外的特例

在具体使用时,可以单独设置 特定样式,以满足 基础样式 之外的特定需求。

    // 方法1. 重写Config类中的属性
    val config = AlertDialog.Config(mContext).apply {
        rightBtnColor = Color.RED
        messagePaddingBottom = 40f.dp2px(mContext)
    }
    AlertDialog(mContext, config)
        .setXXX ...
        .setMessage("消息内容", spSize = 14f) // 方法2. 在setXXX方法中设置。(有效级最高,会覆盖Config中的配置)
        .show()

AlertDialog

样式布局: [ 标题 + 消息文本 + 左按钮 + 右按钮 ]  消息文本兼容html样式
        new AlertDialog(mContext)
                .setCancelable(false)
                .setTitle("退出当前账号")
                .setMessage("再连续登陆15天,就可变身为QQ达人。退出QQ可能会使你现有记录归零,确定退出?")
                .setLeftButton("取消") //.setLeftButton("取消", null)
                .setRightButton("确认退出", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        showToast("exit");
                    }
                })
                .show();

ActionSheetDialog

样式布局:[ 标题 + 页签条目 + 取消按钮 ]
        ActionSheetDialog(this).apply {
                setTitle("请选择操作")
                setCancelable(false)
                setCanceledOnTouchOutside(false)
                addSheetItem("条目一", Color.parseColor(DEF_RED))
                addSheetItem("条目二")
                addSheetItem("条目三", Color.BLUE)
                // ……
                addSheetItem(SheetItem("条目九"))
                addSheetItem(SheetItem("条目十", Color.CYAN))
                itemClickListener = OnSheetItemClickListener { item, position ->
                    showToast("clear msg list")
                }
                setCancelText("取 消")
            }.show()

完整预览各类用法 -(简单使用类 传送门)


v2.0.5

  • 更新minSdkVersion = 19

  • 提供setScaleWidthsetScaleHeight方法设置Dialog的屏幕百分比宽度和高度

  • 提供Dialog的getRootView及各个子View方法,以支持深度自定义。

  • 提供Dialog的Config配置文件,以支持不同app默认样式。

  • 新增AlertDialog和AlertEditDialog的Cancelable自适应宽度设置。

  • 对各个Dialog的TitleMessageCancel/OK Button新增了字体大小字体颜色是否加粗等设置。

  • 开放了ActionSheetDialog中 SheetItem 字体颜色和 Cancel Button 显示文本的自定义设置。

  • AlertDialog [ 标题 + 消息文本 + 左按钮 + 右按钮 ] 兼容html样式

  • AlertEditDialog

  • AlertNumberPickerDialog

  • ActionSheetDialog

  • ActionSheetListDialog,支持复杂item布局,同时支持item选中样式

  • ActionSheetRecyclerDialog,支持自定义item Bean,自定义最大、最小高度,自定义分割线,自定义样式选择

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].