本文整理汇总了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);
}
示例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;
}
示例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());
}
示例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;
}
示例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();
}
}