當前位置: 首頁>>代碼示例>>Java>>正文


Java Fragment.setUserVisibleHint方法代碼示例

本文整理匯總了Java中android.app.Fragment.setUserVisibleHint方法的典型用法代碼示例。如果您正苦於以下問題:Java Fragment.setUserVisibleHint方法的具體用法?Java Fragment.setUserVisibleHint怎麽用?Java Fragment.setUserVisibleHint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.Fragment的用法示例。


在下文中一共展示了Fragment.setUserVisibleHint方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setPrimaryItem

import android.app.Fragment; //導入方法依賴的package包/類
@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;
    }
}
 
開發者ID:HueToYou,項目名稱:ChatExchange-old,代碼行數:20,代碼來源:HueFragmentPagerAdapter.java

示例2: instantiateItem

import android.app.Fragment; //導入方法依賴的package包/類
@Override
public Object instantiateItem(final ViewGroup container, final int position) {
    if (currentTransaction == null)
        currentTransaction = fragmentManager.beginTransaction();

    final String tag = (position == 0) ? TAG_LEFT : TAG_RIGHT;
    final Fragment fragment = (position == 0) ? left : right;
    currentTransaction.add(container.getId(), fragment, tag);

    if (fragment != currentPrimaryItem) {
        fragment.setMenuVisibility(false);
        fragment.setUserVisibleHint(false);
    }

    return fragment;
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:17,代碼來源:AddressBookActivity.java

示例3: showMapUiLayout

import android.app.Fragment; //導入方法依賴的package包/類
@Override
public void showMapUiLayout(Context context, RelativeLayout mapUI, Fragment mapFrag) {
    if(isMapFragmentShowing){
        return;
    }
    mapFrag.setUserVisibleHint(true);
    Animation animation = AnimationUtils.loadAnimation(context, R.anim.scale_in);
    mapUI.startAnimation(animation);
    isMapFragmentShowing = true;
}
 
開發者ID:stdnull,項目名稱:RunMap,代碼行數:11,代碼來源:TrackPresenterImpl.java

示例4: instantiateItem

import android.app.Fragment; //導入方法依賴的package包/類
@Override
public Object instantiateItem(ViewGroup container, int position)
{
    if (mCurTransaction == null)
    {
        mCurTransaction = mFragmentManager.beginTransaction();
    }
    final long itemId = getItemId(position);
    // Do we already have this fragment?
    String name = makeFragmentName(container.getId(), itemId);
    Fragment fragment = mFragmentManager.findFragmentByTag(name);
    if (fragment != null)
    {
        if (DEBUG)
        {
            Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment);
        }
        mCurTransaction.attach(fragment);
    }
    else
    {
        fragment = getItem(position);
        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;
}
 
開發者ID:HueToYou,項目名稱:ChatExchange-old,代碼行數:37,代碼來源:HueFragmentPagerAdapter.java

示例5: instantiateItem

import android.app.Fragment; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
@Override
public Object instantiateItem(ViewGroup container, int position) {
    if (currTransaction == null) {
        currTransaction = fm.beginTransaction();
    }

    Fragment fragment = getExistingFragment(position);

    if (fragment != null) {
        retentionStrategy.attach(fragment, currTransaction);
    } else {
        fragment = createFragment(entries.get(position).getDescriptor());
        currTransaction.add(container.getId(), fragment,
                getFragmentTag(position));
    }

    if (fragment != currPrimaryItem) {
        fragment.setMenuVisibility(false);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
            fragment.setUserVisibleHint(false);
        }
    }

    return (fragment);
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:28,代碼來源:ArrayPagerAdapter.java

示例6: setPrimaryItem

import android.app.Fragment; //導入方法依賴的package包/類
@Override
public void setPrimaryItem(final ViewGroup container, final int position, final Object object) {
    final Fragment fragment = (Fragment) object;
    if (fragment != currentPrimaryItem) {
        if (currentPrimaryItem != null) {
            currentPrimaryItem.setMenuVisibility(false);
            currentPrimaryItem.setUserVisibleHint(false);
        }
        if (fragment != null) {
            fragment.setMenuVisibility(true);
            fragment.setUserVisibleHint(true);
        }
        currentPrimaryItem = fragment;
    }
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:16,代碼來源:AddressBookActivity.java


注:本文中的android.app.Fragment.setUserVisibleHint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。