So, I am developing this app that needs a dialog screen over a map that chooses an item and is dragabble, that means that it can go up or down. How can I do that?
A good example is the instagram share button.
The component you want to use is a BottomSheetDialog: https://developer.android.com/reference/android/support/design/widget/BottomSheetDialog
This type of dialog has native support for being dragged.
Related
In my current Android application I have a requirement to open a DialogFragment to display a list of results.
Each Result has an associated url that explains the item in more detail.
I can open a Chrome Custom Tab with this url, however it closes the DialogFragment and the user has a poor experience.
Is it possible that I could open the Crome Custom Tab within its own Dialog?
That way my Results DialogFragment should not be closed, and the user can return directly to the results list.
Currently, a Custom Tab uses the entire screen, so it's not possible to use it in a similar way to a DialogFragment (which doesn't use the entire width/height of the screen).
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 am developing an android camera app that allow popup of page upon pressing a button (besides the shoot button)in the view of the photo capture activity for accessing twitter services, including login(of coz with button), view tweets(listview or list fragment) of bookmarked users and posting tweets.
I am considering the approach to build the layout for the popup stuff. What come across my mind are dialog fragment, popupwindow and simply another activity.
Considering my case, what view is recommended for the popup component?
Depends on the content of your popup:
If popup contains only a list of items use PopupWindow.
If popup contains only a few buttons like ok/cancel some text etc. Use DialogFragment.
If you have more stuff, you should probably use Activity.
I want to pop open a DatePickerDialog in a certain screen, but I am required to not grey out the rest of the screen (the view behind the dialog) when the DatePickerDialog window opens. Is there a way to achieve this?
You probably would want to create your own custom dialog. You can extend DialogFramgent and change it accordingly.
See the Android doc HERE for a great example.
Or, use PopupWindow if you want a popover dialog with control of the background, see this SO post.
In an android application, I want to display a Dialog on screen and in the same time to allow user to click on the application's UI when the the Dialog is open
can this be done?
if no, what can I use instead of Dialog?
I don't think you can do this with Dialog. But you can do it with PopupWindow using PopupWindow.setOutsideTouchable(true);.
Showing up a dialog over your Activity, will make your Activity go into onPause() so you won't be able to actually handle things inside that activity anymore until the dialog is dismissed.
If you want to have some view, overlay your original activities view you'll be looking for into the direction of FrameViews, which can overlap other Views.