當前位置: 首頁>>代碼示例>>Java>>正文


Java IProfile類代碼示例

本文整理匯總了Java中com.mikepenz.materialdrawer.model.interfaces.IProfile的典型用法代碼示例。如果您正苦於以下問題:Java IProfile類的具體用法?Java IProfile怎麽用?Java IProfile使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IProfile類屬於com.mikepenz.materialdrawer.model.interfaces包,在下文中一共展示了IProfile類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selectFavoriteProject

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
private void selectFavoriteProject() {

        if (!mNoProject) {
            mSelectedProfileIndex = getIndexOfFavorite();
            IProfile activeProfile = mProfiles.get(mSelectedProfileIndex);
            String activeProfileName = activeProfile.getName().getText();

            ActionBar bar;
            if ((bar = getSupportActionBar()) != null) {
                bar.setTitle(activeProfileName);
            }

            DataEntry.setTableName(activeProfileName);

            switchToProjectColors();
        }
    }
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:18,代碼來源:MainActivity.java

示例2: switchToProject

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
private void switchToProject(String projectName) {

        mSelectedProfileIndex = getIndexOfProject(projectName);
        IProfile profileToSelect = mProfiles.get(mSelectedProfileIndex);
        header.setActiveProfile(profileToSelect);

        mToolbar.setTitle(projectName);
        mDbHelper.switchTable(projectName);
        DatabaseHelper.notifyAllLists();
        displayIdeasCount();
        switchToProjectColors();

        //favorite star
        refreshStar();

        //search mode
        disableSearchMode();
    }
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:19,代碼來源:MainActivity.java

示例3: switchToExistingProject

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * After project deletion, selects another project
 *
 * @param index the index of the deleted project
 */
private void switchToExistingProject(int index) {
    index -= 1;
    boolean inBounds = (index >= 0) && (index < mProfiles.size());

    if (!mNoProject) {

        if (inBounds) mSelectedProfileIndex = index;
        else mSelectedProfileIndex = 0;

        IProfile profileToSelect = mProfiles.get(mSelectedProfileIndex);
        String tableToSelect = profileToSelect.getName().getText();
        header.setActiveProfile(profileToSelect);
        mToolbar.setTitle(tableToSelect);
        mDbHelper.switchTable(tableToSelect);
        displayIdeasCount();

        switchToProjectColors();
    }

}
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:26,代碼來源:MainActivity.java

示例4: handleSelectionView

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * a small helper to handle the selectionView
 *
 * @param on
 */
private void handleSelectionView(IProfile profile, boolean on) {
    if (on) {
        if (Build.VERSION.SDK_INT >= 21) {
            ((FrameLayout) mAccountHeaderContainer).setForeground(UIUtils.getCompatDrawable(mAccountHeaderContainer.getContext(), mAccountHeaderTextSectionBackgroundResource));
            mAccountHeaderContainer.setOnClickListener(onSelectionClickListener);
            mAccountHeaderContainer.setTag(R.id.material_drawer_profile_header, profile);
        } else {
            mAccountHeaderTextSection.setBackgroundResource(mAccountHeaderTextSectionBackgroundResource);
            mAccountHeaderTextSection.setOnClickListener(onSelectionClickListener);
            mAccountHeaderTextSection.setTag(R.id.material_drawer_profile_header, profile);
        }
    } else {
        if (Build.VERSION.SDK_INT >= 21) {
            ((FrameLayout) mAccountHeaderContainer).setForeground(null);
            mAccountHeaderContainer.setOnClickListener(null);
        } else {
            UIUtils.setBackground(mAccountHeaderTextSection, null);
            mAccountHeaderTextSection.setOnClickListener(null);
        }
    }
}
 
開發者ID:LeMinhAn,項目名稱:MaterialDrawer,代碼行數:27,代碼來源:AccountHeaderBuilder.java

示例5: buildDrawerSelectionList

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * helper method to build and set the drawer selection list
 */
protected void buildDrawerSelectionList() {
    int selectedPosition = -1;
    int position = 0;
    ArrayList<IDrawerItem> profileDrawerItems = new ArrayList<>();
    if (mProfiles != null) {
        for (IProfile profile : mProfiles) {
            if (profile == mCurrentProfile) {
                if (mCurrentHiddenInList) {
                    continue;
                } else {
                    selectedPosition = mDrawer.mDrawerBuilder.getItemAdapter().getGlobalPosition(position);
                }
            }
            if (profile instanceof IDrawerItem) {
                ((IDrawerItem) profile).withSetSelected(false);
                profileDrawerItems.add((IDrawerItem) profile);
            }
            position = position + 1;
        }
    }
    mDrawer.switchDrawerContent(onDrawerItemClickListener, onDrawerItemLongClickListener, profileDrawerItems, selectedPosition);
}
 
