當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。