コード例 #1
0
 private void refreshPeersFragment() {
   Fragment fragment = getCurrentFragment();
   if (fragment instanceof BrowsePeersFragment
       || fragment instanceof BrowsePeersDisabledFragment) {
     controller.switchFragment(R.id.menu_main_peers);
   }
   PeerManager.instance().updateLocalPeer();
 }
コード例 #2
0
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_SEARCH) {
      if (!(getCurrentFragment() instanceof SearchFragment)) {
        controller.switchFragment(R.id.menu_main_search);
      }
    } else if (keyCode == KeyEvent.KEYCODE_MENU) {
      toggleDrawer();
    } else {
      return super.onKeyDown(keyCode, event);
    }

    return true;
  }
コード例 #3
0
 /** public void showMyFiles() { controller.showMyFiles(); } */
 public void switchFragment(int itemId) {
   controller.switchFragment(itemId);
 }