GithubHelp home page GithubHelp logo

pranavmaganti / compose-material-dialogs Goto Github PK

View Code? Open in Web Editor NEW
575.0 9.0 78.0 113.21 MB

A Material Dialog Builder for Jetpack Compose

License: Other

Kotlin 100.00%
android dialogs material jetpack-compose color-picker date-time-picker date time picker jetpack-compose-dialogs

compose-material-dialogs's People

Contributors

ch4rl3x avatar codacy-badger avatar davols avatar fractalwrench avatar gabriel403 avatar gm666q avatar ivaniskandar avatar jahor avatar joeywp avatar kalinjul avatar kvpbldsck avatar kylemcb avatar nelzkielabs avatar nogard avatar pranavmaganti avatar skolson avatar syer10 avatar wojta avatar yannickpulver avatar zsteed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compose-material-dialogs's Issues

Support Compose Multiplatform

Thank you for making this nice components for Jetpack Compose! πŸ‘

I would like to use the date picker on a project using JetBrains fork compose-jb.

Currently it can't be used for some reasons in "commonMain" and is filtered out.
I don't understand right now how this filtering works there.

I tried to copy the classes to my project and see if it works this way.
Thereby I figured out that most (nearly all) of the code compiles and seems to be compatible already.
Just some Android specialities like the @StringRes annotation do not work.

I was thinking that you could strip out Android helper methods and special stuff to an additional package and have a package that's purely compose and would work for compose-jb also.

What do you think?

Update compose to the latest version

With the new version of the Jetpack compose Alpha 11. There is a crash while opening the Dialog.

java.lang.NoSuchMethodError: No static method rememberMeasureBlocks(Landroidx/compose/ui/Alignment;Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/node/MeasureBlocks; in class Landroidx/compose/foundation/layout/BoxKt; or its super classes (declaration of 'androidx.compose.foundation.layout.BoxKt' appears in /data/app/com.sap.ariba.mint-WOSP5E9h7725q-wmcj6Qhw==/base.apk)

Could not find dev.chrisbanes.accompanist:accompanist-coil:0.1.8.ui-6721902-SNAPSHOT

Hello,

This is a really cool library, thanks so much for sharing it. I appreciate also that you have updated it for dev 16 so fast πŸ˜„

When trying with 16, I get this:


   > Could not find dev.chrisbanes.accompanist:accompanist-coil:0.1.8.ui-6721902-SNAPSHOT.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/maven-metadata.xml
       - https://dl.google.com/dl/android/maven2/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/accompanist-coil-0.1.8.ui-6721902-SNAPSHOT.pom
       - https://jcenter.bintray.com/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/maven-metadata.xml
       - https://jcenter.bintray.com/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/accompanist-coil-0.1.8.ui-6721902-SNAPSHOT.pom
       - https://dl.bintray.com/kotlin/kotlin-eap/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/maven-metadata.xml
       - https://dl.bintray.com/kotlin/kotlin-eap/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/accompanist-coil-0.1.8.ui-6721902-SNAPSHOT.pom
       - https://jitpack.io/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/maven-metadata.xml
       - https://jitpack.io/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/accompanist-coil-0.1.8.ui-6721902-SNAPSHOT.pom
       - https://repo.maven.apache.org/maven2/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/dev/chrisbanes/accompanist/accompanist-coil/0.1.8.ui-6721902-SNAPSHOT/accompanist-coil-0.1.8.ui-6721902-SNAPSHOT.pom
     Required by:
         project :app > com.vanpra.compose-material-dialogs:core:0.1.6

Is that a pre release of accompanist that may have been removed maybe? Probably I am doing something wrong.

Compile error kotlinCompiler 1.4.20 AndroidStudio 2020.3.1

CLOSED: Sorry. Changed alpha08-> 09 and 1.4.20 -> 1.4.21 and it compiles

Project builds fine. Now insert in file build.gradle:
implementation "com.vanpra.compose-material-dialogs:core:0.2.8"
Sync gradle and rebuild. The compiler shows that message:

java.lang.AssertionError: CALL 'public final fun <get-currentComposer> (): androidx.compose.runtime.Composer<*> declared in androidx.compose.runtime.ComposerKt' type=androidx.compose.runtime.Composer<*> origin=FOR_LOOP_ITERATOR

	at androidx.compose.compiler.plugins.kotlin.lower.ComposerIntrinsicTransformer.visitCall(ComposerIntrinsicTransformer.kt:54)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:199)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:74)
	at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:33)
	at org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression.transformChildren(IrFunctionAccessExpression.kt:48)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpression(IrElementTransformerVoid.kt:131)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitMemberAccess(IrElementTransformerVoid.kt:192)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFunctionAccess(IrElementTransformerVoid.kt:195)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:198)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposerIntrinsicTransformer.visitCall(ComposerIntrinsicTransformer.kt:61)

