README_EN.md 14 KB

🌐 View 简体中文文档 | 繁體中文文檔

Kongzue DialogX

An easy-to-use dialog box component with better experience than native dialog box, more customizable, more scalable, easy to achieve a variety of dialog boxes, menus and hint effects, more iOS, MIUI, Material You and other theme extensions are available.

DialogX

DialogX Advantages

Dialogs are a crucial part of software-user interaction, and DialogX makes it easy for developers to handle all of this. We are committed to creating a dialog component that is convenient to use anytime, anywhere, allowing developers to worry less and accomplish more. DialogX is not only user-friendly but also provides a wealth of customization interfaces, such as custom layouts, day-night mode switching, and the creation of exclusive app themes.

✅ DialogX Highlights

  • Diverse Implementations: DialogX defaults to a lighter View implementation but also supports other modes like Window or DialogFragment, offering flexibility and freedom.
  • Thread Safety: No matter which thread you start DialogX from, it will automatically run on the UI thread, eliminating thread-related concerns.
  • One-Click Launch: No need for a context parameter; just one line of code to launch the dialog—super convenient.
  • Style Customization: Customize the styles of all components, from titles to hints, including text, buttons, menus, input fields, or even inserting any custom layout.
  • Multiple Themes: Comes with a Material theme by default, with additional options like Material You, iOS, Kongzue, MIUI, and more. It also supports custom themes, helping to reduce app size.
  • Low Coupling: Even if the Activity is closed during runtime, DialogX can automatically destroy itself to avoid memory leaks like WindowLeaked.
  • Rich Animations: Utilizes non-linear animations and smooth transitions from loading to error states, making your app more dynamic.
  • Light/Dark Mode: Switch between light and dark themes with one click, automatically adapting to the system's light/dark mode to meet customization needs.
  • Lifecycle and Immersive Support: Easily manage dialog lifecycles and perfectly adapt to immersive experiences.
  • Penetration Capabilities: Two powerful features—data penetration (temporary storage locker) and action penetration (shortcut keys)—help you effortlessly achieve data transfer and flexible control, ensuring safety and reliability.

DialogX

DialogX contains the following dialog components:

基础对话框 MessageDialog和 输入对话框 InputDialog

The basic dialog box component can realize the basic dialog box business logic, including the title, message text, single/double/triple button reminder function, and the three buttons can be displayed vertically/horizontally to meet most of the daily blocking reminder requirements.

InputDialog is an extension component of the basic dialog box, which not only contains the basic functions but also provides input box, customizable input prompt text, input text style and callback of input content after clicking the button.

等待框 WaitDialog 和提示框 TipDialog

The blocking wait dialog, which displays the basic circular wait animation as well as the progress display animation, is single-instance, which means that switching from the wait state (WaitDialog) to the tip state (TipDialog) is seamless, and you can freely choose to display three states of success/warning/error message alerts at the end of the wait, and the animation switching will be seamless.

底部对话框 BottomDialog 和底部菜单 BottomMenu

BottomDialog provides a pop-up dialog style from the bottom, with title, prompt text and custom layout.

BottomMenu is an extension of BottomDialog, which provides additional menu function on top of BottomDialog, the menu can set menu content/menu icon/select function, and can also provide "Cancel" close button under different themes.

简单提示 PopTip

Provides a Toast-like text prompt feature, but with more powerful customization properties. You can set text tips, icons, and a control button, and you can set a continuous display or define the length of time it will automatically disappear. popTip is a non-blocking tip, which means that the user can still operate the interface while popTip is displayed.

简单通知提示 PopNotification

This component is not a replacement for Notification, does not support cross-platform display by default (you can use the hover permission to allow it), and is only used for in-app notification alerts, with more powerful customization properties. PopNotification is a non-blocking alert, meaning that the user can still operate the interface while PopNotification is displayed.

全屏对话框 FullScreenDialog

