use of in.ac.iitb.gymkhana.iitbapp.fragment.FeedFragment in project IITB-App by wncc.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
session = new SessionManager(getApplicationContext());
session.checkLogin();
Toast.makeText(getApplicationContext(), "Log In status: " + session.isLoggedIn(), Toast.LENGTH_LONG).show();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
FeedFragment feedFragment = new FeedFragment();
updateFragment(feedFragment);
fetchNotifications();
}
use of in.ac.iitb.gymkhana.iitbapp.fragment.FeedFragment in project IITB-App by wncc.
the class MainActivity method onNavigationItemSelected.
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
switch(id) {
case R.id.nav_feed:
FeedFragment feedFragment = new FeedFragment();
updateFragment(feedFragment);
break;
case R.id.nav_my_events:
MyEventsFragment myeventsFragment = new MyEventsFragment();
updateFragment(myeventsFragment);
break;
case R.id.nav_pt_cell:
PTCellFragment ptcellFragment = new PTCellFragment();
updateFragment(ptcellFragment);
break;
case R.id.nav_mess_menu:
MessMenuFragment messmenuFragment = new MessMenuFragment();
updateFragment(messmenuFragment);
break;
case R.id.nav_gc_rankings:
GCRankingsFragment gcrankingsFragment = new GCRankingsFragment();
updateFragment(gcrankingsFragment);
break;
case R.id.nav_calendar:
CalendarFragment calendarFragment = new CalendarFragment();
updateFragment(calendarFragment);
break;
case R.id.nav_cms:
CMSFragment cmsFragment = new CMSFragment();
updateFragment(cmsFragment);
break;
case R.id.nav_timetable:
TimetableFragment timetableFragment = new TimetableFragment();
updateFragment(timetableFragment);
break;
case R.id.nav_map:
MapFragment mapFragment = new MapFragment();
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
updateFragment(mapFragment);
} else {
ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, MY_PERMISSIONS_REQUEST_ACCESS_LOCATION);
}
break;
case R.id.nav_contacts:
ContactsFragment contactsFragment = new ContactsFragment();
updateFragment(contactsFragment);
break;
case R.id.nav_about:
AboutFragment aboutFragment = new AboutFragment();
updateFragment(aboutFragment);
break;
case R.id.nav_people:
PeopleFragment peopleFragment = new PeopleFragment();
updateFragment(peopleFragment);
break;
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
Aggregations