Open-source project
orhanobut/dialogplus avatar
orhanobut/dialogplus

DialogPlus 1.11: pixel-based list, grid and custom dialogs for Android that attach to the Activity's content view

Advanced dialog solution for android

4,955 stars776 forksKotlinApache-2.0

At a glance

What is it?
orhanobut/dialogplus is a Kotlin and Android library for dialogs shown inside an Activity, with list, grid and custom-layout holders and animated placement at the top, center or bottom. The published artifact is 1.11 from January 2016, and the README documents several rough edges around back handling and insets.
Who is it for?
Use DialogPlus if an older Android app needs bottom, center or top dialogs backed by a BaseAdapter or a custom layout, and you are happy with pixel-based sizing and manual cleanup. Pick something newer if your app relies on predictive back or must survive configuration changes with the dialog open, because the published 1.11 release uses legacy back-key handling and the README says not to retain the dialog across them.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 53 days ago.
What is it written in?
Mainly Kotlin, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • orhanobut/dialogplus4,955 ★ · -2
Star history
Repository2026-10-092026-11-25
orhanobut/dialogplus5k5k

-2 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The only published version is 1.11 from January 2016, though the repository was pushed in October 2026

The README states that the available Maven Central release is 1.11. The release list backs that up with dates: 1.11 on 2016-01-31, v1.10 on 2015-07-18 and v1.9 on 2015-07-12. The last push to master is dated 2026-10-03, and the repository is not archived, so work continues in the source while the released artifact has not changed for years.

The gap between those two facts shapes how you should read the documentation. The README notes that its examples use APIs available in 1.11, which means you are reading docs written against the released artifact and not against unreleased code. Anything on master that is newer is not something the dependency below gives you.

The dependency is declared in Kotlin DSL:

kotlin
repositories {
    mavenCentral()
}

dependencies {
    implementation("com.orhanobut:dialogplus:1.11")
}

The README adds a short instruction to use the ordinary Maven dependency declaration so Gradle includes its dependency metadata. In other words, do not copy the jar or the source into your project. The license is Apache-2.0, and the root also holds MAINTAINING.md, an api directory, an app sample module and a dialogplus library module.

A dialog is built with a chained builder and shown from the UI thread

Creation is a builder chain that ends in create(), followed by show(). The quick start passes an ArrayAdapter over three strings (Share, Save, Open) to setAdapter, sets an item click listener that shows a Toast and dismisses, and calls dialog.show():

kotlin
val dialog = DialogPlus.newDialog(this)
    .setAdapter(adapter)
    .setOnItemClickListener { dialog, item, _, _ ->
        Toast.makeText(this, item.toString(), Toast.LENGTH_SHORT).show()
        dialog.dismiss()
    }
    .create()

dialog.show()

The imports needed are com.orhanobut.dialogplus.DialogPlus, android.widget.ArrayAdapter and android.widget.Toast. The README says to create and show dialogs from an Activity on the UI thread. newDialog takes a context, and that context has to be an Activity, because the library attaches to the Activity's content view and not to a separate window.

That design differs from the platform Dialog class. Nothing here creates its own window, so the dialog lives and dies with the Activity layout. The default content holder is ListHolder, and list and grid holders need an adapter to display anything.

ListHolder, GridHolder(3) and ViewHolder decide what the dialog contains

Content is chosen with setContentHolder. A list is the default, written setContentHolder(ListHolder()). A grid takes a column count, so GridHolder(3) gives three columns. A custom layout uses ViewHolder(R.layout.dialog_content), and an existing view can be passed as ViewHolder(existingView). All holders are imported from com.orhanobut.dialogplus.

ViewHolder is the one exception to the adapter rule. It does not need an adapter. To reach its inflated content, use dialog.holderView, or find a child with dialog.findViewById(R.id.your_view).

Placement is a gravity call, setGravity. Gravity.BOTTOM is the default, with TOP and CENTER also supported, and Gravity comes from android.view. A centered dialog receives default margins unless you set them explicitly.

The README lists features beyond that: optional headers and footers, click and cancellation callbacks, expandable list and grid dialogs with drag gestures, and custom animations, dimensions, margins, padding and backgrounds.

Every dimension is in pixels, so the margins you type do not scale with screen density

The configuration section carries a warning in bold: dimensions, margins and padding are pixels, not dp. A call like setMargin(16, 24, 16, 24) draws exactly 16 and 24 pixels on every device, which looks cramped on a high-density screen. The README tells you to convert dp using display density when needed.

