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


Java IDrawerItem.getIdentifier方法代码示例

本文整理汇总了Java中com.mikepenz.materialdrawer.model.interfaces.IDrawerItem.getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:Java IDrawerItem.getIdentifier方法的具体用法?Java IDrawerItem.getIdentifier怎么用?Java IDrawerItem.getIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mikepenz.materialdrawer.model.interfaces.IDrawerItem的用法示例。


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

示例1: onDrawerItemClickListener

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
private boolean onDrawerItemClickListener(View view, int position, IDrawerItem drawerItem) {
    int id = (int) drawerItem.getIdentifier();
    switch (id) {
        case 1:
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.fragmentContainer, ItemsFragment.newInstance())
                    .commit();
            drawer.closeDrawer();
            break;
        case 2:
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.fragmentContainer, BottomSheetFragment.newInstance())
                    .commit();
            drawer.closeDrawer();
            break;
    }
    return true;
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:19,代码来源:MainActivity.java

示例2: populateProfile

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * Populate profile
 * @param department
 */
public void populateProfile( Department department){
    this.accountHeader.clear();
    for ( User user : department.getColaborators() ){
        addProfile( user );
    }

    this.currentDepartment = department;
    if( currentMenu != null && ((Fragment)currentMenu.getMainFrag()).isResumed() )
        this.currentMenu.getMainFrag().onDepartmentChange(department);
    else if(currentMenu != null ) {
        ( (Fragment)this.currentMenu.getMainFrag()).getArguments()
                .putString( Department.INSTANCE, currentDepartment.getKey() );
    }

    for( IDrawerItem item : this.departamentoContainer.getSubItems() ){
        if( item.getIdentifier() == department.getIdentifier() ){
            item.withSetSelected( true );
            this.departamentoContainer.withSetSelected( true );
        }
    }
}
 
开发者ID:tec-ustp,项目名称:SIIEScanner,代码行数:26,代码来源:MainBuildView.java

示例3: onCheckedChanged

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(IDrawerItem drawerItem, CompoundButton buttonView, boolean isChecked) {

    switch ((int) drawerItem.getIdentifier()) {
        case 1:
            addSubscription(NetworkWrapper.get()
                    .setShopStatus(isChecked ? 1 : 0)
                    .compose(bindToLifecycle())
                    .subscribe(message -> {
                        MainActivity.this.shopStatus.withName("营业状态:" + (isChecked ? "开" : "关"));
                        AppManager.getShopInfo().setStatus(isChecked ? 1 : 0);
                        result.updateItem(MainActivity.this.shopStatus);
                        setIntentService(isChecked);
                    }, throwable -> Snackbar.make(binding.pager, throwable.getMessage(), Snackbar.LENGTH_SHORT).show()));
            break;
    }
}
 
开发者ID:RunziiMo,项目名称:grooo,代码行数:18,代码来源:MainActivity.java

示例4: onItemClick

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
    int id = (int) drawerItem.getIdentifier();
    switch (id) {
        case ID_LIVE:
            playLive();
            break;
        case ID_HISTORY:
            break;
        case ID_SETTING:
            launchSetting();
            break;
        default:
            History history = (History) drawerItem.getTag();
            switch (history.getType()) {
                case DIRECTORY:
                    break;
                case FILE:
                    playHistory(history);
                    break;
            }
            break;
    }

    return false;
}
 
开发者ID:xdtianyu,项目名称:LanCamera,代码行数:27,代码来源:MainActivity.java

示例5: onItemClick

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * call this method to trigger the onItemClick on the MiniDrawer
 *
 * @param selectedDrawerItem
 * @return
 */