開發者ID:LeMinhAn,項目名稱:MaterialDrawer,代碼行數:26,代碼來源:AccountHeaderBuilder.java

示例6: onProfileClick

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * call this method to trigger the onProfileClick on the MiniDrawer
 */
public void onProfileClick() {
    //crossfade if we are cross faded
    if (mCrossFader != null) {
        if (mCrossFader.isCrossfaded()) {
            mCrossFader.crossfade();
        }
    }

    //update the current profile
    if (mAccountHeader != null) {
        IProfile profile = mAccountHeader.getActiveProfile();
        if (profile instanceof IDrawerItem) {
            mAdapter.set(0, generateMiniDrawerItem((IDrawerItem) profile));
        }
    }
}
 
開發者ID:LeMinhAn,項目名稱:MaterialDrawer,代碼行數:20,代碼來源:MiniDrawer.java

示例7: buildDrawerSelectionList

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * helper method to build and set the drawer selection list
 */
protected void buildDrawerSelectionList() {
    int selectedPosition = -1;
    int position = 0;
    ArrayList<IDrawerItem> profileDrawerItems = new ArrayList<>();
    if (mProfiles != null) {
        for (IProfile profile : mProfiles) {
            if (profile == mCurrentProfile) {
                if (mCurrentHiddenInList) {
                    continue;
                } else {
                    selectedPosition = position + mDrawer.getAdapter().getHeaderOffset();
                }
            }
            if (profile instanceof IDrawerItem) {
                ((IDrawerItem) profile).withSetSelected(false);
                profileDrawerItems.add((IDrawerItem) profile);
            }
            position = position + 1;
        }
    }
    mDrawer.switchDrawerContent(onDrawerItemClickListener, onDrawerItemLongClickListener, profileDrawerItems, selectedPosition);
}
 
開發者ID:FreedomZZQ,項目名稱:YouJoin-Android,代碼行數:26,代碼來源:AccountHeaderBuilder.java

示例8: onProfileClick

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * call this method to trigger the onProfileClick on the MiniDrawer
 */
public void onProfileClick() {
    //crossfade if we are cross faded
    if (mCrossFader != null) {
        if (mCrossFader.isCrossfaded()) {
            mCrossFader.crossfade();
        }
    }

    //update the current profile
    if (mAccountHeader != null) {
        IProfile profile = mAccountHeader.getActiveProfile();
        if (profile instanceof IDrawerItem) {
            mDrawerAdapter.setDrawerItem(0, generateMiniDrawerItem((IDrawerItem) profile));
        }
    }
}
 
開發者ID:FreedomZZQ,項目名稱:YouJoin-Android,代碼行數:20,代碼來源:MiniDrawer.java

示例9: onProfileClick

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
protected void onProfileClick(View v, boolean current) {
    final IProfile profile = (IProfile) v.getTag(R.id.material_drawer_profile_header);
    switchProfiles(profile);

    //reset the drawer content
    resetDrawerContent(v.getContext());

    boolean consumed = false;
    if (mOnAccountHeaderListener != null) {
        consumed = mOnAccountHeaderListener.onProfileChanged(v, profile, current);
    }

    if (!consumed) {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (mDrawer != null) {
                    mDrawer.closeDrawer();
                }
            }
        }, 200);
    }
}
 
開發者ID:amatkivskiy,項目名稱:MaterialDrawer-Xamarin,代碼行數:24,代碼來源:AccountHeaderBuilder.java

示例10: getLoggedInProfileItem

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
IProfile[] getLoggedInProfileItem() {
    if (mLoggedInProfiles == null) {
        mLoggedInProfiles = new IProfile[2];
        User currentUser = Select.from(User.class).first();
        ProfileDrawerItem profileDrawerItem = new ProfileDrawerItem().withIdentifier(LOGGED_IN_PROFILE_ITEM)
                                                                     .withIcon(TextDrawable.builder()
                                                                                           .buildRound(String.valueOf(currentUser.getUserName().charAt(0)),
                                                                                                       mResources.getColor(R.color.colorPrimaryDark)))
                                                                     .withName(currentUser.getUserName());
        ProfileSettingDrawerItem logoutDrawerItem = new ProfileSettingDrawerItem().withIdentifier(LOG_OUT_PROFILE_ITEM)
                                                                                  .withName("Logout")
                                                                                  .withDescription("Logout of current account")
                                                                                  .withIcon(mResources.getDrawable(R.drawable.ic_close));

        mLoggedInProfiles[0] = profileDrawerItem;
        mLoggedInProfiles[1] = logoutDrawerItem;
    }

    return mLoggedInProfiles;
}
 
開發者ID:dinosaurwithakatana,項目名稱:hacker-news-android,代碼行數:21,代碼來源:MainViewModel.java

