本文整理汇总了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();
}
}
}
示例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");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
}
示例7: bindData
import com.jess.arms.base.BaseFragment; //导入依赖的package包/类
public void bindData(List<BaseFragment> list) {
this.list = list;
notifyDataSetChanged();
}