How to Set Android setCustomAnimations Globally?

I have a custom animaiton that I use thru 90% of my app. I need to reduce the code redundancy:

FT.setCustomAnimations(R.anim.slide_in, R.anim.hyperspace_out, R.anim.hyperspace_in, R.anim.slide_out);

and would like to put into some kind of global setting or variable.

Have any ideas on how I can do this?

Answers


You would have some kind of static method in a class that's in the scope of your entire application such as:

public class FragmentAnimator {

  public static animateOut(FragmentTransaction ft) {
    ft.setCustomAnimations(R.anim.slide_in, R.anim.hyperspace_out, R.anim.hyperspace_in,  R.anim.slide_out);
  }
}

Then just call FragmentAnimator.animateOut(FT); whenever you need to do that.


Need Your Help

Hide links from html

javascript html css xml

Suppose I have several links like

Which file is executed in SQL Server 2005 while backing up data

sql sql-server sql-server-2005

I want a full backup of my SQL Server database using a scheduled batch file. I tried many codes from this website but nothing worked. I just want to know which exe file actually creates the backup ...