protected void buildProfiles(){
  mCurrentProfileView.setVisibility(View.INVISIBLE);
  mAccountHeaderTextSection.setVisibility(View.INVISIBLE);
  mAccountSwitcherArrow.setVisibility(View.GONE);
  mProfileFirstView.setVisibility(View.GONE);
  mProfileFirstView.setOnClickListener(null);
  mProfileSecondView.setVisibility(View.GONE);
  mProfileSecondView.setOnClickListener(null);
  mProfileThirdView.setVisibility(View.GONE);
  mProfileThirdView.setOnClickListener(null);
  mCurrentProfileName.setText("");
  mCurrentProfileEmail.setText("");
  if (!mCompactStyle) {
    mAccountHeaderTextSection.setPadding(0,0,(int)UIUtils.convertDpToPixel(56,mAccountHeaderTextSection.getContext()),0);
  }
  handleSelectionView(mCurrentProfile,true);
  if (mCurrentProfile != null) {
    if ((mProfileImagesVisible || mOnlyMainProfileImageVisible) && !mOnlySmallProfileImagesVisible) {
      setImageOrPlaceholder(mCurrentProfileView,mCurrentProfile.getIcon());
      if (mProfileImagesClickable) {
        mCurrentProfileView.setOnClickListener(onCurrentProfileClickListener);
        mCurrentProfileView.setOnLongClickListener(onCurrentProfileLongClickListener);
        mCurrentProfileView.disableTouchFeedback(false);
      }
 else {
        mCurrentProfileView.disableTouchFeedback(true);
      }
      mCurrentProfileView.setVisibility(View.VISIBLE);
      mCurrentProfileView.invalidate();
    }
 else     if (mCompactStyle) {
      mCurrentProfileView.setVisibility(View.GONE);
    }
    mAccountHeaderTextSection.setVisibility(View.VISIBLE);
    handleSelectionView(mCurrentProfile,true);
    mAccountSwitcherArrow.setVisibility(View.VISIBLE);
    mCurrentProfileView.setTag(R.id.material_drawer_profile_header,mCurrentProfile);
    StringHolder.applyTo(mCurrentProfile.getName(),mCurrentProfileName);
    StringHolder.applyTo(mCurrentProfile.getEmail(),mCurrentProfileEmail);
    if (mProfileFirst != null && mProfileImagesVisible && !mOnlyMainProfileImageVisible) {
      setImageOrPlaceholder(mProfileFirstView,mProfileFirst.getIcon());
      mProfileFirstView.setTag(R.id.material_drawer_profile_header,mProfileFirst);
      if (mProfileImagesClickable) {
        mProfileFirstView.setOnClickListener(onProfileClickListener);
        mProfileFirstView.setOnLongClickListener(onProfileLongClickListener);
        mProfileFirstView.disableTouchFeedback(false);
      }
 else {
        mProfileFirstView.disableTouchFeedback(true);
      }
      mProfileFirstView.setVisibility(View.VISIBLE);
      mProfileFirstView.invalidate();
    }
    if (mProfileSecond != null && mProfileImagesVisible && !mOnlyMainProfileImageVisible) {
      setImageOrPlaceholder(mProfileSecondView,mProfileSecond.getIcon());
      mProfileSecondView.setTag(R.id.material_drawer_profile_header,mProfileSecond);
      if (mProfileImagesClickable) {
        mProfileSecondView.setOnClickListener(onProfileClickListener);
        mProfileSecondView.setOnLongClickListener(onProfileLongClickListener);
        mProfileSecondView.disableTouchFeedback(false);
      }
 else {
        mProfileSecondView.disableTouchFeedback(true);
      }
      mProfileSecondView.setVisibility(View.VISIBLE);
      mProfileSecondView.invalidate();
    }
    if (mProfileThird != null && mThreeSmallProfileImages && mProfileImagesVisible && !mOnlyMainProfileImageVisible) {
      setImageOrPlaceholder(mProfileThirdView,mProfileThird.getIcon());
      mProfileThirdView.setTag(R.id.material_drawer_profile_header,mProfileThird);
      if (mProfileImagesClickable) {
        mProfileThirdView.setOnClickListener(onProfileClickListener);
        mProfileThirdView.setOnLongClickListener(onProfileLongClickListener);
        mProfileThirdView.disableTouchFeedback(false);
      }
 else {
        mProfileThirdView.disableTouchFeedback(true);
      }
      mProfileThirdView.setVisibility(View.VISIBLE);
      mProfileThirdView.invalidate();
    }
  }
 else   if (mProfiles != null && mProfiles.size() > 0) {
    IProfile profile=mProfiles.get(0);
    mAccountHeaderTextSection.setTag(R.id.material_drawer_profile_header,profile);
    mAccountHeaderTextSection.setVisibility(View.VISIBLE);
    handleSelectionView(mCurrentProfile,true);
    mAccountSwitcherArrow.setVisibility(View.VISIBLE);
    if (mCurrentProfile != null) {
      StringHolder.applyTo(mCurrentProfile.getName(),mCurrentProfileName);
      StringHolder.applyTo(mCurrentProfile.getEmail(),mCurrentProfileEmail);
    }
  }
  if (!mSelectionFirstLineShown) {
    mCurrentProfileName.setVisibility(View.GONE);
  }
  if (!TextUtils.isEmpty(mSelectionFirstLine)) {
    mCurrentProfileName.setText(mSelectionFirstLine);
    mAccountHeaderTextSection.setVisibility(View.VISIBLE);
  }
  if (!mSelectionSecondLineShown) {
    mCurrentProfileEmail.setVisibility(View.GONE);
  }
  if (!TextUtils.isEmpty(mSelectionSecondLine)) {
    mCurrentProfileEmail.setText(mSelectionSecondLine);
    mAccountHeaderTextSection.setVisibility(View.VISIBLE);
  }
  if (!mSelectionListEnabled || !mSelectionListEnabledForSingleProfile && mProfileFirst == null && (mProfiles == null || mProfiles.size() == 1)) {
    mAccountSwitcherArrow.setVisibility(View.GONE);
    handleSelectionView(null,false);
    if (!mCompactStyle) {
      mAccountHeaderTextSection.setPadding(0,0,(int)UIUtils.convertDpToPixel(16,mAccountHeaderTextSection.getContext()),0);
    }
  }
  if (mOnAccountHeaderSelectionViewClickListener != null) {
    handleSelectionView(mCurrentProfile,true);
  }
}