The builder offers a wide set of knobs for this: setContentWidth and setContentHeight with ViewGroup.LayoutParams values, setMargin, setPadding, setOutMostMargin, setContentBackgroundResource and setOverlayBackgroundResource, plus setInAnimation and setOutAnimation taking animation resources.

Expansion is a separate switch. setExpanded(true, 300) turns on dragging for list and grid dialogs with an initial height of 300 pixels. Expansion is disabled by default, and setExpanded(true) without a height uses two fifths of the available display height. ViewHolder content cannot be expanded this way, because the option is for list and grid only.

Headers and footers come from setHeader and setFooter, each accepting a layout resource or a View. dialog.headerView and dialog.footerView return the configured views, or null when none was set.

Click callbacks split by view type, and list positions skip the scrolling header

Two listeners handle taps. For custom content, headers and footers, setOnClickListener receives clicks on views that have an ID, and the sample branches on view.id, such as R.id.confirm. For list and grid rows, use setOnItemClickListener instead.

A detail that catches people: list item positions exclude the scrolling header. If you add a header with setHeader, position zero is the first data row and not the header, so index arithmetic that assumed the header counted will be off by one.

Lifecycle listeners are separate. setOnCancelListener fires on back button or outside touch cancellation. setOnDismissListener fires when the exit animation has completed, which is later than the call to dismiss(). setOnBackPressListener fires when the legacy back key was received.

Cancelable dialogs close on an outside touch or back key. setCancelable(false) turns off automatic cancellation, and dismiss() still closes the dialog. If you block cancellation, make sure some view in the dialog calls dismiss, or the user has no way out.

Back handling is legacy, so predictive back needs a manual route to dialog.onBackPressed

Release 1.11 supports Android API 10 and later. The published release uses legacy back-key handling, and the README gives a workaround for apps on newer back navigation. Apps using predictive back, or another back-navigation dispatcher, should route their dialog back action to dialog.onBackPressed(dialog), and leave the app's normal back action active when the dialog is hidden.

The edge-to-edge case has its own instruction. In an edge-to-edge Activity, apply system-bar insets to the hosting content so controls and dialogs stay clear of system UI. Because the dialog attaches to the content view, it inherits whatever that view does about insets, and the library does not adjust them for you.

Both issues share a cause. The library targets a 2016 platform model, and modern navigation and window rules are left to the app.

The dialog must be dismissed with the Activity and should not outlive a configuration change

Because the dialog attaches to the Activity's content view, it holds a reference to that Activity. The README says to retain the dialog in the Activity and dismiss it when the Activity is destroyed, and to avoid retaining it across configuration changes such as rotation.

In practice that means keeping the dialog in a field, calling dismiss in onDestroy, and recreating it when the Activity is rebuilt. State such as a selected row has to be saved by your code.

Operations must stay on the UI thread, per the quick start. Building the adapter data on a background thread is fine, but create, show and dismiss are not.

For a decision about adoption, this is the key trade. DialogPlus gives bottom-sheet-like list and grid dialogs with little code, and in return you manage lifetime, pixel conversion, insets and back routing yourself. The library is licensed Apache-2.0, so the source can be copied into an app and adapted if the stale 1.11 artifact is a problem.

Editorial conclusion

Use DialogPlus if an older Android app needs bottom, center or top dialogs backed by a BaseAdapter or a custom layout, and you are happy with pixel-based sizing and manual cleanup. Pick something newer if your app relies on predictive back or must survive configuration changes with the dialog open, because the published 1.11 release uses legacy back-key handling and the README says not to retain the dialog across them. Check the dialog against your system-bar insets first if the Activity is edge-to-edge.

Frequently asked questions

What is DialogPlus?

DialogPlus is an Android library that displays customizable dialogs inside an Activity. It supports list, grid and custom-layout content, with animated placement at the top, center or bottom.

How do I add DialogPlus to an Android project?

Add mavenCentral() to repositories and implementation("com.orhanobut:dialogplus:1.11") to dependencies. Release 1.11 is the version available on Maven Central.

Are DialogPlus margins in dp or pixels?

Pixels. Dimensions, margins and padding are all pixels, so convert dp using display density when needed.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. orhanobut/dialogplus on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/orhanobut-dialogplus.svg)](https://hysenlabs.com/projects/orhanobut-dialogplus)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/orhanobut-dialogplus.svg)](https://hysenlabs.com/projects/orhanobut-dialogplus)

Was this useful?