本文整理匯總了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();
}
}