Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to animate a DialogFragment?

I tried various samples regarding animation of fragments, but nothing happens so is DialogFragment not a "proper" fragment? Or am I missing something here?

FragmentTransaction ft = getFragmentManager().beginTransaction();                                      
InfoDialogFragment newFragment = InfoDialogFragment.newInstance();
newFragment.setAsset(mainShow, c,backgroundDrawable);
ft.setCustomAnimations(R.anim.grow_in, R.anim.fadeout);
ft.add(newFragment, "dialog");
ft.commit();
...
public class InfoDialogFragment extends DialogFragment {
like image 852
Christer Nordvik Avatar asked May 25 '11 19:05

Christer Nordvik


People also ask

Is DialogFragment deprecated?

This method is deprecated. androidx. activity.

How do you show DialogFragment?

Showing the DialogFragment It is not necessary to manually create a FragmentTransaction to display your DialogFragment . Instead, use the show() method to display your dialog. You can pass a reference to a FragmentManager and a String to use as a FragmentTransaction tag.

What is the difference between dialog & DialogFragment?

Dialog: A dialog is a small window that prompts the user to make a decision or enter additional information. DialogFragment: A DialogFragment is a special fragment subclass that is designed for creating and hosting dialogs.


1 Answers

Here is what a Google engineer has to say on the subject.

like image 154
Vaiden Avatar answered Sep 25 '22 15:09

Vaiden