예제 #1
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   if (!(getActivity() instanceof MainActivity)) {
     throw new ClassCastException("MainNavFragment should be attached to MainActivity");
   }
 }
예제 #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();
 }
예제 #3
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   setHasOptionsMenu(true);
 }