StyledDialogs for Android

Android library for creating styleable dialogs easily

License

License

GroupId

GroupId

eu.inmite.android.lib
ArtifactId

ArtifactId

android-styled-dialogs
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

aar
Description

Description

StyledDialogs for Android
Android library for creating styleable dialogs easily
Project URL

Project URL

https://github.com/inmite/android-styled-dialogs
Source Code Management

Source Code Management

https://github.com/inmite/android-styled-dialogs

Download android-styled-dialogs

How to add to project

<!-- https://jarcasting.com/artifacts/eu.inmite.android.lib/android-styled-dialogs/ -->
<dependency>
    <groupId>eu.inmite.android.lib</groupId>
    <artifactId>android-styled-dialogs</artifactId>
    <version>1.2.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/eu.inmite.android.lib/android-styled-dialogs/
implementation 'eu.inmite.android.lib:android-styled-dialogs:1.2.0'
// https://jarcasting.com/artifacts/eu.inmite.android.lib/android-styled-dialogs/
implementation ("eu.inmite.android.lib:android-styled-dialogs:1.2.0")
'eu.inmite.android.lib:android-styled-dialogs:aar:1.2.0'
<dependency org="eu.inmite.android.lib" name="android-styled-dialogs" rev="1.2.0">
  <artifact name="android-styled-dialogs" type="aar" />
</dependency>
@Grapes(
@Grab(group='eu.inmite.android.lib', module='android-styled-dialogs', version='1.2.0')
)
libraryDependencies += "eu.inmite.android.lib" % "android-styled-dialogs" % "1.2.0"
[eu.inmite.android.lib/android-styled-dialogs "1.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » support-v4 jar 19.1.0

Project Modules

There are no modules declared in this project.

StyledDialogs for Android

Build Status License Android Arsenal

Screenshot of the dialogs

Demo app:

Get it on Google Play

Features:

  • Compatible with Material Design Guidelines
  • Same look for Android 2.2+
  • Built on top of standard DialogFragment
  • Supports stacked buttons, neutral button, callbacks even after rotation
  • Light and dark theme
  • Contains even more specialized dialogs: List, Progress, Time&Date Picker, Custom, ...

How to include it in your project:

dependencies {
	compile 'com.avast:android-styled-dialogs:2.3.3'
}

Hosted in jcenter: Download

Looking for Holo dialogs?

How to style all dialogs:

It uses standard Material colors, for example like this:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/indigo</item>
        <item name="colorPrimaryDark">@color/indigo_dark</item>
        <item name="colorAccent">@color/pink</item>
</style>

For dark theme, inherit from Theme.AppCompat. Or you can force dark theme per individual dialog using useDarkTheme() builder method. You can also force light theme per individual dialog using useLightTheme() builder method.

How to create simple dialogs:

Easy:

Dialog with a simple message only:

SimpleDialogFragment.createBuilder(this, getSupportFragmentManager()).setMessage(R.string.message).show();

Dialog with a title, message and two buttons:

SimpleDialogFragment.createBuilder(this, getSupportFragmentManager()).setTitle(R.string.title).setMessage(R.string.message).setPositiveButtonText(R.string.positive_button).setNegativeButtonText(R.string.negative_button).show();

How to react on button press in your Activity/Fragment:

Simply implement interface ISimpleDialogListener in your Activity/Fragment. Listener's callbacks have requestCode parameter - you can use it if you have more dialogs in one Activity/Fragment.

For Fragments use setTargetFragment() method in the builder.

It's not possible to use normal Java callbacks, because they are lost after device rotation.

How to react on cancelling the dialog:

Implement interface ISimpleDialogCancelListener in your Activity/Fragment.

How to create custom DialogFragments:

Extend BaseDialogFragment.

Have a look at JayneHatDialogFragment for a practical example.

Contributing

Pull requests are welcomed!

Please set your Android Studio formatting to our code style.

Why 'Dialogs'?

Theodor Dialogs was a famous Czech painter, uncle of Jára Cimrman. Jára Cimrman was a playwright, philosopher, inventor, teacher, poet, mathematician and more but he lacked painting skills. That's why Theodor was helping him with many projects. Just like Android and this library do.

See our other Czech personalities who help with #AndroidDev.

eu.inmite.android.lib

Inmite s.r.o.

Versions

Version
1.2.0
1.1.2
1.1.1
1.1
1.0.1
1.0
0.5.7