Search in sources :

Example 1 with TrackedSectionsFragment

use of com.tevinjeffrey.rutgersct.ui.trackedsections.TrackedSectionsFragment in project Rutgers-Course-Tracker by tevjef.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!Once.beenDone(Once.THIS_APP_INSTALL, SHOW_TOUR)) {
        Intent intent = new Intent(this, IntroActivity.class);
        startActivity(intent);
        finish();
    }
    RutgersCTApp.getObjectGraph(this).inject(this);
    setContentView(R.layout.activity_main);
    Icepick.restoreInstanceState(this, savedInstanceState);
    if (savedInstanceState == null) {
        TrackedSectionsFragment tsf = new TrackedSectionsFragment();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            tsf.setEnterTransition(new AutoTransition().excludeTarget(ImageView.class, true));
            tsf.setExitTransition(new Fade(Fade.OUT).excludeTarget(ImageView.class, true));
            tsf.setReenterTransition(new AutoTransition().excludeTarget(ImageView.class, true));
            tsf.setReturnTransition(new Fade(Fade.IN).excludeTarget(ImageView.class, true));
            tsf.setAllowReturnTransitionOverlap(false);
            tsf.setAllowEnterTransitionOverlap(false);
            tsf.setSharedElementEnterTransition(new ChangeBounds().setInterpolator(new DecelerateInterpolator()));
            tsf.setSharedElementReturnTransition(new ChangeBounds().setInterpolator(new DecelerateInterpolator()));
        }
        getFragmentManager().beginTransaction().replace(R.id.container, tsf).commit();
    }
    RutgersCTApp.getObjectGraph(this).get(Alarm.class).setAlarm();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AutoTransition(android.transition.AutoTransition) TrackedSectionsFragment(com.tevinjeffrey.rutgersct.ui.trackedsections.TrackedSectionsFragment) ChangeBounds(android.transition.ChangeBounds) Alarm(com.tevinjeffrey.rutgersct.services.Alarm) Intent(android.content.Intent) ImageView(android.widget.ImageView) Fade(android.transition.Fade)

Aggregations

Intent (android.content.Intent)1 AutoTransition (android.transition.AutoTransition)1 ChangeBounds (android.transition.ChangeBounds)1 Fade (android.transition.Fade)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 ImageView (android.widget.ImageView)1 Alarm (com.tevinjeffrey.rutgersct.services.Alarm)1 TrackedSectionsFragment (com.tevinjeffrey.rutgersct.ui.trackedsections.TrackedSectionsFragment)1