After removing the implementation the build is fine again.

Do you know why this happens?
Thanks

Start accepting T types

I'll keep it short. Version: implementation "io.github.vanpra.compose-material-dialogs:core:0.3.3"

It's not possible to pass a List of T (or simply a "Collection") into methods such as listItems(list = . This breaks a lot of flexibility, and looking at the source code there is no reason you're accepting a List of Strings (other than wanting to copy Afollestad)

Please consider accepting T/Collection types. To render text on screen you can call its toString().


Right now I need to map my existing List of custom models into a List, then get the original object back from the list of indices...


For what it's worth, internally you're calling inline fun <T> LazyListScope.itemsIndexed(items: List<T> which also accepts T type

Datetimepicker - wrong time

Wrong minutes in Datetimepicker.
Error in function:
internal fun LocalTime.noSeconds(): LocalTime = LocalTime.of(this.hour, this.second)
Second argument must be minute.

upd. Sorry, already fixed here, error in 0.4.3

Timepicker is too large for smaller devices

When using timepicker, for example

MaterialDialog = MaterialDialog().also {
    it.build {
        timepicker(
            title = "Select time",
            initialTime = LocalTime.now(),
            onTimeChange = {}
        )

        buttons {
            positiveButton(
                res = android.R.string.ok
            )
            negativeButton(
                res = R.string.cancel_button_title
            )
        }
    }
}

On smaller devices (for example Nexus S 480x800), whole dialog is a little too big, so buttons are not rendering to user.

There might be added configuration for adjusting timepicker elements size.

device-2021-06-09-131505

Add a duration picker dialog

It would be nice to have a duration dialog that allows picking arbitrary durations (like 4 hours, 15 minutes, etc.).

I think a lot of the time-picker UI could be reused for this. There would be no need for AM/PM or differentiating between 12/24-hour formats, but having two text fields for hours and minutes (maybe optionally one for days as well) with the same design would work well.

Multiple Color chooser issues

There are multiple issues with the color chooser:

  1. if waitForPositiveButton is true it calls onColorSelected multiple times - for every time it recomposed function and with different colors.
  2. it adds RGB picker to layout even if not enabled. That calls onColorSelected with white color, as slider's onValueChanged triggers and sets color to white (see pt. 4).
  3. initialSelection does not affect UI of picker or RGB selector
  4. Sliders in RGB mode snap back to max (0xFF)
  5. Current code does not handle single-level color selection correctly.
    if waitForPositiveButton is true without subcolors it does not set selectedColor.value
    If waitForPositiveButton is false with subcolors it incorrectly calls onColorSelected before showing sub colors (may be OK).

I would suggest updating examples to actually demo onColorSelected callback/waitForPositiveButton and displaying selected color.

dialog fills up the screen

I copied the two functions DialogAndShowButton and DateTimeDialogDemo to an initial project. Then I tried to display them

@Composable
fun Greeting() {
    Column {
        DateTimeDialogDemo()
    }
}

But the dialog box fills the horizontal direction of the screen

Screenshot_2021-07-03-19-53-33-891

I ran the sample software of the project and everything is displayed normally. Is there anything I haven’t noticed?

Allow using IME Action as positive button

Right now, the user always has to press an in-dialog button to complete the dialog. However, in some dialogs where the only interact-able element is an input() element, it would be more convenient to just use the IME action to close the dialog.

Add HSL option for the color picker

I personally like hue/saturation/lightness system for setting color more than RGB, since it seems more intuitive to use to me. It would be nice if that were an option here.

A classical Android implementation of this can be seen here: https://github.com/side-codes/andColorPicker

Note how the slider bar in that project effectively allows previewing all colors selectable with that slider without setting the color to anything. That's not about HSL, but a nice way of implementing these bars that I wanted to mention nonetheless :D

App crashes on 12:xx pm hour selection

When trying to select an hour after 12 pm (minutes doesn't matter), throws exception:

E/MessageQueue-JNI: java.time.DateTimeException: Invalid value for HourOfDay (valid values 0 - 23): 24
        at java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
        at java.time.temporal.ChronoField.checkValidValue(ChronoField.java:730)
        at java.time.LocalTime.of(LocalTime.java:290)
        at com.vanpra.composematerialdialogs.datetime.SimpleLocalTime.toLocalTime(TimePicker.kt:89)
        at com.vanpra.composematerialdialogs.datetime.TimePickerKt$timepicker$3$1.invoke(TimePicker.kt:267)
        at com.vanpra.composematerialdialogs.datetime.TimePickerKt$timepicker$3$1.invoke(TimePicker.kt:266)
        at com.vanpra.composematerialdialogs.MaterialDialogButtons$positiveButton$2.invoke(MaterialDialogButtons.kt:87)
        at com.vanpra.composematerialdialogs.MaterialDialogButtons$positiveButton$2.invoke(MaterialDialogButtons.kt:78)
        at androidx.compose.foundation.ClickableKt$clickable$4$tap$1.invoke-k-4lQ0M(Clickable.kt:162)
        at androidx.compose.foundation.ClickableKt$clickable$4$tap$1.invoke(Clickable.kt:162)
        at androidx.compose.foundation.legacygestures.TapGestureFilter.onPointerEvent-H0pRuoY(TapGestureFilter.kt:119)
        at androidx.compose.ui.input.pointer.Node.dispatchToPointerInputFilter(HitPathTracker.kt:360)
        at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:308)
        at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:304)
        at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:304)
        at androidx.compose.ui.input.pointer.NodeParent.dispatchChanges(HitPathTracker.kt:179)
        at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:111)
        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-gBdvCQM(PointerInputEventProcessor.kt:80)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:696)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3062)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3062)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3062)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3062)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:499)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1879)
        at android.app.Dialog.dispatchTouchEvent(Dialog.java:861)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:457)
        at android.view.View.dispatchPointerEvent(View.java:13725)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5582)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5385)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4888)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4941)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4907)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5047)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4915)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5104)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4888)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4941)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4907)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4915)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4888)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7660)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7594)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7555)
    	at android.view.ViewRootImpl$WindowI

