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


Java NavigationDrawerListItemTopFragment类代码示例

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


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

示例1: selectTopItem

import com.blunderer.materialdesignlibrary.models.NavigationDrawerListItemTopFragment; //导入依赖的package包/类
private void selectTopItem(int fragmentPosition,
                           boolean isSavedInstanceState,
                           NavigationDrawerListItemTopFragment itemFragment) {
    if (!isSavedInstanceState) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.fragment_container, itemFragment.getFragment())
                .commit();
    } else {
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, itemFragment.getFragment())
                .commit();
    }
    mCurrentItem = itemFragment;
    mCurrentItemPosition = (isNavigationDrawerAccountsHandlerEmpty() ? 0 : 1) +
            fragmentPosition;

    mTopListView.setItemChecked(mCurrentItemPosition, true);
    mListTopAdapter.setNavigationDrawerSelectedItemPosition(fragmentPosition);
    replaceTitle(mCurrentItem);
}
 
开发者ID:andreister,项目名称:hasty,代码行数:21,代码来源:NavigationDrawerActivity.java

示例2: addItem

import com.blunderer.materialdesignlibrary.models.NavigationDrawerListItemTopFragment; //导入依赖的package包/类
public NavigationDrawerTopHandler addItem(int titleResource,
                                          int iconResource,
                                          int selectedIconResource,
                                          Fragment fragment,
                                          int titleStyle,
                                          int backgroundStyle) {
    NavigationDrawerListItemTopFragment item = new NavigationDrawerListItemTopFragment();
    item.setTitle(mContext, titleResource);
    item.setIcon(mContext, iconResource);
    item.setSelectedIcon(mContext, selectedIconResource);
    item.setFragment(fragment);
    item.setTitleStyle(titleStyle);
    item.setBackgroundStyle(backgroundStyle);
    mItems.add(item);
    return this;
}
 
开发者ID:andreister,项目名称:hasty,代码行数:17,代码来源:NavigationDrawerTopHandler.java

示例3: replaceTitle

import com.blunderer.materialdesignlibrary.models.NavigationDrawerListItemTopFragment; //导入依赖的package包/类
private void replaceTitle(NavigationDrawerListItemTopFragment itemFragment) {
    if (itemFragment.getFragment() instanceof ViewPagerFragment) {
        ViewPagerFragment viewPagerFragment = (ViewPagerFragment) itemFragment.getFragment();
        if (viewPagerFragment.replaceActionBarTitleByViewPagerPageTitle()) {
            CharSequence title = viewPagerFragment.getTitle();
            if (title != null) {
                replaceTitle(title);
                return;
            }
        }
    }
    replaceTitle(itemFragment.getTitle());
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:14,代码来源:NavigationDrawerActivity.java

示例4: addItem

import com.blunderer.materialdesignlibrary.models.NavigationDrawerListItemTopFragment; //导入依赖的package包/类
public NavigationDrawerTopHandler addItem(int titleResource, Fragment fragment) {
    NavigationDrawerListItemTopFragment item = new NavigationDrawerListItemTopFragment();
    item.setTitle(mContext, titleResource);
    item.setFragment(fragment);
    mItems.add(item);
    return this;
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:8,代码来源:NavigationDrawerTopHandler.java

示例5: selectDefaultItemPosition

import com.blunderer.materialdesignlibrary.models.NavigationDrawerListItemTopFragment; //导入依赖的package包/类
private void selectDefaultItemPosition(int fragmentPosition,
                                       boolean isSavedInstanceState) {
    if (mNavigationDrawerItemsTop.size() <= 0) return;

    if (fragmentPosition < 0 || fragmentPosition >= mNavigationDrawerItemsTop.size()) {
        fragmentPosition = 0;
    }

    ListItem item = mNavigationDrawerItemsTop.get(fragmentPosition);
    if (item instanceof NavigationDrawerListItemTopFragment) {
        selectTopItem(fragmentPosition, isSavedInstanceState,
                (NavigationDrawerListItemTopFragment) item);
    } else {
        for (int i = 0; i < mNavigationDrawerItemsTop.size(); ++i) {
            if (mNavigationDrawerItemsTop.get(i) instanceof
                    NavigationDrawerListItemTopFragment) {
                selectTopItem(i, isSavedInstanceState,
                        (NavigationDrawerListItemTopFragment) mNavigationDrawerItemsTop.get(i));
                break;
            }
        }
    }

    if (!isNavigationDrawerAccountsHandlerEmpty()) {
        mAccountsLayout.notifyListTopItemSelectedChanged();
    }
}
 
开发者ID:andreister,项目名称:hasty,代码行数:28,代码来源:NavigationDrawerActivity.java


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