当前位置: 首页>>代码示例>>Java>>正文


Java FragmentTransaction.hide方法代码示例

本文整理汇总了Java中android.app.FragmentTransaction.hide方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentTransaction.hide方法的具体用法?Java FragmentTransaction.hide怎么用?Java FragmentTransaction.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.FragmentTransaction的用法示例。


在下文中一共展示了FragmentTransaction.hide方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hidePreFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void hidePreFragment(FragmentTransaction transaction) {
    Log.d(TAG, "hidePreFragment: mCurrentPageTag = "+mCurrentPageTag);
    switch (mCurrentPageTag) {
        case HOME_PAGE_TAG:
            transaction.hide(mHomeFragment);
            mHomeBtn.setTextColor(textColor);
            break;

        case EXPLORE_PAGE_TAG:
            transaction.hide(mExploreFragment);
            mExploreBtn.setTextColor(textColor);
            break;

        case MINE_PAGE_TAG:
            transaction.hide(mMineFragment);
            mMineBtn.setTextColor(textColor);
            break;
    }
}
 
开发者ID:AndroidWJC,项目名称:UnversityFinance,代码行数:20,代码来源:MainActivity.java

示例2: toggleCallControlFragmentVisibility

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void toggleCallControlFragmentVisibility() {
  if (!iceConnected || !callFragment.isAdded()) {
    return;
  }
  // Show/hide call control fragment
  callControlFragmentVisible = !callControlFragmentVisible;
  FragmentTransaction ft = getFragmentManager().beginTransaction();
  if (callControlFragmentVisible) {
    ft.show(callFragment);
    ft.show(hudFragment);
  } else {
    ft.hide(callFragment);
    ft.hide(hudFragment);
  }
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.commit();
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:18,代码来源:CallActivity.java

示例3: toggleCallControlFragmentVisibility

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void toggleCallControlFragmentVisibility() {
    if (!iceConnected || !callFragment.isAdded()) {
        return;
    }
    // Show/hide call control fragment
    callControlFragmentVisible = !callControlFragmentVisible;
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    if (callControlFragmentVisible) {
        ft.show(callFragment);
        ft.show(hudFragment);
    } else {
        ft.hide(callFragment);
        ft.hide(hudFragment);
    }
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.commit();
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:18,代码来源:CallActivity.java

示例4: showDetails

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * Hide list, show details and instruct the details view to show the selected book.
 */
@Override
public void showDetails(Book book, Drawable thumb) {
  final FragmentManager fragmentManager = getFragmentManager();
  FragmentTransaction ft = fragmentManager.beginTransaction();
  BookDetailsFragment details = (BookDetailsFragment) fragmentManager.findFragmentById(R.id.book_details);

  if (book != null) {
    // If null passed, we only configure fragment transaction here.
    details.showDetails(book, thumb);
  }

  ft.show(details);
  ft.hide(fragmentManager.findFragmentById(R.id.book_list));
  ft.addToBackStack("details"); // Use the back button to return to the search list view.

  ft.commit();
}
 
开发者ID:andviane,项目名称:google-books-android-viewer,代码行数:21,代码来源:BookListActivity.java

示例5: onCreate

import android.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!runFirst) return;

    if (savedInstanceState == null) {
        fileManagerFragment.create(this.getApplicationContext(), this);
        waiterFragment.create();

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        for (Fragment f : fragments.values()) {
            fragmentTransaction.add(R.id.rootContainer, f);
            fragmentTransaction.hide(f);
        }
        fragmentTransaction.commit();

        showFragment("server_list");

        sshServersSelector.setActionListener(this);
        fileManagerFragment.setActionListener(this);

        runFirst = false;
    }
}
 
开发者ID:konachan700,项目名称:SSHFileManager,代码行数:26,代码来源:MainActivity.java

示例6: switchFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void switchFragment(int index) {
    if (index == mCurrentIndex) return;

    Fragment fragment = mFragments.get(index);
    FragmentTransaction transaction =
            mFragmentManager
                    .beginTransaction()
                    .setCustomAnimations(R.animator.fragment_in, R.animator.fragment_out);

    String indexString = String.valueOf(index);
    Fragment targetFragment = mFragmentManager.findFragmentByTag(indexString);

    if (mCurrentIndex != -1) {
        // 不是首次启动
        transaction.hide(mFragments.get(mCurrentIndex));
    }

    if (targetFragment == null) {
        // 之前没有添加过
        transaction.add(R.id.fl_content, fragment, indexString);
    } else {
        transaction.show(targetFragment);
    }

    transaction.commit();
    mCurrentIndex = index;
}
 
开发者ID:iAcn,项目名称:MBEStyle,代码行数:28,代码来源:MainActivity.java

示例7: showFragmentOne

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * 根据tag显示viewId里的一个fragment,其他全部隐藏
 */
public void showFragmentOne(int containerViewId, String tag) {
    FragmentTransaction transaction = getTransaction();
    for (Fragment fragment : getFragmentList(containerViewId)) {
        if (fragment.getTag().equals(tag)) {
            transaction.show(fragment);
        } else if (!fragment.isHidden()) {
            transaction.hide(fragment);
        }
    }
    transaction.commit();
}
 
开发者ID:JJS-CN,项目名称:JBase,代码行数:15,代码来源:BaseActivity.java

示例8: show

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**使用本方法前必须先add*/
public void show(Fragment fragment){
    if (currentFragment==fragment) {
        return;//如果是当前fragment,则不重新show一遍了,无意义
    }
    FragmentTransaction ft = fm.beginTransaction();
    for (Fragment f:fs) {
        ft.hide(f);
    }
    ft.show(fragment);
    ft.commit();
    currentFragment = fragment;
}
 
开发者ID:WeGdufe,项目名称:MovingGdufe-Android,代码行数:14,代码来源:FragmentUtil.java

示例9: showList

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void showList() {
  final FragmentManager fragmentManager = getFragmentManager();
  FragmentTransaction ft = fragmentManager.beginTransaction();
  ft.show(fragmentManager.findFragmentById(R.id.book_list));
  ft.hide(fragmentManager.findFragmentById(R.id.book_details));
  ft.commit();
}
 
开发者ID:andviane,项目名称:google-books-android-viewer,代码行数:8,代码来源:BookListActivity.java

示例10: hideCamera

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private boolean hideCamera(CallbackContext callbackContext) {
  if(this.hasView(callbackContext) == false){
    return true;
  }

  FragmentManager fragmentManager = cordova.getActivity().getFragmentManager();
  FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  fragmentTransaction.hide(fragment);
  fragmentTransaction.commit();

  callbackContext.success();
  return true;
}
 
开发者ID:MrShakes,项目名称:cameraPreviewStream,代码行数:14,代码来源:CameraPreview.java

示例11: showFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void showFragment(String name) {
    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

    for (Fragment f : fragments.values()) {
        fragmentTransaction.hide(f);
    }

    if (fragments.containsKey(name)) {
        fragmentTransaction.show(fragments.get(name));
        currentFragment = name;
    }

    fragmentTransaction.commit();
}
 
开发者ID:konachan700,项目名称:SSHFileManager,代码行数:16,代码来源:MainActivity.java

示例12: onItemClick

import android.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void onItemClick(int i) {
    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    // 隐藏所有的Fragment
    if (exploreFragment != null)
        transaction.hide(exploreFragment);
    if (homeFragment != null)
        transaction.hide(homeFragment);
    if (settingsFragment != null)
        transaction.hide(settingsFragment);
    // 显示被选中的Fragment
    switch (i) {
        case 0:     // 动态
            if (homeFragment == null) {
                homeFragment = new HomeFragment();
                transaction.add(R.id.container, homeFragment);
            } else
                transaction.show(homeFragment);
            setTitle(R.string.dynamic);
            break;
        case 1:     // 发现
            if (exploreFragment == null) {
                exploreFragment = new ExploreFragment();
                transaction.add(R.id.container, exploreFragment);
            } else
                transaction.show(exploreFragment);
            setTitle(R.string.explore);
            break;
        case 3:
            if (settingsFragment == null) {
                settingsFragment = new SettingsFragment();
                transaction.add(R.id.container, settingsFragment);
            } else
                transaction.show(settingsFragment);
            setTitle("设置");
    }
    transaction.commit();
}
 
开发者ID:moe2studio,项目名称:PangciACG,代码行数:39,代码来源:MainActivity.java


注:本文中的android.app.FragmentTransaction.hide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。