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


Java SupportFragment类代码示例

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


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

示例1: getTargetFragment

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
private SupportFragment getTargetFragment(int item) {
    switch (item) {
        case Constants.TYPE_ZHIHU:
            return mZhihuFragment;
        case Constants.TYPE_GANK:
            return mGankFragment;
        case Constants.TYPE_WECHAT:
            return mWechatFragment;
        case Constants.TYPE_GOLD:
            return mGoldFragment;
        case Constants.TYPE_VTEX:
            return mVtexFragment;
        case Constants.TYPE_LIKE:
            return mLikeFragment;
        case Constants.TYPE_SETTING:
            return mSettingFragment;
        case Constants.TYPE_ABOUT:
            return mAboutFragment;
    }
    return mZhihuFragment;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:MainActivity.java

示例2: getLayoutView

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
public View getLayoutView() {
    coreRecyclerView = new CoreRecyclerView(mContext).init(new GridLayoutManager(mContext, 2),
            new BaseQuickAdapter<SectionListBean.DataBean, BaseViewHolder>(R.layout.item_section) {
                @Override
                protected void convert(BaseViewHolder helper, SectionListBean.DataBean item) {
                    //Glide在加载GridView等时,由于ImageView和Bitmap实际大小不符合,第一次时加载可能会变形(我这里出现了放大),必须在加载前再次固定ImageView大小
                    ViewGroup.LayoutParams lp = helper.getView(R.id.section_bg).getLayoutParams();
                    lp.width = (App.SCREEN_WIDTH - DisplayUtils.dp2px(mContext, 12)) / 2;
                    lp.height = DisplayUtils.dp2px(mContext, 120);

                    Glide.with(mContext).load(item.getThumbnail()).crossFade().placeholder(R.drawable.ic_default_cover).into((ImageView) helper.getView(R.id.section_bg));
                    helper.setText(R.id.section_kind, item.getName())
                            .setText(R.id.section_des, item.getDescription())
                            .setOnClickListener(R.id.ll_click, v -> {
                                ((SupportFragment) getParentFragment()).start(SectionListFragment.newInstance(item.getId(), item.getName()));
                            });
                }
            });
    return coreRecyclerView;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:SectionFragment.java

示例3: getTargetFragment

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
private SupportFragment getTargetFragment(int item) {
    switch (item) {
        case Constants.NavigationItem.TYPE_ZHIHU:
            return mZhihuFragment;
        case Constants.NavigationItem.TYPE_GANK:
            return mGankFragment;
        case Constants.NavigationItem.TYPE_WECHAT:
            return mWechatFragment;
        case Constants.NavigationItem.TYPE_NEWS:
            return mNewsFragment;
        case Constants.NavigationItem.TYPE_LIKE:
            return mLikeFragment;
        case Constants.NavigationItem.TYPE_SETTING:
            return mSettingFragment;
        case Constants.NavigationItem.TYPE_ABOUT:
            return mAboutFragment;
    }
    return mZhihuFragment;
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:20,代码来源:MainActivity.java

示例4: onActivityCreated

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    SupportFragment firstFragment = findChildFragment(WechatFirstTabFragment.class);
    if (firstFragment == null) {
        mFragments[FIRST] = WechatFirstTabFragment.newInstance();
        mFragments[SECOND] = WechatSecondTabFragment.newInstance();
        mFragments[THIRD] = WechatThirdTabFragment.newInstance();

        loadMultipleRootFragment(R.id.fl_tab_container, FIRST,
                mFragments[FIRST],
                mFragments[SECOND],
                mFragments[THIRD]);
    } else {
        // 这里库已经做了Fragment恢复,所有不需要额外的处理了, 不会出现重叠问题

        // 这里我们需要拿到mFragments的引用
        mFragments[FIRST] = firstFragment;
        mFragments[SECOND] = findChildFragment(WechatSecondTabFragment.class);
        mFragments[THIRD] = findChildFragment(WechatThirdTabFragment.class);
    }
}
 
开发者ID:YoKeyword,项目名称:Fragmentation,代码行数:23,代码来源:MainFragment.java

示例5: initFragment

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
private void initFragment(){
    mFragments =  new SupportFragment[3];
    HomeFragment homeFragment = new HomeFragment();
    ClockFragment clockFragment = new ClockFragment();
    MineFragment mineFragment = new MineFragment();

    mFragments[0] = homeFragment;
    mFragments[1] = clockFragment;
    mFragments[2] = mineFragment;

    loadMultipleRootFragment(mContentLayout.getId(),0,mFragments);


}
 
开发者ID:haihaio,项目名称:AmenWeather,代码行数:15,代码来源:HomeActivity.java

示例6: dispatchSupportVisible

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
private void dispatchSupportVisible(boolean visible) {
    mIsSupportVisible = visible;

    if (!mNeedDispatch) {
        mNeedDispatch = true;
    } else {
        FragmentManager fragmentManager = mSupportFragment.getChildFragmentManager();
        if (fragmentManager != null) {
            List<Fragment> childFragments = fragmentManager.getFragments();
            if (childFragments != null) {
                for (Fragment child : childFragments) {
                    if (child instanceof SupportFragment && !child.isHidden() && child.getUserVisibleHint()) {
                        ((SupportFragment) child).getVisibleDelegate().dispatchSupportVisible(visible);
                    }
                }
            }
        }
    }

    if (visible) {
        mSupportFragment.onSupportVisible();

        if (mIsFirstVisible) {
            mIsFirstVisible = false;
            mSupportFragment.onLazyInitView(mSaveInstanceState);
        }
    } else {
        mSupportFragment.onSupportInvisible();
    }
}
 
开发者ID:LonelyMushroom,项目名称:aarLibrary,代码行数:31,代码来源:VisibleDelegate.java

示例7: onCreate

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.zhihu_activity_main);

    SupportFragment firstFragment = findFragment(ZhihuFirstFragment.class);
    if (firstFragment == null) {
        mFragments[FIRST] = ZhihuFirstFragment.newInstance();
        mFragments[SECOND] = ZhihuSecondFragment.newInstance();
        mFragments[THIRD] = ZhihuThirdFragment.newInstance();
        mFragments[FOURTH] = ZhihuFourthFragment.newInstance();

        loadMultipleRootFragment(R.id.fl_container, FIRST,
                mFragments[FIRST],
                mFragments[SECOND],
                mFragments[THIRD],
                mFragments[FOURTH]);
    } else {
        // 这里库已经做了Fragment恢复,所有不需要额外的处理了, 不会出现重叠问题

        // 这里我们需要拿到mFragments的引用
        mFragments[FIRST] = firstFragment;
        mFragments[SECOND] = findFragment(ZhihuSecondFragment.class);
        mFragments[THIRD] = findFragment(ZhihuThirdFragment.class);
        mFragments[FOURTH] = findFragment(ZhihuFourthFragment.class);
    }

    initView();
}
 
