Is a dialogBox considered a View? - android

Is a DialogBox considered a View in Android? I want to add one to a FrameLayout, but I'm not sure if I can? Is it possible?

Unless there's something I'm missing, no, Dialog inherits directly from Object, and does not apply as a View. But I have to ask, why do you want to add Dialog into a FrameLayout in the first place?

You probably need to make a custom dialog for this matter a good help for that is the official android developer website
http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

Related

Why would I want to use DialogFragments over Regular Fragments in Android?

Surprisingly, I couldn't find any posts regarding this, so here we go:
Why would I want to use a DialogFragment over a simple Fragment in Android? What advantages does the DialogFragment have that I will miss out on if I just use a regular Fragment?
Might be worth mentioning that I intend to have a fully customized view inside it...
Thanks!
A DialogFragment is no other than a Fragment that looks and acts like a Dialog would. So whether or not you want to use it is entirely depended on what do you want to make out of it.
From my experience using DialogFragment, I tend to utilize it as a "detailed" view of a list item. The one that hovers on the list instead of covering it entirely (like a normal Fragment would) so that the user doesn't lose context.
So that's that; you might want to use it wherever you want to show a view which either depend or need to retain its' parent context.
p.s., Yes, you can even put a fully customized view in a DialogFragment.
Well, basically you have all features od a Dialog in a fragment.
For example the back is handled by the system, you can dismiss the dialog clicking outside the dialog view, you can set the dialog to be not cancellable. And yes, the look and feel is the same of the other dialogs.

How to embed time picker in view

I've integrated TimePicker in my application successfully. Now i would like to know is there a way to embed time picker in view instead of showing it as Dialog box. Thanks in advance.
I suggest you , it is good habit to use fragment.if you use the DialogFragment ,google provide using the dialog frament for time picker http://developer.android.com/guide/topics/ui/controls/pickers.html#TimePicker
or
I found some link it can help you
http://examples.javacodegeeks.com/android/core/ui/timepicker/android-time-picker-example/
Actually showing in a DialogFragment is considered best practice. Still if you want to create similar view in your layout then I guess your best bet would be using wheel-view to achieve this.
Here is a library for it: https://code.google.com/p/android-wheel/ and its other implementation: https://github.com/ai212983/android-spinnerwheel
In case you want to stick with DialogFragment(recommended), here is a tutorial: http://androidician.wordpress.com/2014/09/20/android-date-picker-and-time-picker-example/

How to make this layout (photo)

I am trying to make similar layout to this one.
I achieved everything except that pop up window (saying "Perfect"). How to make this? Will pop up windows? Dialog or somehow else?
The screenshoted layout look like a WebView to me. Thus you could try to take all advantage of the WebView to create any html-based layout.
The pop-up could also be a custom dialog, or just a div on top the main layout or whatever. For example, check this.
There are 2 ways you can approach this.
If you want a view above another one you can use FramLayout. Tutorial here.
If you want it to be a dialog you can follow this tutorial Tutorial here

Android - Show more information on a popup

I'm developing an app that includes reviews of items and due to my design, I want to only show all the reviews in a popup window like in Google Play Store:
What should I use to create that white panel that appears over the current window and contains the necessary information? This should be simple but I'm a newbie and I can't seem to figure out what this "widget" is. Please help me if you are familiar with this so I can use this cool design pattern. Thanks.
It seems you want to display a layout as a popup in another activity.
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="#android:style/Theme.Dialog" in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
A better way to do it would be using a DialogFragment. You can display information in the form of a popup and it will have its own lifecycle. That will be much better than displaying an activity like a dialog
Ram kiran's answer is a good one and one which I like to give also. But just so you have another option to look at you can consider PopupWindow
As stated in the docs, it is
A popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.
I've used this and it works out nicely in some situations. It really depends on what your exact needs are as to which will work best for you.

How was this made?

This screen was captured from Gmail app for android. The popup looks pretty cool with images and all. Any ideas on how this was made?
This is done with a custom dialog, it is actually quite easy to achieve. Just create a layout for a normal Activity and pass it to the Dialog builder.
For more information, check http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog out

Categories

Resources