This in version 0.3.1, I did not test in 0.3.2 because the "Ok" button doesn't appear in UI (which is another small bug I think).

Add test tags for ui testing

When writing a ui test, it is useful to be able to input data into a form element. Currently it is difficult to input data if the form element uses one of these dialogs as finding various nodes in the dialog is challenging. As it is, it can be done, however not only is it difficult to do, but it's also easily broken if the slightest piece of a dialogs structure changes in an update.

Test tags could offer a solution. E.g.: for the single choice dialog a tag could be added to each choice element ("choice-$index"?). Using tags like this would make it much easier to find nodes of interest

Manifest error

I've got this error when I try to use your library :
AAPT: error: resource style/Theme.Composematerialdialogs (aka ...:style/Theme.Composematerialdialogs) not found.

Could you remove Application tag in Core's manifest please ?

Please update to compose alpha12

After updating to the lastest compose release 1.0.0-alpha12, I get errors like java.lang.NoSuchMethodError: No virtual method startRestartGroup(ILjava/lang/String;)V in class Landroidx/compose/runtime/Composer; or its super classes .... I think it's caused by the incompatibility between different alpha versions.

Android 8 required? (API 26)

Hey vanpra,

i'm new to jetpack compose and played a bit with your library. It seemed that Android 8 is the minimum supported version isn'it? At least for the date picker i'm unable to access the LocalDate object in versions below ("
Call requires API level 26 (current min is 21): java.time.LocalDate#format")

Maybe It would be helpful, if this would be clairified in the README.
Or you can point out a workaround.

My problematic code:

val textState = remember { mutableStateOf(TextFieldValue()) }

dialog.build {
    datepicker { date ->
        val formattedDate = date.format(
            DateTimeFormatter.ofPattern("dd.MM.yyyy")
        )
        textState.value = TextFieldValue(formattedDate)
    }
}

Thanks for this great library!

Max

Navigation buttons not visible for DateTimePicker

The "Cancel", "Next", "OK" buttons aren't visible for me when using the datetimepicker (but are with the datepicker!).

