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


Java BaseFragment类代码示例

本文整理汇总了Java中com.jess.arms.base.BaseFragment的典型用法代码示例。如果您正苦于以下问题:Java BaseFragment类的具体用法?Java BaseFragment怎么用?Java BaseFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onTabSelected

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
@Override
public void onTabSelected(int position) {
    if (fragments != null) {
        if (position < fragments.size()) {
            FragmentManager fm = getSupportFragmentManager();
            FragmentTransaction ft = fm.beginTransaction();
            BaseFragment fragment = fragments.get(position);
            if (fragment.isAdded()) {
                ft.show(fragment);
            } else {
                ft.add(R.id.layFrame, fragment);
            }
            ft.commitAllowingStateLoss();
        }
    }

}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:18,代码来源:MainActivity.java

示例2: bindToLifecycle

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
public static <T> LifecycleTransformer<T> bindToLifecycle(BaseView view) {
    if (view instanceof BaseActivity) {
        return ((BaseActivity) view).<T>bindToLifecycle();
    } else if (view instanceof BaseFragment) {
        return ((BaseFragment) view).<T>bindToLifecycle();
    } else {
        throw new IllegalArgumentException("view isn't activity or fragment");
    }

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RxUtils.java

示例3: initFragments

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
private List<BaseFragment> initFragments() {
    List<BaseFragment> baseFragments = new ArrayList<>();
    for (int i = 0; i < CHANNELS.length; i++) {
        baseFragments.add(NewsListFragment.newInstance(i+1,CHANNELS[i]));
    }
    return baseFragments;
}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:8,代码来源:NewsFragment.java

示例4: initFragments

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
private List<BaseFragment> initFragments() {
    List<BaseFragment> baseFragments = new ArrayList<>();
    for (int i = 0; i < 7; i++) {
        baseFragments.add(ImageListFragment.newInstance(i+1,CHANNELS[i]));
    }
    return baseFragments;
}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:8,代码来源:ImageFragment.java

示例5: getFragments

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
private ArrayList<BaseFragment> getFragments() {
    ArrayList<BaseFragment> fragments = new ArrayList<>();
    fragments.add(new ImageFragment());
    fragments.add(new NewsFragment());
    fragments.add(new UserFragment());
    return fragments;
}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:8,代码来源:MainActivity.java

示例6: onTabUnselected

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
@Override
public void onTabUnselected(int position) {
    if (fragments != null) {
        if (position < fragments.size()) {
            FragmentManager fm = getSupportFragmentManager();
            FragmentTransaction ft = fm.beginTransaction();
            BaseFragment fragment = fragments.get(position);
            ft.hide(fragment);
            ft.commitAllowingStateLoss();
        }
    }
}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:13,代码来源:MainActivity.java

示例7: bindData

import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
public void bindData(List<BaseFragment> list) {
    this.list = list;
    notifyDataSetChanged();
}
 
开发者ID:Wan7451,项目名称:mvparms,代码行数:5,代码来源:BasePagerAdapter.java


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