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 {
This method is deprecated. androidx. activity.
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.
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.
Here is what a Google engineer has to say on the subject.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With