I have a pretty small screen, so my guess is that they are pushed out of view by the large header at the top. I think it would generally be a good idea to make dialogs scrollable in case the content overflows.

Option for the first day of the week

I've had testers request an option to pick which day is supposed to be the first day of the week in the datepicker. Since that's currently not possible afaik, I would like to request making it an (optional) argument for the date picker.

Version 0.2.0 can't be resolved

This seems to be a similar problem to #14 - updating to 0.2.0 yields the error

Could not find com.vanpra.compose-material-dialogs:core:0.2.0.

Error when trying to show date picker

java.lang.NoSuchMethodError: No interface method startRestartGroup(ILjava/lang/String;)Landroidx/compose/runtime/Composer; in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/com.example.hellocompose-9xgvXuk8s1ao_3F01Tslsg==/base.apk)

This error appears when I want to show a datapicker.

Error after upgrading to beta09

After updating my project to use jetpack compose beta09, there is an error when using a date picker:

java.lang.NoSuchMethodError: No static method Text-6FffQQw(Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JLandroidx/compose/ui/text/style/TextOverflow;ZILkotlin/jvm/functions/Function1;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V in class Landroidx/compose/material/TextKt; or its super classes (declaration of 'androidx.compose.material.TextKt' appears in /data/app/~~y2vw2gGekTmp-TyLu1JDFw==/com.upkid.dev-63FF9nizyeJ9P_qVM48aTQ==/base.apk)
at com.vanpra.composematerialdialogs.datetime.datepicker.DatePickerKt.CalendarHeader(DatePicker.kt:388)
at com.vanpra.composematerialdialogs.datetime.datepicker.DatePickerKt.DatePickerImpl(DatePicker.kt:107)
at com.vanpra.composematerialdialogs.datetime.datepicker.DatePickerKt.datepicker(DatePicker.kt:87)

Year Selection Update

Hi Vanpra,

I was wondering how soon you would be implementing year selection for the date picker?

Kind Regards,
Yamila

NPE when using initialSelection=null and waitForPositiveButton=false for listItemsSingleChoince

The title says it. If you try to use listItemsSingeChoice, don't supply it initialSelection parameter (or explicitly choose null), and then choose waitForPositiveButton = false, it will immideately crash with NullPointerException.

Problematic lines (every use of selected!!)
https://github.com/vanpra/compose-material-dialogs/blob/main/core/src/main/java/com/vanpra/composematerialdialogs/MaterialDialogLists.kt#L223-L241

It assumes that selection will never be null, which is false. The parameter in onChoiceChange should be nullable.]

PS. Didn't test, but I think that NPE will also appear if initialSelection is null and you try to click positiveButton without choosing an item first.

Datepicker quirk

Hi, this library is great, thank you for creating it. I'm quite new to development so don't know if I'm going through the right channels to raise this, but I've noticed a little issue with the datepicker where if you select a date in a new calendar page it isn't highlighting the number. I'm not sure if it's a bug with my implementation or not. The problem is present in my emulator and on my phone.

The image below shows that I have selected 03/06/2021 but you can see the circle isn't around the date.
image

If I go back to the current month.
image

Date Dialog is not working on compose beta08 + accompanist 0.11.0

I'm getting a crash while trying to open the Date dialog using Jetpack Compose version 1.0.0-beta08 + Accompanist Library 0.11.0.
Here's the stacktrace:

