Search in sources :

Example 1 with ScreenSlidePagerAdapter

use of com.example.c4q.capstone.userinterface.user.userprofilefragments.fragmentanimation.ScreenSlidePagerAdapter in project Grupp by tmoronta1208.

the class UserProfileActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_profile);
    toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    mAuth = FirebaseAuth.getInstance();
    mPager = findViewById(R.id.pager);
    mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
    mPager.setAdapter(mPagerAdapter);
    context = this;
    activity = this;
    floatingActionMenu = findViewById(R.id.floatingaction_menu);
    creatEvent = findViewById(R.id.create_event_mini);
    creatEvent.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            startActivity(new Intent(UserProfileActivity.this, CreateEventActivity.class));
        }
    });
    addPerson = findViewById(R.id.add_group_mini);
    addPerson.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // startActivity(new Intent(UserProfileActivity.this, AddPersonActivity.class));
            UPCreateGroupFragment upCreateGroupFragment = new UPCreateGroupFragment();
            FragmentManager fragmentManager = getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            fragmentTransaction.addToBackStack("Grupp Details Fragment").replace(R.id.drawer_layout, upCreateGroupFragment);
            fragmentTransaction.commit();
        }
    });
    mAuthListner = new FirebaseAuth.AuthStateListener() {

        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            if (mAuth.getCurrentUser() == null) {
                startActivity(new Intent(UserProfileActivity.this, LoginActivity.class));
            }
        }
    };
    pushEventInviteNotifications();
// new InviteNotifications("test", "notification", getApplicationContext());
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) UPCreateGroupFragment(com.example.c4q.capstone.userinterface.user.userprofilefragments.UPCreateGroupFragment) FragmentTransaction(android.support.v4.app.FragmentTransaction) Intent(android.content.Intent) ScreenSlidePagerAdapter(com.example.c4q.capstone.userinterface.user.userprofilefragments.fragmentanimation.ScreenSlidePagerAdapter) View(android.view.View) FirebaseAuth(com.google.firebase.auth.FirebaseAuth)

Aggregations

Intent (android.content.Intent)1 FragmentManager (android.support.v4.app.FragmentManager)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 View (android.view.View)1 UPCreateGroupFragment (com.example.c4q.capstone.userinterface.user.userprofilefragments.UPCreateGroupFragment)1 ScreenSlidePagerAdapter (com.example.c4q.capstone.userinterface.user.userprofilefragments.fragmentanimation.ScreenSlidePagerAdapter)1 FirebaseAuth (com.google.firebase.auth.FirebaseAuth)1