I have existing Dialog view in xml based. I want to use Dialog view in my Compose feature. Is it possible to do that? If yes, Can you provide me any guidance? example would be great.
Have you tried with this way
https://developer.android.com/jetpack/compose/interop/interop-apis#compose-in-fragments
basically they suggest to use AndroidViewBinding which is provided by the androidx. compose. ui:ui-viewbinding library
example is showing in fragment but you can just use it in dialog as you just need to use binding
Related
i want to create a swipable component using jetpack compose and as the document Gestures | JetpackCompose I should use rememberSwipeableState.
but when I want to use it I face this error:
Cannot access 'rememberSwipeableState': it is internal in 'androidx.compose.material3'
what should I do?
This issue is already being tracked here, issue in Material3 Compose. Alternatively as per their recommendation
For the time being, we recommend forking Swipeable if you need it in
M3!
you can use Material2 Compose Swipeable and fork it.
Android usually supports navigation with the tab and enter key as described here.
However, when using Jetpack compose this option seems unavailable. Is this true and if yes I wonder what would be the simplest method to navigate a Jetpack Compose Kotlin App using my keyboard?
maybe use the custom navigation as described here ?
or better implement a whole new navigation method as described here?
Thank you for any help
I thought that it's possibile within a fragment, but I'm young android developer and I will know which is the best way to implement it. Thanks a lot!
In Android you do it with an AlertDialog.
You'll want to implement one with a custom layout matching your picture.
An excerpt from the guide:
If you want a custom layout in a dialog, create a layout and add it to an AlertDialog by calling setView() on your AlertDialog.Builder object.
A quick search of Android material dialog with a custom view should give you a solution
Many libraries exist in gitub. Its just a mater of searching
If i click on(+Add to group)Button then alert/Dialog like view should visible. How to implement view like this in android??
It could be simply implemented using android-popupwindow.
Examples:
http://mrbool.com/how-to-implement-popup-window-in-android/28285
Is there a simple example of the PopupWindow class using Android v2.0?
Basic Steps:
Create a layout in XML for the menu.
Inflate that layout and apply to the PopupWindow.
Acquire a reference to that button. (i.e. Add to Groups);
Find its absolute coordination on the window.
Use showAtLocation to show the menu in the appropriate location.
Note: AFAIK, there's a bunch of libraries out there which fit your requirements. So, don't reinvent the wheel.
It's doable. You have to manually create a custom layout that automatically gets dismissed after pressing the action item.
Here is a small android library to create the QuickAction dialog style:
QuickAction Library
For more info, read this article.
There are no controls in Android that provide Tree-like View. There is an ExpandableList View which I suspect could be used to creating one.
Have you tried imlpementing such a control?
How would one implement such a control in Android?
Our company just open-sourced a small widget that is doing just that... You can see all the sources and add the project (as a library) to your own android project:
http://code.google.com/p/tree-view-list-android/
take a look at ExpandableListView. Besides, see following thread:
http://www.mail-archive.com/android-beginners#googlegroups.com/msg03587.html
this solutions are, very complicate. but can use a ExpandableListView of more levels.
Example: How to implement multilevel ExpandableListview in Android?