Back to project page Do-not-get-annoyed.
The source code is released under:
Apache License
If you think the Android project Do-not-get-annoyed listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mn100013d.pmu; /*w w w . j av a 2 s .c om*/ import java.io.File; import mn100013d.pmu.services.FragmentProvider; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.OvershootInterpolator; public class PauseFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_pause_game, container, false); rootView.findViewById(R.id.pause_fragment_bgd).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { ((NewGameActivity)getActivity()).getGameControllerInstance().resume(); FragmentProvider.getInstance().back(); } }); rootView.findViewById(R.id.bt_settings1).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { FragmentProvider.getInstance().changeFragment( FragmentProvider.SETTINGS); } }); rootView.findViewById(R.id.bt_home).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getActivity(), BeginingActivity.class); startActivity(i); getActivity().finish(); ((NewGameActivity)getActivity()).getGameControllerInstance().turnGameOff(); File f = getActivity().getFileStreamPath(NewGameActivity.FILE_NAME); f.delete(); Log.i("Nikola", "Brisanje"); } }); return rootView; } @Override public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) { Animation anim = null; if (enter) anim = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_in_left); else { anim = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_out_right); } anim.setInterpolator(new OvershootInterpolator(3f)); return anim; } }