2021-06-03 13:14:35.014 16583-16583/com.myapp.mobile E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.myapp.mobile, PID: 16583
    java.lang.NoSuchMethodError: No static method rememberPagerState(IIFILandroidx/compose/runtime/Composer;II)Lcom/google/accompanist/pager/PagerState; in class Lcom/google/accompanist/pager/PagerStateKt; or its super classes (declaration of 'com.google.accompanist.pager.PagerStateKt' appears in /data/app/~~cLU30mleUcHtMy2Do7YR9A==/com.myapp.mobile-3bKM-7Q8almq0aYy8QjdKQ==/base.apk!classes26.dex)
        at com.vanpra.composematerialdialogs.datetime.datepicker.DatePickerKt.DatePickerImpl(DatePicker.kt:100)
        at com.vanpra.composematerialdialogs.datetime.datepicker.DatePickerKt.datepicker(DatePicker.kt:86)
        at com.myapp.core.ui.components.DatePickerKt$DatePicker$1.invoke(DatePicker.kt:38)
        at com.myapp.core.ui.components.DatePickerKt$DatePicker$1.invoke(DatePicker.kt:36)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2$2.invoke(MaterialDialog.kt:192)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2$2.invoke(MaterialDialog.kt:190)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.material.SurfaceKt$Surface$6.invoke(Surface.kt:268)
        at androidx.compose.material.SurfaceKt$Surface$6.invoke(Surface.kt:255)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.material.SurfaceKt.Surface-F-jzlyU(Surface.kt:252)
        at androidx.compose.material.SurfaceKt.Surface-F-jzlyU(Surface.kt:111)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2.invoke(MaterialDialog.kt:182)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2.invoke(MaterialDialog.kt:177)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1$1.invoke(Utils.kt:25)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1$1.invoke(Utils.kt:24)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.material.TextKt.ProvideTextStyle(Text.kt:246)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:81)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:80)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.material.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:72)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1.invoke(Utils.kt:24)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1.invoke(Utils.kt:23)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$dialog$1$1$1$2.invoke(AndroidDialog.android.kt:140)
        at androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$dialog$1$1$1$2.invoke(AndroidDialog.android.kt:139)
2021-06-03 13:14:35.015 16583-16583/com.invetscorp.mobile E/AndroidRuntime:     at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.AndroidDialog_androidKt.DialogLayout(AndroidDialog.android.kt:386)
        at androidx.compose.ui.window.AndroidDialog_androidKt.access$DialogLayout(AndroidDialog.android.kt:1)
        at androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$dialog$1$1$1.invoke(AndroidDialog.android.kt:137)
        at androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$dialog$1$1$1.invoke(AndroidDialog.android.kt:134)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.DialogLayout.Content(AndroidDialog.android.kt:193)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:228)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:227)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:148)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:114)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:113)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:106)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:162)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:161)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:161)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:144)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:3320)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2571)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2567)
        at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt:523)
        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2560)
        at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2515)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:476)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:726)
        at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:2974)
        at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:2974)
2021-06-03 13:14:35.016 16583-16583/com.invetscorp.mobile E/AndroidRuntime:     at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:432)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:144)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:135)
        at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:711)
        at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:135)
        at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:187)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:142)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:135)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:775)
        at android.view.View.dispatchAttachedToWindow(View.java:20479)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3489)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2417)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:731)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Input dialog

allowEmpty = false ... does not work correctly - when empty, positive button is enabled, and after some text is added, positive button becomes disabled

Please, add functionality to pass a KeyboardOptions to the input dialog. Thanks!

NoSuchMethodError for 1.0.0-alpha10 on DatePicker

Really early bug report for 1.0.0-alpha10. No blame, but maybe it helps in solving.
This exception appears and the app crashes, when executing dialog.show() for a MaterialDialog-datepicker.

2021-01-13 21:06:29.184 15194-15194/de.maaxgr.homeoffice E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.maaxgr.homeoffice, PID: 15194
    java.lang.NoSuchMethodError: No virtual method emitNode(Ljava/lang/Object;)V in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/~~p3fH6jJouuO_wBPaxVcjKQ==/de.maaxgr.homeoffice-2CyD3tUl1N_Pst0Yh-baRw==/base.apk)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2.invoke(MaterialDialog.kt:379)
        at com.vanpra.composematerialdialogs.MaterialDialog$build$2.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1$1.invoke(Utils.kt:24)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:188)
        at androidx.compose.material.TextKt.ProvideTextStyle(Text.kt:246)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:83)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:188)
        at androidx.compose.material.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:74)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1.invoke(Utils.kt:23)
        at com.vanpra.composematerialdialogs.UtilsKt$ThemedDialog$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.ui.window.AndroidDialogKt$ActualDialog$dialog$1$1$1$2.invoke(AndroidDialog.kt:110)
        at androidx.compose.ui.window.AndroidDialogKt$ActualDialog$dialog$1$1$1$2.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.ui.layout.LayoutKt.Layout(Layout.kt:668)
        at androidx.compose.ui.window.AndroidDialogKt.DialogLayout(AndroidDialog.kt:284)
        at androidx.compose.ui.window.AndroidDialogKt.access$DialogLayout(Unknown Source:0)
        at androidx.compose.ui.window.AndroidDialogKt$ActualDialog$dialog$1$1$1.invoke(AndroidDialog.kt:107)
        at androidx.compose.ui.window.AndroidDialogKt$ActualDialog$dialog$1$1$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.ui.window.DialogLayout.Content(AndroidDialog.kt:160)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.kt:161)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:188)
        at androidx.compose.ui.platform.AmbientsKt.ProvideCommonAmbients(Ambients.kt:276)
        at androidx.compose.ui.platform.AndroidAmbientsKt$ProvideAndroidAmbients$3.invoke(AndroidAmbients.kt:176)
        at androidx.compose.ui.platform.AndroidAmbientsKt$ProvideAndroidAmbients$3.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