FullScreenDialog provides a pop-up effect from the bottom, similar to BottomDialog but with more freedom of customization than BottomDialog. FullScreenDialog will not provide any base implementation, developers can customize the layout. By default, it will only provide a default down-close logic and a sunken Activity background display effect.

自定义对话框 CustomDialog

CustomDialog provides ALIGN option to easily customize the pop-up mode of the dialog box, which supports multiple pop-up modes of screen center, screen bottom, screen top, screen left and screen right by default, and also provides corresponding pop-up animation effect, of course, users can also customize the animation effect.

引導對話框 GuideDialog

A mask can be implemented to show the operation guide diagram, or to guide the operation tips for buttons. GuideDialog can be displayed around a component on the interface and realize the effect of stage light. Stage light can be selected from round (outer, inner), square (outer, inner) and rectangle modes, and square and rectangle can be set with rounded corners.

Themes

DialogX主题

DialogX adopts a theme separation structure, the main framework contains only Material design style dialog components, you can extend the themes by introducing additional theme packages.

In addition, each set of themes contains two display styles: light/dark, and you can freely switch the display of dialogs through DialogX's settings.

Theme design developers can also use the theme customization interface provided by DialogX to implement custom themes, or to style and modify existing themes.

You can also go deeper Learn how to use the DialogX theme

You can also go deeper Learn how to make a DialogX theme

Demo

You can try it by downloading the demo first: http://beta.kongzue.com/DialogXDemo

下载Demo

Start using DialogX

Because of dependencies, DialogX currently only supports AndroidX as the base for development. If you are using the latest version of Android Studio, the default project will be created using AndroidX as the underlying framework.

📥Introduce

Please choose one of the following two sources to bring in your project.

MavenCentral

Latest version: DialogX Release

1) In the project's build.gradle file, find the allprojects{} block and add the following code.

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()      //增加 mavenCentral 仓库
    }
}

⚠️ Please note that projects created with the Arctic Fox version of Android Studio will require you to go to settings.gradle and add the above jitpack repository configuration.

2) Find the dependencies{} code block in the app's build.gradle file and add the following statement to it.

def dialogx_version = "0.0.49"
implementation "com.kongzue.dialogx:DialogX:${dialogx_version}"

Jitpack

Latest Version: Jitpack.io

Latest Version: Jitpack.io Latest Version

1) In the project's build.gradle file, find the allprojects{} block and add the following code.

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }      //add jitPack Maven
    }
}

⚠️Please note that projects created with the Arctic Fox version of Android Studio require you to go to settings.gradle to add the above jitpack repository configuration.

2) Find the dependencies{} block in the app's build.gradle file, and add the following statement to it:

def dialogx_version = "0.0.49"
implementation "com.github.kongzue.DialogX:DialogX:${dialogx_version}"

▶️How to use

For specific instructions, see DialogX Wiki

🧩 Expansion Pack

Currently DialogX still provides only the most basic dialog implementation and no advanced functional modules, in order to avoid bloating your application.

However, in order to ensure that some common features, such as address selection, date selection and "share to" dialogs, are simpler to use, we provide extensions to meet these needs.

Each module is introduced separately in the extension package, so you don't need to worry about introducing unnecessary features and resources.

The extension package is currently in the preliminary development stage, to preview or make your suggestions, please visit: DialogXSample

DialogXSample

ℹ️Having trouble using it?

View FAQ

❤️Powered By DialogX

Powered By DialogX

🚀 More >

🔁How to Migrate from DialogV3 to DialogX

Please refer to the article Migrating from DialogV3 to DialogX

⭐Stargazer

Stargazers over time

License

DialogX follows the Apache License 2.0 open source license.

Copyright Kongzue DialogX

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributors

Thank you to all who have contributed to DialogX!

If DialogX has helped you build your software better, please give DialogX a Star, every click you make is a great support for DialogX!

Assist in development