use of app.insti.fragment.WebViewFragment in project IITB-App by wncc.
the class MainActivity method onNavigationItemSelected.
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
switch(id) {
case R.id.nav_feed:
feedFragment = new FeedFragment();
updateFragment(feedFragment);
break;
case R.id.nav_explore:
updateFragment(ExploreFragment.newInstance());
break;
case R.id.nav_news:
updateFragment(new NewsFragment());
break;
case R.id.nav_placement_blog:
openPlacementBlog();
break;
case R.id.nav_training_blog:
openTrainingBlog();
break;
case R.id.nav_mess_menu:
MessMenuFragment messMenuFragment = new MessMenuFragment();
updateFragment(messMenuFragment);
break;
case R.id.nav_calendar:
CalendarFragment calendarFragment = new CalendarFragment();
updateFragment(calendarFragment);
break;
case R.id.nav_qlinks:
QuickLinksFragment quickLinksFragment = new QuickLinksFragment();
updateFragment(quickLinksFragment);
break;
case R.id.nav_map:
MapFragment mapFragment = new MapFragment();
updateFragment(mapFragment);
break;
case R.id.nav_achievements:
WebViewFragment webViewFragment = new WebViewFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.WV_TYPE, Constants.WV_TYPE_ACHIEVEMENTS);
webViewFragment.setArguments(bundle);
updateFragment(webViewFragment);
break;
case R.id.nav_complaint:
if (session.isLoggedIn()) {
ComplaintsFragment complaintsFragment = new ComplaintsFragment();
updateFragment(complaintsFragment);
} else {
Toast.makeText(this, Constants.LOGIN_MESSAGE, Toast.LENGTH_LONG).show();
}
break;
case R.id.nav_settings:
SettingsFragment settingsFragment = new SettingsFragment();
updateFragment(settingsFragment);
break;
default:
break;
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
use of app.insti.fragment.WebViewFragment in project IITB-App by wncc.
the class GenericAdapter method onClick.
@Override
public void onClick(CardInterface cardInterface, Fragment fragment, View view) {
if (cardInterface instanceof Event) {
Utils.openEventFragment((Event) cardInterface, fragment, view.findViewById(R.id.object_picture));
} else if (cardInterface instanceof Body) {
Utils.openBodyFragment((Body) cardInterface, fragment, view.findViewById(R.id.object_picture));
} else if (cardInterface instanceof User) {
Utils.openUserFragment((User) cardInterface, fragment, view.findViewById(R.id.object_picture));
} else if (cardInterface instanceof Role) {
Utils.openBodyFragment(((Role) cardInterface).getRoleBodyDetails(), fragment, view.findViewById(R.id.object_picture));
} else if (cardInterface instanceof Achievement) {
Achievement a = (Achievement) cardInterface;
if (a.getAchievementEvent() != null) {
a.getAchievementEvent().setEventBodies(new ArrayList<>());
a.getAchievementEvent().getEventBodies().add(a.getAchievementBody());
Utils.openEventFragment(a.getAchievementEvent(), fragment, view.findViewById(R.id.object_picture));
} else {
Utils.openBodyFragment(a.getAchievementBody(), fragment, view.findViewById(R.id.object_picture));
}
} else if (cardInterface instanceof OfferedAchievement) {
WebViewFragment webViewFragment = new WebViewFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.WV_TYPE, Constants.WV_TYPE_NEW_OFFERED_ACHIEVEMENT);
bundle.putString(Constants.WV_ID, ((OfferedAchievement) cardInterface).getAchievementID());
webViewFragment.setArguments(bundle);
Utils.updateFragment(webViewFragment, fragment.getActivity());
}
}
Aggregations