2021-01-13 21:06:29.185 15194-15194/de.maaxgr.homeoffice E/AndroidRuntime:     at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:188)
        at androidx.compose.ui.platform.AndroidAmbientsKt.ProvideAndroidAmbients(AndroidAmbients.kt:168)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.kt:261)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:188)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.kt:260)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Unknown Source:10)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
        at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
        at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:2906)
        at androidx.compose.runtime.Composer.composeInitial(Composer.kt:2046)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:566)
        at androidx.compose.runtime.Composer$CompositionReferenceImpl.composeInitial$runtime_release(Composer.kt:2459)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:109)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt:243)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.kt:548)
        at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.kt:234)
        at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.kt:285)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt:241)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.kt:617)
        at android.view.View.dispatchAttachedToWindow(View.java:20479)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3489)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2417)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:731)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-01-13 21:06:29.191 15194-15367/de.maaxgr.homeoffice V/StudioTransport: Handling agent command 1200 for pid: 15194.
2021-01-13 21:06:29.191 15194-15367/de.maaxgr.homeoffice V/StudioTransport: JNIEnv not attached
2021-01-13 21:06:29.241 15194-15194/de.maaxgr.homeoffice I/Process: Sending signal. PID: 15194 SIG: 9

Auto focus input field

First I would like to thank the author because this library is extremely useful!

My question is if there's a way for auto-focusing the input field so the keyboard show automatically and the user can type right away.

Auto dismiss has no effect

Setting autoDismiss to false or true appears to have no effect.
val dialog = MaterialDialog(autoDismiss = false)

Date Picker crashes

The Crash :

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.wakaztahir.timeline, PID: 15573
    java.lang.NullPointerException
        at com.vanpra.composematerialdialogs.datetime.DatePickerKt.datepicker(DatePicker.kt:87)
        at com.wakaztahir.timeline.ui.dialogs.FilterDialogKt.FilterDialog(FilterDialog.kt:270)
        at com.wakaztahir.timeline.ui.dialogs.FilterDialogKt$FilterDialog$6.invoke(Unknown Source:6)
        at com.wakaztahir.timeline.ui.dialogs.FilterDialogKt$FilterDialog$6.invoke(Unknown Source:10)
        at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:91)
        at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2267)
        at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2514)
        at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:2640)
        at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:406)
        at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:733)
        at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:102)
        at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:443)
        at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:415)
        at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
        at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
        at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
        at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:727)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 15573 SIG: 9

My Code :

        val dateCreatedDialog = remember {
            MaterialDialog()
        }
        dateCreatedDialog.datepicker()
        val dateEditedDialog = remember {
            MaterialDialog()
        }
        dateEditedDialog.datepicker{

        }

I have't even called show yet !

Unable to get working

I have created a composeable function that observes a state flow property, when true it passes an object into another composeable funtion and then populates the datepicker with a property of the object, it then calls show on the dialog. But it never seems to show the dialog

@Composable
fun MainScreen(viewModel: MyViewModel) {
	val currentItem by viewModel.currentItem.collectAsState()
	val showEditDialog by viewModel.showEditDialog.collectAsState()
	Timber.i("Show Edit Dialog: %b", showEditDialog)
	Timber.i("Current Item: %s", currentItem?.id)
	if (showEditDialog && currentItem !== null) {
		DatePicker(item = currentItem!!)
	}
}


@Composable
fun DatePicker(item: MyItem) {
	Timber.i("Showing DatePicker")
	val dialog = MaterialDialog()
	dialog.build {
		datepicker(item.updateDate) { date ->
			// Do stuff with java.time.LocalDate object which is passed in
			Timber.i("Date picked: %s", date.toString())
		}
	}
	dialog.show()
}

and the log output is

