Fragment setMenuVisibility - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment setMenuVisibility method.

This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
//                    makeFragmentName(container.getId(), itemId)); 
            mCurTransaction.add(container.getId(), fragment,
                    getTag(position));
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
        if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object
                + " v=" + ((Fragment) object).getView());
        mCurTransaction.detach((Fragment) object);
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
            SurespotLog.v(TAG, "Adding item #" + itemId + ": f=" + fragment);
            mCurTransaction.add(container.getId(), fragment,
                    makeFragmentName(container.getId(), itemId));
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
     //   SurespotLog.v(TAG, "Detaching item #" + getItemId(position-1) + ": f=" + object 
     //           + " v=" + ((Fragment)object).getView()); 
        mCurTransaction.detach((Fragment)object);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
        } else { 
            fragment = getItem(position);
            mCurTransaction.add(container.getId(), fragment, name);
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
 
        mCurTransaction.detach((Fragment) object);
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility
    @Override 
    public void setPrimaryItem(View container, int position, Object object) {
        Fragment fragment = (Fragment)object;
        if (fragment != mCurrentPrimaryItem) {
            if (mCurrentPrimaryItem != null) {
                mCurrentPrimaryItem.setMenuVisibility(false);
            } 
            if (fragment != null) {
                fragment.setMenuVisibility(true);
            } 
            mCurrentPrimaryItem = fragment;
        } 
    } 
 
    @Override 
    public void finishUpdate(View container) {
        if (mCurTransaction != null) {
            mCurTransaction.commitAllowingStateLoss();
            mCurTransaction = null;
            mFragmentManager.executePendingTransactions();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
	@Override 
	public void setPrimaryItem(ViewGroup container, int position, Object object) {
		Fragment fragment = (Fragment) object;
		if (fragment != mCurrentPrimaryItem) {
			if (mCurrentPrimaryItem != null) {
				mCurrentPrimaryItem.setMenuVisibility(false);
				mCurrentPrimaryItem.setUserVisibleHint(false);
			} 
			if (fragment != null) {
				fragment.setMenuVisibility(true);
				fragment.setUserVisibleHint(true);
			} 
			mCurrentPrimaryItem = fragment;
		} 
	} 
 
	@Override 
	public void finishUpdate(ViewGroup container) {
		if (mCurTransaction != null) {
			try { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
				Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment);
			mCurTransaction.attach(fragment);
		} else { 
			fragment = getItem(container, position);
			if (fragment instanceof Laziable) {
				mLazyItems.put(position, fragment);
			} else { 
				mCurTransaction.add(container.getId(), fragment, name);
			} 
		} 
		if (fragment != getCurrentItem()) {
			fragment.setMenuVisibility(false);
			fragment.setUserVisibleHint(false);
		} 
 
		return fragment;
	} 
 
	@Override 
	public void destroyItem(ViewGroup container, int position, Object object) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
	@Override 
	public void setPrimaryItem(ViewGroup container, int position, Object object) {
		Fragment fragment = (Fragment) object;
		if (fragment != mCurrentPrimaryItem) {
			if (mCurrentPrimaryItem != null) {
				mCurrentPrimaryItem.setMenuVisibility(false);
				mCurrentPrimaryItem.setUserVisibleHint(false);
			} 
			if (fragment != null) {
				fragment.setMenuVisibility(true);
				fragment.setUserVisibleHint(true);
			} 
			mCurrentPrimaryItem = fragment;
		} 
	} 
 
	@Override 
	public void finishUpdate(ViewGroup container) {
		if (mCurTransaction != null) {
			try { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
			if (DEBUG)
				Log.v(TAG, "Adding item #" + position + ": f=" + fragment);
			mCurTransaction.add(container.getId(), fragment, makeFragmentName(container.getId(), position));
		} 
		if (fragment != mCurrentPrimaryItem) {
			fragment.setMenuVisibility(false);
			fragment.setUserVisibleHint(false);
		} 
 
		return fragment;
	} 
 
	/** 
	 * This function is the reason why this class is a full copy of 
	 * FragmentPagerAdapter and not an implementation. The app required the 
	 * ability to call functions on each FileListFragment from the main class. 
	 * This function needed to be able to reference mFragmentManger. 
	 *  
	 * @param container  
	 * @param position 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
    @Override 
    public void setPrimaryItem(ViewGroup container, int position, Object object) {
        Fragment fragment = (Fragment)object;
        if (fragment != mCurrentPrimaryItem) {
            if (mCurrentPrimaryItem != null) {
                mCurrentPrimaryItem.setMenuVisibility(false);
                mCurrentPrimaryItem.setUserVisibleHint(false);
            } 
            if (fragment != null) {
                fragment.setMenuVisibility(true);
                fragment.setUserVisibleHint(true);
            } 
            mCurrentPrimaryItem = fragment;
        } 
    } 
 
    @Override 
    public void finishUpdate(ViewGroup container) {
        if (mCurTransaction != null) {
            mCurTransaction.commitAllowingStateLoss();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMenuVisibility, setUserVisibleHint
            if (DEBUG) Log.v(TAG, "Adding item #" + itemId + ": f=" + fragment);
            mCurTransaction.add(container.getId(), fragment,
                    makeFragmentName(container.getId(), itemId));
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
        if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object
                + " v=" + ((Fragment)object).getView());
        mCurTransaction.detach((Fragment)object);
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Fragment setMenuVisibility Questions & Answers:

setMenuVisibility Method Overview
Set a hint for whether this fragment's menu should be visible.
See Code Examples for other Android Fragment Methods: