Java Code Examples for android.support.v4.app.FragmentManager.OnBackStackChangedListener

The following are top voted examples for showing how to use android.support.v4.app.FragmentManager.OnBackStackChangedListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: FMTech   File: PreviewController.java   View source code 6 votes vote down vote up
public static void setupOnBackStackChangedListener(NavigationManager paramNavigationManager)
{
  FragmentManager.OnBackStackChangedListener local1 = new FragmentManager.OnBackStackChangedListener()
  {
    public final void onBackStackChanged()
    {
      PreviewPlayer localPreviewPlayer1 = PreviewController.mPlayer;
      Utils.ensureOnMainThread();
      localPreviewPlayer1.mQueue.clear();
      PreviewPlayer localPreviewPlayer2 = PreviewController.mPlayer;
      switch (localPreviewPlayer2.mPlayer.mCurrentState)
      {
      }
      for (;;)
      {
        PreviewController.mPlayer.reset();
        this.val$navigationManager.removeOnBackStackChangedListener(this);
        return;
        localPreviewPlayer2.mPlayer.stop();
      }
    }
  };
  paramNavigationManager.removeOnBackStackChangedListener(local1);
  paramNavigationManager.addOnBackStackChangedListener(local1);
}
 
Example 2
Project: android-whogoesfirst   File: MainActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
		@Override
		public void onBackStackChanged() {
			supportInvalidateOptionsMenu();
		}
	});

	if (savedInstanceState == null) {
		mPlayerCountFragment = new PlayerCountFragment();

		FragmentManager fm = getSupportFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		ft.add(android.R.id.content, mPlayerCountFragment, PlayerCountFragment.TAG);
		ft.commit();
	}
	else {
		mPlayerCountFragment = Ui.findFragment(this, PlayerCountFragment.TAG);
		mWhoGoesFragment = Ui.findFragment(this, WhoGoesFragment.TAG);
	}
}
 
Example 3
Project: letv   File: FragmentManagerImpl.java   View source code 5 votes vote down vote up
void reportBackStackChanged() {
    if (this.mBackStackChangeListeners != null) {
        for (int i = 0; i < this.mBackStackChangeListeners.size(); i++) {
            ((OnBackStackChangedListener) this.mBackStackChangeListeners.get(i)).onBackStackChanged();
        }
    }
}
 
Example 4
Project: boohee_v5.6   File: FragmentManagerImpl.java   View source code 5 votes vote down vote up
void reportBackStackChanged() {
    if (this.mBackStackChangeListeners != null) {
        for (int i = 0; i < this.mBackStackChangeListeners.size(); i++) {
            ((OnBackStackChangedListener) this.mBackStackChangeListeners.get(i)).onBackStackChanged();
        }
    }
}
 
Example 5
Project: extend-enhance-base   File: BaseActivity.java   View source code 5 votes vote down vote up
/**
 * * It called by {@link #onCreate(Bundle)}) from {@link BaseActivity} automatically. <br/>
 * It used to add system default back stack.<br/>
 */
public void setDefaultBackStackListener() {
    getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
        @Override
        public void onBackStackChanged() {
            BackStackSyncStatus();
        }
    });
}
 
Example 6
Project: TedMemo   File: FragmentExchangeController.java   View source code 5 votes vote down vote up
public static void addFragment(FragmentManager supportFragmentManager, Fragment baseDialogFragment, int content, String tag) {

		FragmentTransaction transaction = supportFragmentManager.beginTransaction();
		transaction.setCustomAnimations(R.anim.anim_fragment_in, R.anim.anim_fragment_out, R.anim.anim_fragment_close_in, R.anim.anim_fragment_close_out);
		Fragment fragment = supportFragmentManager.findFragmentById(content);
		if (fragment != null) {
			if (fragment instanceof OnBackStackChangedListener) {
				supportFragmentManager.addOnBackStackChangedListener((OnBackStackChangedListener) fragment);
			}
			transaction.hide(fragment);
		}
		transaction.add(content, baseDialogFragment, tag);
		transaction.addToBackStack(tag);
		transaction.commitAllowingStateLoss();
	}
 
