Esempio n. 1
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   if (!(getActivity() instanceof MainActivity)) {
     throw new ClassCastException("MainNavFragment should be attached to MainActivity");
   }
 }
Esempio n. 2
0
 @Override
 public void setUp(int fragmentId, DrawerLayout drawerLayout) {
   super.setUp(fragmentId, drawerLayout);
   if (isOpen()) {
     getMainActivity().showAddRemoteButton();
   }
   mDrawerLayout.setDrawerListener(
       new DrawerLayout.SimpleDrawerListener() {
         @Override
         public void onDrawerSlide(View drawerView, float slideOffset) {
           getMainActivity().getAddRemoteButton().setOffset(slideOffset);
         }
       });
   update();
 }
Esempio n. 3
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   setHasOptionsMenu(true);
 }