Search in sources :

Example 1 with MyProfileFrag

use of br.ufrj.caronae.frags.MyProfileFrag in project caronae-android by caronae.

the class MainAct method showProfileFrag.

private void showProfileFrag() {
    backstackSafeCheck();
    backstack.remove(MyProfileFrag.class);
    backstack.add(MyProfileFrag.class);
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    transaction.setCustomAnimations(R.anim.anim_fade_in, R.anim.anim_fade_out);
    transaction.replace(R.id.flContent, new MyProfileFrag()).commit();
    setTitle(retrieveTitle(MyProfileFrag.class.toString()));
    mDrawer.closeDrawers();
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) MyProfileFrag(br.ufrj.caronae.frags.MyProfileFrag)

Example 2 with MyProfileFrag

use of br.ufrj.caronae.frags.MyProfileFrag in project caronae-android by caronae.

the class MainAct method onStart.

@Override
protected void onStart() {
    super.onStart();
    User user = App.getUser();
    Fragment fragment;
    boolean goToMyRides = getIntent().getBooleanExtra(SharedPref.MY_RIDE_LIST_KEY, false);
    if (user.getEmail() == null || user.getEmail().isEmpty() || user.getPhoneNumber() == null || user.getPhoneNumber().isEmpty() || user.getLocation() == null || user.getLocation().isEmpty()) {
        fragment = new MyProfileFrag();
        Util.toast(getString(R.string.act_main_profileIncomplete));
    } else if (goToMyRides) {
        fragment = new MyRidesFrag();
        backstack.add(new AllRidesFrag().getClass());
    } else {
        fragment = new AllRidesFrag();
    }
    FragmentManager fragmentManager = getSupportFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();
    backstack.add(fragment.getClass());
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) User(br.ufrj.caronae.models.User) MyRidesFrag(br.ufrj.caronae.frags.MyRidesFrag) MyProfileFrag(br.ufrj.caronae.frags.MyProfileFrag) AllRidesFrag(br.ufrj.caronae.frags.AllRidesFrag) Fragment(android.support.v4.app.Fragment)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)2 MyProfileFrag (br.ufrj.caronae.frags.MyProfileFrag)2 Fragment (android.support.v4.app.Fragment)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 AllRidesFrag (br.ufrj.caronae.frags.AllRidesFrag)1 MyRidesFrag (br.ufrj.caronae.frags.MyRidesFrag)1 User (br.ufrj.caronae.models.User)1