Example 7
Project: letv   File: FragmentManagerImpl.java   View source code 4 votes vote down vote up
public void addOnBackStackChangedListener(OnBackStackChangedListener listener) {
    if (this.mBackStackChangeListeners == null) {
        this.mBackStackChangeListeners = new ArrayList();
    }
    this.mBackStackChangeListeners.add(listener);
}
 
Example 8
Project: letv   File: FragmentManagerImpl.java   View source code 4 votes vote down vote up
public void removeOnBackStackChangedListener(OnBackStackChangedListener listener) {
    if (this.mBackStackChangeListeners != null) {
        this.mBackStackChangeListeners.remove(listener);
    }
}
 
Example 9
Project: boohee_v5.6   File: FragmentManagerImpl.java   View source code 4 votes vote down vote up
public void addOnBackStackChangedListener(OnBackStackChangedListener listener) {
    if (this.mBackStackChangeListeners == null) {
        this.mBackStackChangeListeners = new ArrayList();
    }
    this.mBackStackChangeListeners.add(listener);
}
 
Example 10
Project: boohee_v5.6   File: FragmentManagerImpl.java   View source code 4 votes vote down vote up
public void removeOnBackStackChangedListener(OnBackStackChangedListener listener) {
    if (this.mBackStackChangeListeners != null) {
        this.mBackStackChangeListeners.remove(listener);
    }
}
 
Example 11
Project: ircradio   File: ActMain.java   View source code 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.act_main);

    // enable ActionBar app icon to behave as action to toggle nav drawer
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    // ActionBarDrawerToggle ties together the the proper interactions
    // between the sliding drawer and the action bar app icon
    mDrawerToggle = new ActionBarDrawerToggle(
            this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.string.drawer_open, /*
                                     * "open drawer" description for
                                     * accessibility
                                     */
            R.string.drawer_close /*
                                     * "close drawer" description for
                                     * accessibility
                                     */
    ) {
        public void onDrawerClosed(View view) {
            refreshTitle(false);
            invalidateOptionsMenu(); // creates call to
            // onPrepareOptionsMenu()
            if (ActMain.this.getSupportFragmentManager().getBackStackEntryCount() > 1) {
                mDrawerToggle.setDrawerIndicatorEnabled(false);
            }
        }

        public void onDrawerOpened(View drawerView) {
            refreshTitle(true);
            invalidateOptionsMenu(); // creates call to
            // onPrepareOptionsMenu()
            mDrawerToggle.setDrawerIndicatorEnabled(true);
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    if (savedInstanceState == null) {
        addTopFragmentToStack();
    }

    getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {

        @Override
        public void onBackStackChanged() {
            int count = ActMain.this.getSupportFragmentManager().getBackStackEntryCount();
            if (count > 1) {
                mDrawerToggle.setDrawerIndicatorEnabled(false);
            } else {
                mDrawerToggle.setDrawerIndicatorEnabled(true);
            }
        }
    });

}
 
Example 12
Project: FMTech   File: NavigationManager.java   View source code 4 votes vote down vote up
public void addOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener)
{
  this.mFragmentManager.addOnBackStackChangedListener(paramOnBackStackChangedListener);
}
 
Example 13
Project: FMTech   File: NavigationManager.java   View source code 4 votes vote down vote up
public final void removeOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener)
{
  this.mFragmentManager.removeOnBackStackChangedListener(paramOnBackStackChangedListener);
}
 
