How to position dialog in Jetpack Compose to the bottom of the screen?
my real goal would be to place a dialog-like layout for the user (with a custom view) at the bottom of the screen and not centered like a regular dialog. with a background that darkens the back screen that
and one of the behaviors of a traditional dialog
here would be an example layout I'm trying to pass to compose.
Related
When the user opens the app for the first time, I want my app to have a custom popup box or a popup model next to a button so which tells what a button does
Here's an example -
I can use sharedpreferences to make it visible only for the first time.
But, how do I make it?
you can use Dialog and customize the position and appearance of it i leave some links below to know how to do it:
diologs on android:
https://developer.android.com/guide/topics/ui/dialogs
changing position of dialog:https://www.tutorialspoint.com/how-to-change-the-position-of-the-dialog-on-screen-android
creating custom dialog using Material design:
https://material.io/components/dialogs/
for customizing dialog there is outer ways to but material design is simpler
I have a listview adapter, and when you click on an item in the list, it opens it up to a full screen activity. I have added a 'swipe to dismiss' functionality within the app. When the user swipes from the left side of the screen, and starts dragging, I set the X position of the top layout in the full screen activity to be the X position of the user's finger. I want to know how to change the color of the gap between the edge of the activity and the edge of the device. It is just white now, but I want it to be transparent to be able to see the adapter below the activity. I have tried setting the background color of the top layout in the full screen activity to be transparent. Here is a crude image describing what I want to achieve.
http://i.imgur.com/CfvuvAO.png
I think you can add this to your theme in your styles.xml
<item name="android:windowBackground">#android:color/transparent</item>
But I suggest you don't reinvent the wheel and use a library for this if you can:
https://github.com/r0adkll/Slidr
![Adding buttons on top of the default call screen of android][1]
http://i.stack.imgur.com/SJ8Pc.jpg
As shown in the below image, there are two buttons one is Live video button and the other is Picture share button, how to add those button on top of the default android call screen while making call.
Thanks,
Android F
I believe the way to do this is to draw views on top of the dialer activity. This is similar, in implementation, to the Facebook home chatHead feature. Have a look at this article, which shows how to draw any view: http://www.piwai.info/chatheads-basics/
In your case, your view would be a LinearLayout containing two buttons.
I'm doing a tablet application. I have to show a custom dialog with the theme android.R.style.Theme_Translucent_NoTitleBar.
Now I am able to show the dialog with the views as I required (i.e. with number picker at fixed position — on the left side of the screen).
I have to place the same dialog dynamically on the click position of a button. Some time on the left side of the screen and some time right.
Shortly we can say: at any position of the screen.
So please help me with any code or idea.
Hi,
I need to create a UI such that an image view appears at the edge of an alert dialog. Please find below the steps in detail.
I click on a button in activity.
Alert dialog windows should slide from the right to the center.
In the edge of the dialog window, i have an image.
I am done till step 2. I don't know how to place an UI such that half of that appears on the dialog view. Please refer to the image i have provided.
Please provide me with the code samples or pointers for implementing the same. Thanks.
Try using frame layout
A dialog is usually a small window that appears in front of the current Activity. The underlying Activity loses focus and the dialog accepts all user interaction.
So, I doubt if such an effect can be obtained in a dialog.
However, I tried using absolute layout as dialog's content view to create a custom dialog and moved the imageview to an edge by altering the layout parameter. That showed only the portion of the imageview that could fit into the dialog and the rest was not visible.