コード例 #1
0
  @Override
  public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    // When the given tab is selected, switch to the corresponding page in
    // the ViewPager.
    mViewPager.setCurrentItem(tab.getPosition());

    Log.d(LOG_TAG, "OnPageChangeListener Called with position - " + tab.getPosition());

    if (tab.getPosition() == 0) {
      Log.d(LOG_TAG, "Trying to find MySpotsFragment.");
      MySpotsFragment fragment = (MySpotsFragment) mSectionsPagerAdapter.getItem(tab.getPosition());
      if (fragment != null) {
        Log.d(LOG_TAG, "Found MySpotsFragment. Calling refresh spot list.");
        fragment.RefreshListOfSpotsTwoLines(this);
      }

    } else if (tab.getPosition() == 1) {
      //			AddSpotFragment fragment = (AddSpotFragment)
      // mSectionsPagerAdapter.getItem(tab.getPosition());
      //			if (fragment  != null) {
      //				Log.d(LOG_TAG, "Found MySpotsFragment. Calling refresh spot list.");
      //				fragment.refreshSpotNamesInAutocomplete(this);
      //			}
    }
  }
コード例 #2
0
ファイル: MainActivity.java プロジェクト: saniadiao/Jandan
 @Override
 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
   // When the given tab is selected, switch to the corresponding page in
   // the ViewPager.
   Log.d(Constants.TAG, "MainActivity.onTabSelected");
   mViewPager.setCurrentItem(tab.getPosition());
 }
コード例 #3
0
ファイル: MainActivity.java プロジェクト: rachelee/MyTube
 @Override
 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
   // When the given tab is selected, switch to the corresponding page in
   // the ViewPager.
   mViewPager.setCurrentItem(tab.getPosition());
   favTab.refreshListview();
 }
コード例 #4
0
 @Override
 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
   // When the given tab is selected, switch to the corresponding page in
   // the ViewPager.
   mViewPager.setCurrentItem(tab.getPosition());
   mViewPager.setOffscreenPageLimit(5); // setta il limite per non ricaricare i fragments
 }
コード例 #5
0
        public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {

          if (mViewPager.getCurrentItem() != tab.getPosition())
            mViewPager.setCurrentItem(tab.getPosition());
          if (getCommentFragment() != null) getCommentFragment().clearActionMode();
          if (getRepostFragment() != null) getRepostFragment().clearActionMode();

          switch (tab.getPosition()) {
            case 1:
              comment = true;
              break;
            case 2:
              repost = true;
              break;
            case 3:
              break;
          }
        }
コード例 #6
0
 @Override
 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
   // When the given tab is selected, show the tab contents in the
   // container view.
   Fragment fragment = new DummySectionFragment();
   Bundle args = new Bundle();
   args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, tab.getPosition() + 1);
   fragment.setArguments(args);
   getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();
 }
コード例 #7
0
 public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
   switch (tab.getPosition()) {
     case 1:
       comment = false;
       break;
     case 2:
       repost = false;
       break;
   }
 }
コード例 #8
0
 public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
   switch (tab.getPosition()) {
     case 1:
       if (comment) {
         Utility.stopListViewScrollingAndScrollToTop(getCommentFragment().getListView());
       }
       break;
     case 2:
       if (repost) {
         Utility.stopListViewScrollingAndScrollToTop(getRepostFragment().getListView());
       }
       break;
     case 3:
       break;
   }
 }
コード例 #9
0
ファイル: MainActivity.java プロジェクト: b3b00/WBR
  public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    int tabIndex = tab.getPosition();

    NetworkListFragment fragment = fragments.get(tabIndex);

    if (fragment == null) {
      if (tabIndex == 0) {
        fragment = new BackupedFragment();
      } else if (tabIndex == 1) {
        fragment = new ConfiguredFragment();
      }
    }

    fragments.put(tabIndex, fragment);

    getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();
  }
コード例 #10
0
  @Override
  public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {

    Fragment fragment = new MyFragment();
    Bundle args = new Bundle();

    switch (tab.getPosition()) {
      case 0:
        args.putString("color", "#2574a9");
        fragment.setArguments(args);
        break;
      case 1:
        args.putString("color", "#36d5b5");
        fragment.setArguments(args);
        break;
      case 2:
        args.putString("color", "#f9640f");
        fragment.setArguments(args);
        break;
    }

    ft.replace(android.R.id.content, fragment);
  }
コード例 #11
0
 @Override
 public int getPosition() {
   return mNativeTab.getPosition();
 }
コード例 #12
0
ファイル: Schedule.java プロジェクト: SmartEdu-SKM/SKM
  @Override
  public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {

    Tab.setCurrentItem(tab.getPosition());
  }
コード例 #13
0
 @Override
 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
   viewPager.setAdapter(new HomeViewPagerAdapter(getSupportFragmentManager()));
   viewPager.setCurrentItem(tab.getPosition());
 }
コード例 #14
0
  @Override
  public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    config.refresh();

    mViewPager.setCurrentItem(tab.getPosition());
  }