开发者ID:YoKeyword,项目名称:Fragmentation,代码行数:30,代码来源:MainActivity.java

示例8: switchContentFragment

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
/**
 * 替换加载 内容Fragment
 *
 * @param fragment
 */
public void switchContentFragment(ContentFragment fragment) {
    SupportFragment contentFragment = findChildFragment(ContentFragment.class);
    if (contentFragment != null) {
        contentFragment.replaceFragment(fragment, false);
    }
}
 
开发者ID:YoKeyword,项目名称:Fragmentation,代码行数:12,代码来源:ShopFragment.java

示例9: onCreate

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_general);

    if (getTopFragment() == null) {
        String uri = getIntent().getStringExtra(Rabbit.KEY_ORIGIN_URI);
        SupportFragment fragment = (SupportFragment) Rabbit.from(this)
                .obtain(uri)
                .mergeExtras(getIntent().getExtras())
                .obtain();
        loadRootFragment(R.id.common_fragment_container, fragment);
    }
}
 
开发者ID:kyleduo,项目名称:Rabbits,代码行数:15,代码来源:GeneralActivity.java

示例10: onNewIntent

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    String uri = intent.getStringExtra(Rabbit.KEY_ORIGIN_URI);
    SupportFragment fragment = (SupportFragment) Rabbit.from(this)
            .obtain(uri)
            .mergeExtras(getIntent().getExtras())
            .obtain();

    if (getTopFragment() == null) {
        loadRootFragment(R.id.common_fragment_container, fragment);
    } else {
        start(fragment);
    }
}
 
开发者ID:kyleduo,项目名称:Rabbits,代码行数:16,代码来源:GeneralActivity.java

示例11: gotoMine

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
private void gotoMine() {
    MineFragment fragment = findFragment(MineFragment.class);
    if (fragment == null) {
        popTo(WxFragment.class, false, () -> start(MineFragment.newInstance()));
    } else {
        start(fragment, SupportFragment.SINGLETASK);
    }
    mNavigationView.setCheckedItem(R.id.menu_mine);
}
 
开发者ID:klisly,项目名称:fingerpoetry-android,代码行数:10,代码来源:HomeActivity.java

示例12: startNewFragment

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
public void startNewFragment(@NonNull SupportFragment supportFragment) {
    start(supportFragment);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:5,代码来源:BaseMVPCompatFragment.java

示例13: startNewFragmentWithPop

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
public void startNewFragmentWithPop(@NonNull SupportFragment supportFragment) {
    startWithPop(supportFragment);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:5,代码来源:BaseMVPCompatFragment.java

示例14: startNewFragmentForResult

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
@Override
public void startNewFragmentForResult(@NonNull SupportFragment supportFragment, int
        requestCode) {
    startForResult(supportFragment, requestCode);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:6,代码来源:BaseMVPCompatFragment.java

示例15: VisibleDelegate

import me.yokeyword.fragmentation.SupportFragment; //导入依赖的package包/类
public VisibleDelegate(SupportFragment fragment) {
    this.mSupportFragment = fragment;
}
 
开发者ID:LonelyMushroom,项目名称:aarLibrary,代码行数:4,代码来源:VisibleDelegate.java


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