示例11: genProfile

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
private IProfile genProfile(Patient p) {
    final int schedules = DB.schedules().findAll(p).size();
    String fakeMail;
    if (schedules > 0) {
        fakeMail = home.getString(R.string.active_schedules_number, schedules);
    } else {
        fakeMail = home.getString(R.string.active_schedules_none);
    }

    return new ProfileDrawerItem()
            .withIdentifier(p.getId().intValue())
            .withName(p.getName())
            .withEmail(fakeMail)
            .withIcon(AvatarMgr.res(p.getAvatar()))
            .withNameShown(true);
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:17,代碼來源:LeftDrawerMgr.java

示例12: resetColorsDialog

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
private void resetColorsDialog() {
    new LovelyStandardDialog(this, mDarkTheme ? android.support.v7.appcompat.R.style.Theme_AppCompat_Dialog_Alert : 0)
            .setTopColor(mPrimaryColor)
            .setButtonsColorRes(R.color.md_pink_a200)
            .setIcon(R.drawable.ic_drop)
            .setTitle(R.string.reset_color_prefs)
            .setMessage(R.string.reset_color_pref_message)
            .setPositiveButton(android.R.string.yes, new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    mPrimaryColor = defaultPrimaryColor;
                    mSecondaryColor = defaultSecondaryColor;
                    mTextColor = defaultTextColor;
                    saveProjectColors();
                    updateColors();

                    //change project icon
                    Drawable disk = ContextCompat.getDrawable(getApplicationContext(), R.drawable.disk);
                    disk.setColorFilter(mPrimaryColor, PorterDuff.Mode.SRC_ATOP);
                    IProfile p = header.getActiveProfile();
                    p.withIcon(disk);
                    header.updateProfile(p);
                }
            })
            .setNegativeButton(android.R.string.no, null)
            .show();
}
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:28,代碼來源:MainActivity.java

示例13: buildHeader

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
private void buildHeader(Bundle savedInstanceState) {
    // Create the AccountHeader
    headerResult = new AccountHeaderBuilder()
            .withActivity(this)
            .withTranslucentStatusBar(true)
            .withCompactStyle(false)
            .withHeaderBackground(R.drawable.header)
            .withCurrentProfileHiddenInList(true)
            .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() {
                @Override
                public boolean onProfileChanged(View view, IProfile profile, boolean current) {
                    //sample usage of the onProfileChanged listener
                    //if the clicked item has the identifier 1 add a new profile ;)
                    if (profile instanceof IDrawerItem && profile.getIdentifier() == PROFILE_ADD_ACCOUNT) {
                        showLoginActivity();
                    } else if (profile instanceof IDrawerItem && profile.getIdentifier() == PROFILE_LOGOUT) {
                        IProfile activeProfile = headerResult.getActiveProfile();
                        if (activeProfile != null) {
                            if (activeProfile.getName() != null && activeProfile.getEmail() != null) {
                                ParseUser.logOut();
                            }
                            if (miniResult != null)
                                miniResult.createItems();
                        }
                    } else if (profile instanceof IDrawerItem && profile.getIdentifier() == PROFILE_VIEW) {
                        showProfileView();
                    } else if (!current) {
                        switchUser();
                    } else {
                        Croperino.prepareGallery(MainActivity.this);
                    }

                    //false if you have not consumed the event and it should close the drawer
                    return false;
                }
            })
            .withSavedInstance(savedInstanceState)
            .build();
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:40,代碼來源:MainActivity.java

示例14: updateUserPhoto

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
public void updateUserPhoto ( User user, String photoData ) {
    for ( IProfile iProfile : this.accountHeader.getProfiles() ){
        if ( iProfile.getIdentifier() == user.getIdentifier() ){
            iProfile.withIcon( user.createBitMap( this.main ) );
            break;
        }
    }
}
 
開發者ID:tec-ustp,項目名稱:SIIEScanner,代碼行數:9,代碼來源:MainBuildView.java

示例15: onClientEnter

import com.mikepenz.materialdrawer.model.interfaces.IProfile; //導入依賴的package包/類
/**
 * Quando entrar um novo perfil
 * @param department
 * @param user
 */
public void onClientEnter( Department department, User user ) {
    //Quando o department atual nao tiver valor definido
    if( currentDepartment == null )
        currentDepartment = department;

    // Quando for esse currentDepartment que esta selecionado entao adicioanar o utilizador na lista header
    if( department.equals( currentDepartment ) ){
        for( IProfile ip : accountHeader.getProfiles() ){
            if( ip.getIdentifier() == user.getIdentifier() ) return;
        }
        addProfile( user );
    }
    this.currentMenu.getMainFrag().onClientEnter(department, user);
}
 
開發者ID:tec-ustp,項目名稱:SIIEScanner,代碼行數:20,代碼來源:MainBuildView.java


注:本文中的com.mikepenz.materialdrawer.model.interfaces.IProfile類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。