Example usage for android.app Fragment setMenuVisibility

List of usage examples for android.app Fragment setMenuVisibility

Introduction

In this page you can find the example usage for android.app Fragment setMenuVisibility.

Prototype

public void setMenuVisibility(boolean menuVisible) 

Source Link

Document

Set a hint for whether this fragment's menu should be visible.

Usage

From source file:cn.ieclipse.af.adapter.AfFragmentPagerAdapter.java

private void setMenuVisibility(Fragment f, boolean isVisible) {
    f.setMenuVisibility(isVisible);
}

From source file:com.mcxiaoke.minicat.adapter.FragmentPagerAdapter.java

@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        }//from   w w w. j a  va2  s .c  o  m
        if (fragment != null) {
            fragment.setMenuVisibility(true);
            fragment.setUserVisibleHint(true);
        }
        mCurrentPrimaryItem = fragment;
    }
}

From source file:com.nononsenseapps.support.app.FragmentPagerAdapter.java

@TargetApi(14)
private void setMenuVisibility(final Fragment fragment, final boolean value) {
    if (fragment != null && context.getResources().getBoolean(R.bool.atLeast14))
        fragment.setMenuVisibility(value);
}

From source file:edu.benlerner.perfectshuffle.MyFragmentPagerAdapter.java

public void setPrimaryItem(View container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            mCurrentPrimaryItem.setMenuVisibility(false);
        }//from w ww  .  j a  va  2  s  . c o  m
        if (fragment != null) {
            fragment.setMenuVisibility(true);
        }
        mCurrentPrimaryItem = fragment;
    }
}

From source file:tw.com.ischool.dominator.util.ViewPagerAdapter.java

@Override
public void setPrimaryItem(View container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            mCurrentPrimaryItem.setMenuVisibility(false);
        }//from  w w w . j a  v a  2s. c  om
        if (fragment != null) {
            fragment.setMenuVisibility(true);
        }
        mCurrentPrimaryItem = fragment;
        onPrimaryItemChanged(position);
    }
}

From source file:com.airbitz.adapters.FragmentPagerAdapter.java

@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            mCurrentPrimaryItem.setMenuVisibility(false);
        }//from ww  w .j a v  a  2 s  . c  om
        if (fragment != null) {
            fragment.setMenuVisibility(true);
        }
        mCurrentPrimaryItem = fragment;
    }
}

From source file:com.example.study.studyproject.adapter.FragmentStatePagerAdapter.java

@Override
public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
        Bundle bundle = (Bundle) state;//from w  ww .j  ava 2 s .c  o m
        bundle.setClassLoader(loader);
        Parcelable[] fss = bundle.getParcelableArray("states");
        mSavedState.clear();
        mFragments.clear();
        if (fss != null) {
            for (int i = 0; i < fss.length; i++) {
                mSavedState.add((Fragment.SavedState) fss[i]);
            }
        }
        Iterable<String> keys = bundle.keySet();
        for (String key : keys) {
            if (key.startsWith("f")) {
                int index = Integer.parseInt(key.substring(1));
                Fragment f = mFragmentManager.getFragment(bundle, key);
                if (f != null) {
                    while (mFragments.size() <= index) {
                        mFragments.add(null);
                    }
                    f.setMenuVisibility(false);
                    mFragments.set(index, f);
                } else {

                }
            }
        }
    }
}

From source file:com.afollestad.polar.viewer.FragmentStatePagerAdapter.java

@Override
public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
        Bundle bundle = (Bundle) state;//from   ww w  .j av  a  2 s  . com
        bundle.setClassLoader(loader);
        Parcelable[] fss = bundle.getParcelableArray("states");
        mSavedState.clear();
        mFragments.clear();
        if (fss != null) {
            for (Parcelable fs : fss) {
                mSavedState.add((Fragment.SavedState) fs);
            }
        }
        Iterable<String> keys = bundle.keySet();
        for (String key : keys) {
            if (key.startsWith("f")) {
                int index = Integer.parseInt(key.substring(1));
                Fragment f = mFragmentManager.getFragment(bundle, key);
                if (f != null) {
                    while (mFragments.size() <= index) {
                        mFragments.add(null);
                    }
                    f.setMenuVisibility(false);
                    mFragments.set(index, f);
                } else {
                    Log.w(TAG, "Bad fragment at key " + key);
                }
            }
        }
    }
}

From source file:com.teamboid.twitter.TaggedFragmentAdapter.java

@Override
public void setPrimaryItem(View container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            mCurrentPrimaryItem.setMenuVisibility(false);
        }/*  ww  w  .  j  a v a 2  s .c o m*/
        if (fragment != null) {
            fragment.setMenuVisibility(true);
        }
        mCurrentPrimaryItem = fragment;
    }
}

From source file:org.wen.rubychina.ui.adapter.internal.FragmentPagerAdapter.java

@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
    Fragment fragment = (Fragment) object;
    if (fragment != mCurrentPrimaryItem) {
        if (mCurrentPrimaryItem != null) {
            mCurrentPrimaryItem.setMenuVisibility(false);
            setUserVisibleHint(mCurrentPrimaryItem);
        }/* www  . j  a  v  a  2s  .c  o m*/
        if (fragment != null) {
            fragment.setMenuVisibility(true);
            setUserVisibleHint(fragment);
        }
        mCurrentPrimaryItem = fragment;
    }
}