JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.58k stars 1.13k forks source link

AlertDialog and DropDownMenu Missing #3482

Closed Anirban2022 closed 11 months ago

Anirban2022 commented 11 months ago

Describe the bug AlertDialog and DropDownMenu missing material3 `

Affected platforms Select one of the platforms below:

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. add the dependency
  2. add DropdownMenu or AlertDialog
  3. not resolving

Expected behavior should resolve.

BruceMcRooster commented 11 months ago

I also ran into this problem, and it seems to be purely IDE-related. I wrote out some test code for the dropdown menu and was able to run the app. I also opened the project in Fleet (IDEA didn't support AGP) and got the same problem, so I think this is something to do with IntelliJ.

BruceMcRooster commented 11 months ago

My thoughts are that it has something to do with the fact that DropdownMenu (and DropdownMenuItem) and AlertDialog are both in files named *_androidKt (AndroidAlertDialog_androidKt and AndroidMenu_androidKt respectively).

In the classes.jar of androidx.compose.material3, there are only 3 other files that end with _androidKt, but they just contain internal variables. I tried a test to access them, and Android Studio did give me an error that it is "Internal to androidx.compose.material3", so it is seeing these files to some extent. It seems to just be the Composable functions in files with these endings.

BruceMcRooster commented 11 months ago

I just did some more tests, and I think it's just common code having this problem. I created a DropdownMenu without any trouble from the editor in androidMain (before it called common code). I also got editor autocomplete and no errors creating DropdownMenus in my iosMain and desktopMain Compose code.

brewin commented 11 months ago

Duplicate

These were just added in 1.5.0-beta02

Anirban2022 commented 11 months ago

Thanks for adding it. Tested working fine.

brewin commented 11 months ago

To be clear, I didn't add it. I'm just closely following progress of the project. Most of the changes are in compose-multiplatform-core.