Example 14
Project: FMTech   File: ActionBarHelper.java   View source code 4 votes vote down vote up
public ActionBarHelper(NavigationManager paramNavigationManager, ActionBarController paramActionBarController, ActionBarActivity paramActionBarActivity)
{
  this.mActionBar = paramActionBarActivity.getDelegate().getSupportActionBar();
  this.mToolbar = ((FinskySearchToolbar)paramActionBarActivity.findViewById(2131755196));
  this.mActivity = paramActionBarActivity;
  this.mNavigationManager = paramNavigationManager;
  this.mActionBarController = paramActionBarController;
  this.mActionBarStateStack = new Stack();
  this.mActionBarStateStack.push(new ActionBarState(0, null));
  this.mCurrentBackendId = 0;
  if (this.mToolbar != null)
  {
    this.mToolbar.setCurrentBackendId(this.mCurrentBackendId);
    this.mToolbar.setNavigationManager(this.mNavigationManager);
    this.mToolbar.setActionBarController(this.mActionBarController);
    this.mToolbar.setVisibility(4);
  }
  if (this.mToolbar != null) {
    if ((!DotNotificationUtils.shouldShowAccountCompletionDotNotification()) || (((Integer)FinskyPreferences.accountCompletionMainMenuDotTapCount.get(FinskyApp.get().getCurrentAccountName()).get()).intValue() != 0)) {
      break label306;
    }
  }
  label306:
  for (int i = 1;; i = 0)
  {
    if (i != 0)
    {
      View localView = this.mToolbar.getSearchView().findViewById(2131755724);
      if (localView != null) {
        localView.setVisibility(0);
      }
      this.mMainMenuUiElementNode = new GenericUiElementNode(5301, null, null, new GenericUiElementNode(5300, null, null, this.mNavigationManager.getActivePage()));
      FinskyApp.get().getEventLogger().logPathImpression$7d139cbf(299, this.mMainMenuUiElementNode);
    }
    if (this.mActionBar != null) {
      this.mActionBar.setBackgroundDrawable(getBackgroundColorDrawable(CorpusResourceUtils.getPrimaryColor(this.mActivity, 0)));
    }
    this.mTransparentBackgroundDrawable = new ColorDrawable(0);
    paramNavigationManager.addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener()
    {
      public final void onBackStackChanged()
      {
        if (ActionBarHelper.sSawFirstBackstackChange) {
          ActionBarHelper.this.clearSearch();
        }
        for (;;)
        {
          ActionBarHelper.this.syncState();
          return;
          ActionBarHelper.access$002$138603();
        }
      }
    });
    return;
  }
}
 
Example 15
Project: ImproveMyCity-Mobile   File: Fragment_Map.java   View source code 4 votes vote down vote up
/**
 *            OnCreateView 
 * 
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

	// ----- Inflate the view ---------
	if (vframelayout_main != null) {
		//ViewGroup parent = (ViewGroup) vframelayout_main.getParent();
		container.removeView(vframelayout_main);
	} else {		
		vframelayout_main = inflater.inflate(R.layout.framelayout_map, container, false);
	}

	ctx = vframelayout_main.getContext();

	//------- Add fragment_map ----
	if (fmap_main==null){
		fmap_main = SupportMapFragment.newInstance();
		FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
		fragmentTransaction.add(R.id.flmain, fmap_main);
		fragmentTransaction.commit();
	}

	getFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {    
		public void onBackStackChanged() {
			if (fmap_main == null && !Fragment_Issue_Details.isVisible && FActivity_TabHost.IndexGroup==0){
				onResume();
			} 
		}
	});

	//-----------------------------
	pbgeneral = (ProgressBar) vframelayout_main.findViewById(R.id.pbgeneral);
	pbgeneral.bringToFront();

	//---- Bind Location Service --------------
	IntLocServ = new Intent(ctx, Service_Location.class);

	if (!isLocServBound && FActivity_TabHost.IndexGroup == 0)
		ctx.bindService(IntLocServ, mLocConnection, Context.BIND_AUTO_CREATE);

	FActivity_TabHost.IndexGroup = 0;


	//-----Start Data Service ------------
	IntDataServ = new Intent(ctx, Service_Data.class);
	ctx.startService(IntDataServ);


	return vframelayout_main;
}
 
Example 16
Project: FMTech   File: FakeNavigationManager.java   View source code votes vote down vote up
public final void addOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener) {}