2021-03-13 19:30:31.968 5332-5332/co.g403.myapp I/ScreensKt: Show Edit Dialog: true
2021-03-13 19:30:31.969 5332-5332/co.g403.myapp I/ScreensKt: Current Item: 3c86a781-60f6-4801-9cf4-f132a114d9e3
2021-03-13 19:30:31.984 5332-5332/co.g403.myapp I/ScreensKt: Showing DatePicker

Crash on alpha04 compose

    java.lang.NoSuchMethodError: No static method Text-H1hPqEk(Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JLandroidx/compose/ui/text/style/TextOverflow;ZILjava/util/Map;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V in class Landroidx/compose/foundation/TextKt; or its super classes (declaration of 'androidx.compose.foundation.TextKt' appears in /data/app/~~r6efjKHdi01Vf-0V4t0m_Q==/com.btxinteract.app.android-yKXsZc7PC5o5MBHomcJVwQ==/base.apk)
        at com.vanpra.composematerialdialogs.MaterialDialogButtons$positiveButton$4.invoke(MaterialDialogButtons.kt:54)
        at com.vanpra.composematerialdialogs.MaterialDialogButtons$positiveButton$4.invoke(Unknown Source:13)

Date Picker Dialog bug

  • Thank you for making this library for jetpack compose really appreciate it❀
  • there is a bug with the date picker dialog, after swiping to a different month the date selection focus round dot does not appear when you select a date
  • attached a view for reference
  • Am wondering what would be the fix for that? Thank you
date.selection.bug.mp4

java.lang.NoSuchMethodError: No static method Text-6FffQQw

I get the below error after updating the compose version.

java.lang.NoSuchMethodError: No static method Text-6FffQQw(Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JLandroidx/compose/ui/text/style/TextOverflow;ZILkotlin/jvm/functions/Function1;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V in class Landroidx/compose/material/TextKt; or its super classes (declaration of 'androidx.compose.material.TextKt' appears in /data/app/com.example-Y03XriHO9sVbz_0gjKYDeA==/base.apk)

Verisons & dependencies used for this lib:
kotlin_version = '1.5.10'
compose_version = '1.0.0-beta08'
implementation("io.github.vanpra.compose-material-dialogs:datetime:0.4.2")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")

Before updating the kotlin and compose versions, it used to work fine. Please let me know if I'm doing anything wrong here.

`listItemsSingleChoice` dialog does not perform `onChoiceChange` action

val themeDialog = remember { MaterialDialog() }.also { BuildThemeDialog(it, theme) }
@Composable
fun BuildThemeDialog(dialog: MaterialDialog, theme: MutableState<Boolean>) {
    dialog.build {
        title(text = stringResource(id = R.string.settings_theme))
        listItemsSingleChoice(
            list = listOf(stringResource(R.string.light), stringResource(R.string.dark)),
            initialSelection = if (theme.value) 1 else 0,
            onChoiceChange = { 
                theme.value = it != 0
                println(it) // no-out-printed vibe πŸ₯‚
            }
        )
    }
}
    ....clickable { themeDialog.show() },

Timepicker title might be not visible when there is already title compose

For example if user want a bigger font for title, there is a title element, which can be added to MaterialDialog, but then even if title is set to empty string, MaterialDialog is rendering empty space, which might be a lot of waste for smaller devices.

Example:

MaterialDialog = MaterialDialog().also {
    it.build {

        title(res = R.string.date_picker_select_time)

        timepicker(
            title = "",
            initialTime = LocalTime.now(),
            onTimeChange = {}
        )

        buttons {
            positiveButton(
                res = android.R.string.ok
            )
            negativeButton(
                res = R.string.cancel_button_title
            )
        }
    }
}

device-2021-06-09-131016

Button's text is clipped

When creating dialog like that:

MaterialDialog().also {
    it.build {

        title(res = R.string.date_picker_select_time)

        timepicker(
            title = "",
            initialTime = LocalTime.now(),
            onTimeChange = {}
        )

        buttons {
            positiveButton(
                res = android.R.string.ok
            )
            negativeButton(
                res = R.string.cancel_button_title
            )
        }
    }

Buttons are clipped from bottom:

device-2021-06-09-102356

Make DatePicker scrollable as well

It's that guy again :D I noticed that having a scrollable DateTimePicker works really well when the device is being used in horizontal orientation, but the DatePicker isn't really usable in that state. Making it scrollable in a similar way would likely fix the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.