public boolean onItemClick(IDrawerItem selectedDrawerItem) {
    //We only need to clear if the new item is selectable
    if (selectedDrawerItem.isSelectable()) {
        //crossfade if we are cross faded
        if (mCrossFader != null) {
            if (mCrossFader.isCrossfaded()) {
                mCrossFader.crossfade();
            }
        }

        //get the identifier
        int identifier = selectedDrawerItem.getIdentifier();

        //update everything
        setSelection(identifier);

        return false;
    } else {
        return true;
    }
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:28,代码来源:MiniDrawer.java

示例6: onCheckedChanged

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(IDrawerItem drawerItem, CompoundButton buttonView, boolean isChecked) {

    int id = (int) drawerItem.getIdentifier();
    switch (id) {

        case ID_TOGGLE_DONE:
            toggleDoneTab();
            break;

        case ID_TOGGLE_BIG_TEXT:
            if (isChecked) {
                HorizontalAdapter.setBigText(true);
                mTinyDB.putBoolean(getString(R.string.big_text_pref), true);
                DatabaseHelper.notifyAllLists();

            } else {
                HorizontalAdapter.setBigText(false);
                mTinyDB.putBoolean(getString(R.string.big_text_pref), false);
                DatabaseHelper.notifyAllLists();
            }
            break;

        case ID_DARK_THEME:
            changeDarkTheme(isChecked);
            break;
    }

}
 
开发者ID:IdeaTrackerPlus,项目名称:IdeaTrackerPlus,代码行数:30,代码来源:MainActivity.java

示例7: onNavigationSelected

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
private void onNavigationSelected(IDrawerItem drawerItem) {
    switch (drawerItem.getIdentifier()) {
        case 1001:
            navigateToBookShelfFragment();
            break;
        case 1101:
            mNavigation.navigateToSettingsActivity(MainActivity.this);
            break;
        default:
            throw new IllegalArgumentException("Unknown NavigationDrawerItem position.");
    }
}
 
开发者ID:crysehillmes,项目名称:smoothnovelreader,代码行数:13,代码来源:MainActivity.java

示例8: getCurrentSelection

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * get the current selected item identifier
 *
 * @return
 */
public long getCurrentSelection() {
    IDrawerItem drawerItem = mDrawerBuilder.getDrawerItem(getCurrentSelectedPosition());
    if (drawerItem != null) {
        return drawerItem.getIdentifier();
    }
    return -1;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:13,代码来源:Drawer.java

示例9: getDrawerItem

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * gets the drawerItem with the specific identifier from a drawerItem list
 *
 * @param drawerItems
 * @param identifier
 * @return
 */
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, long identifier) {
    if (identifier >= 0) {
        for (IDrawerItem drawerItem : drawerItems) {
            if (drawerItem.getIdentifier() == identifier) {
                return drawerItem;
            }
        }
    }
    return null;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:18,代码来源:DrawerUtils.java

示例10: setSelection

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * set the selection of the MiniDrawer
 *
 * @param identifier the identifier of the item which should be selected (-1 for none)
 */
public void setSelection(long identifier) {
    int count = mAdapter.getItemCount();
    for (int i = 0; i < count; i++) {
        IDrawerItem item = mAdapter.getItem(i);
        if (item.getIdentifier() == identifier && !item.isSelected()) {
            mAdapter.deselect();
            mAdapter.select(i);
        }
    }
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:16,代码来源:MiniDrawer.java

示例11: updateItem

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * update a MiniDrawerItem (after updating the main Drawer) via its identifier
 *
 * @param identifier the identifier of the item which was updated
 */
public void updateItem(long identifier) {
    if (mDrawer != null && mAdapter != null && mAdapter.getAdapterItems() != null && identifier != -1) {
        IDrawerItem drawerItem = DrawerUtils.getDrawerItem(getDrawerItems(), identifier);
        for (int i = 0; i < mAdapter.getAdapterItems().size(); i++) {
            if (mAdapter.getAdapterItems().get(i).getIdentifier() == drawerItem.getIdentifier()) {
                IDrawerItem miniDrawerItem = generateMiniDrawerItem(drawerItem);
                if (miniDrawerItem != null) {
                    mAdapter.set(i, miniDrawerItem);
                }
            }
        }
    }
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:19,代码来源:MiniDrawer.java

示例12: getItemId

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
@Override
public long getItemId(int position) {
    IDrawerItem item = getItem(position);
    if (item != null && item.getIdentifier() != -1) {
        return item.getIdentifier();
    }
    return super.getItemId(position);
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:9,代码来源:BaseDrawerAdapter.java

示例13: getCurrentSelection

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * get the current selected item identifier
 *
 * @return
 */
public int getCurrentSelection() {
    IDrawerItem drawerItem = mDrawerBuilder.getDrawerItem(mDrawerBuilder.mCurrentSelection);
    if (drawerItem != null) {
        return drawerItem.getIdentifier();
    }
    return -1;
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:13,代码来源:Drawer.java

示例14: getDrawerItem

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * gets the drawerItem with the specific identifier from a drawerItem list
 *
 * @param drawerItems
 * @param identifier
 * @return
 */
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, int identifier) {
    if (identifier >= 0) {
        for (IDrawerItem drawerItem : drawerItems) {
            if (drawerItem.getIdentifier() == identifier) {
                return drawerItem;
            }
        }
    }
    return null;
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:18,代码来源:DrawerUtils.java

示例15: updateItem

import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; //导入方法依赖的package包/类
/**
 * update a MiniDrawerItem (after updating the main Drawer) via its identifier
 *
 * @param identifier the identifier of the item which was updated
 */
public void updateItem(int identifier) {
    if (mDrawer != null && mDrawerAdapter != null && mDrawerAdapter.getDrawerItems() != null && identifier != -1) {
        IDrawerItem drawerItem = DrawerUtils.getDrawerItem(getDrawerItems(), identifier);
        for (int i = 0; i < mDrawerAdapter.getDrawerItems().size(); i++) {
            if (mDrawerAdapter.getDrawerItems().get(i).getIdentifier() == drawerItem.getIdentifier()) {
                IDrawerItem miniDrawerItem = generateMiniDrawerItem(drawerItem);
                if (miniDrawerItem != null) {
                    mDrawerAdapter.setDrawerItem(i, miniDrawerItem);
                }
            }
        }
    }
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:19,代码来源:MiniDrawer.java


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