eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

BuildNotImplemented lint check: false error when dialog is used from Kotlin #57

Closed mtotschnig closed 2 years ago

mtotschnig commented 4 years ago

The BuildNotImplemented lint check raises an error for a call to any of the dialogs' build method from a Kotlin class: Bildschirmfoto 2019-09-07 um 13 48 46

eltos commented 4 years ago

That's the intended behaviour when calling build on a subclass that does not implement/overwrite the method. See #31 and issues referenced there.

(In case I misunderstood that's because you didn't provide the information requested in the issue template)

mtotschnig commented 4 years ago

Sorry for the incomplete information. The error is raised on calls on classes that implement the build method, for example: SimpleListDialog.build() or SimpleInputDialog.build()

eltos commented 4 years ago

Okay then it's not intended 😄
I'm afraid I have not used Kotlin so I don't think I can fix this on my own.
Nevertheless, what exactly did you call that raised the error (complete minimal not-working example)? Was it SimpleInputDialog.build();? Maybe there are some special precautions to be done when performing lint checks for Kotlin?

sharmanitin0497 commented 4 years ago

This can be solved by using only build() and importing whatever you're going to use. That means if you're using 'SimpleColorDialog.build()' then just use 'build()' and import 'SimpleColorDialog'.

This will work in Kotlin. What will not work is that your project won't compile because of duplicate AndroidManifest.xml which I'm facing right now and also the reason why I'm here.

eltos commented 4 years ago

Thank you @sharmanitin0497 for the hint. The manifest problem sounds like an independent issue, would you mind opening a dedicated issue and give some more details about it?

Fauzdar1 commented 4 years ago

And for multiple Dialogs, you can use aliases as

import eltos.simpledialogfragment.color.SimpleColorDialog.build as SimpleColorDialog
import eltos.simpledialogfragment.form.SimpleFormDialog.build as SimpleFormDialog

Then, call them just like SimpleColorDialog(). or SimpleFormDialog().. This way you don't have to use build().

But, the reason I came here is I can't build the project because it shows Cause: duplicate entry: AndroidManifest.xml in Kotlin even when the jar file doesn't contain a manifest file. It will work if I remove this library. Why?