protected void buildProfiles ( ) { mCurrentProfileView . setVisibility ( View . INVISIBLE ) ; mAccountHeaderTextSection . setVisibility ( View . INVISIBLE ) ; mAccountSwitcherArrow . setVisibility ( View . GONE ) ; mProfileFirstView . setVisibility ( View . GONE ) ; mProfileFirstView . setOnClickListener ( null ) ; mProfileSecondView . setVisibility ( View . GONE ) ; mProfileSecondView . setOnClickListener ( null ) ; mProfileThirdView . setVisibility ( View . GONE ) ; mProfileThirdView . setOnClickListener ( null ) ; mCurrentProfileName . setText ( "" ) ; mCurrentProfileEmail . setText ( "" ) ; if ( ! mCompactStyle ) { mAccountHeaderTextSection . setPadding ( 0 , 0 , ( int ) UIUtils . convertDpToPixel ( 56 , mAccountHeaderTextSection . getContext ( ) ) , 0 ) ; } handleSelectionView ( mCurrentProfile , true ) ; if ( mCurrentProfile != null ) { if ( ( mProfileImagesVisible || mOnlyMainProfileImageVisible ) && ! mOnlySmallProfileImagesVisible ) { setImageOrPlaceholder ( mCurrentProfileView , mCurrentProfile . getIcon ( ) ) ; if ( mProfileImagesClickable ) { mCurrentProfileView . setOnClickListener ( onCurrentProfileClickListener ) ; mCurrentProfileView . setOnLongClickListener ( onCurrentProfileLongClickListener ) ; mCurrentProfileView . disableTouchFeedback ( false ) ; } else { mCurrentProfileView . disableTouchFeedback ( true ) ; } mCurrentProfileView . setVisibility ( View . VISIBLE ) ; mCurrentProfileView . invalidate ( ) ; } else if ( mCompactStyle ) { mCurrentProfileView . setVisibility ( View . GONE ) ; } mAccountHeaderTextSection . setVisibility ( View . VISIBLE ) ; handleSelectionView ( mCurrentProfile , true ) ; mAccountSwitcherArrow . setVisibility ( View . VISIBLE ) ; mCurrentProfileView . setTag ( R . id . material_drawer_profile_header , mCurrentProfile ) ; StringHolder . applyTo ( mCurrentProfile . getName ( ) , mCurrentProfileName ) ; StringHolder . applyTo ( mCurrentProfile . getEmail ( ) , mCurrentProfileEmail ) ; if ( mProfileFirst != null && mProfileImagesVisible && ! mOnlyMainProfileImageVisible ) { setImageOrPlaceholder ( mProfileFirstView , mProfileFirst . getIcon ( ) ) ; mProfileFirstView . setTag ( R . id . material_drawer_profile_header , mProfileFirst ) ; if ( mProfileImagesClickable ) { mProfileFirstView . setOnClickListener ( onProfileClickListener ) ; mProfileFirstView . setOnLongClickListener ( onProfileLongClickListener ) ; mProfileFirstView . disableTouchFeedback ( false ) ; } else { mProfileFirstView . disableTouchFeedback ( true ) ; } mProfileFirstView . setVisibility ( View . VISIBLE ) ; mProfileFirstView . invalidate ( ) ; } if ( mProfileSecond != null && mProfileImagesVisible && ! mOnlyMainProfileImageVisible ) { setImageOrPlaceholder ( mProfileSecondView , mProfileSecond . getIcon ( ) ) ; mProfileSecondView . setTag ( R . id . material_drawer_profile_header , mProfileSecond ) ; if ( mProfileImagesClickable ) { mProfileSecondView . setOnClickListener ( onProfileClickListener ) ; mProfileSecondView . setOnLongClickListener ( onProfileLongClickListener ) ; mProfileSecondView . disableTouchFeedback ( false ) ; } else { mProfileSecondView . disableTouchFeedback ( true ) ; } mProfileSecondView . setVisibility ( View . VISIBLE ) ; mProfileSecondView . invalidate ( ) ; } if ( mProfileThird != null && mThreeSmallProfileImages && mProfileImagesVisible && ! mOnlyMainProfileImageVisible ) { setImageOrPlaceholder ( mProfileThirdView , mProfileThird . getIcon ( ) ) ; mProfileThirdView . setTag ( R . id . material_drawer_profile_header , mProfileThird ) ; if ( mProfileImagesClickable ) { mProfileThirdView . setOnClickListener ( onProfileClickListener ) ; mProfileThirdView . setOnLongClickListener ( onProfileLongClickListener ) ; mProfileThirdView . disableTouchFeedback ( false ) ; } else { mProfileThirdView . disableTouchFeedback ( true ) ; } mProfileThirdView . setVisibility ( View . VISIBLE ) ; mProfileThirdView . invalidate ( ) ; } } else if ( mProfiles != null && mProfiles . size ( ) > 0 ) { IProfile profile = mProfiles . get ( 0 ) ; mAccountHeaderTextSection . setTag ( R . id . material_drawer_profile_header , profile ) ; mAccountHeaderTextSection . setVisibility ( View . VISIBLE ) ; handleSelectionView ( mCurrentProfile , true ) ; mAccountSwitcherArrow . setVisibility ( View . VISIBLE ) ; if ( mCurrentProfile != null ) { StringHolder . applyTo ( mCurrentProfile . getName ( ) , mCurrentProfileName ) ; StringHolder . applyTo ( mCurrentProfile . getEmail ( ) , mCurrentProfileEmail ) ; } } if ( ! mSelectionFirstLineShown ) { mCurrentProfileName . setVisibility ( View . GONE ) ; } if ( ! TextUtils . isEmpty ( mSelectionFirstLine ) ) { mCurrentProfileName . setText ( mSelectionFirstLine ) ; mAccountHeaderTextSection . setVisibility ( View . VISIBLE ) ; } if ( ! mSelectionSecondLineShown ) { mCurrentProfileEmail . setVisibility ( View . GONE ) ; } if ( ! TextUtils . isEmpty ( mSelectionSecondLine ) ) { mCurrentProfileEmail . setText ( mSelectionSecondLine ) ; mAccountHeaderTextSection . setVisibility ( View . VISIBLE ) ; } if ( ! mSelectionListEnabled || ! mSelectionListEnabledForSingleProfile && mProfileFirst == null && ( mProfiles == null || mProfiles . size ( ) == 1 ) ) { mAccountSwitcherArrow . setVisibility ( View . GONE ) ; handleSelectionView ( null , false ) ; if ( ! mCompactStyle ) { mAccountHeaderTextSection . setPadding ( 0 , 0 , ( int ) UIUtils . convertDpToPixel ( 16 , mAccountHeaderTextSection . getContext ( ) ) , 0 ) ; } } if ( mOnAccountHeaderSelectionViewClickListener != null ) { handleSelectionView ( mCurrentProfile , true ) ; } }
helper method to build the views for the ui
