how to use fragments to create an overlay effect for an add contact function when a button is pressed

udbhav shrivastava

I'm trying to create an overlay that is triggered when a button is pressed. This overlay is supposed to allow the user to add their contact and I was wondering how can I use fragments to get this effect like you can see in this mockup.Adobe XD Mockup I am in a dilemna over using fragments is the right choice. My reasoning being that I only need to have it do one task that is adding contacts, and thus I do not need a whole activity.

This is what I have on the main activity right nowMain Activity Java File Main Activity xml File

I would really appreciate any help on understanding how to make this work.

avalerio

You can use a DialogFragment. It behaves like a normal Fragment for the most part. Here is a guide for a basic implementation https://guides.codepath.com/android/using-dialogfragment

They appear automatically in the center of the screen. To get it a bit lower like in your mockup you can change where it is in the window. Here is an answer showing such Position of DialogFragment in Android

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to use CSS to create an image overlay effect?

How to show warning message when back button is pressed in fragments

How do I use jquery to create an overlay contact form

How to add a widget when a button is pressed flutter

How to add value in NSMutableArray when button is pressed

How to add and execute another function when the button, having initial function, is pressed again using tkinter?

how to create an overlay effect with a color

WPF - OuterGlow Effect when button is pressed

How do I call a button function when the button is not being pressed

How can I show the visual effect of a pressed button when I press another button?

How to add sound when back button is pressed in complete application

How to create random circle locations when Button is pressed in JavaFX?

how to create a new label when a button is pressed in pyqt5

How to call a function when the Compass Button of a mapView is pressed

How can I execute the function when button in wxYES_NO is pressed?

How can I call a function when the navigation back button is pressed?

How to enable a function when "close" button is pressed in jAlert

How to trigger a function when KivyMD Speed Dial Button pressed?

How to highlight the button when it is pressed

Android: add pressed effect on a button with image, text under it and custom border

Create a function that is able to check the title of the button pressed

add characters when enter button pressed

Add multiple labels to a frame when button pressed

Swift - Create radial line for button when pressed

Create a model record when a button is pressed

Add button overlay on UITableViewController with use static cells

How to return a value from a function when it is used as a command function? How to close a user interface when a button is pressed?

How to create pages when pressed

How can I simulate a different button pressed when a button is pressed?