Android Question MSAccountHeaderBuilder profile click

frenkipi

Member
Licensed User
Longtime User
Hello, I am trying to display new primarydraweritems on profile click, when user clicks on the arrow like in the image bellow. So lets say on click I would like to display just one primarydraweritem with text Profile. Is there any sample? Bellow is my code. Thank you in advance.

upload_2015-5-30_17-29-45-png.34363


B4X:
Sub BuildDrawer
    Dim MSP1 As MSProfile
    Dim PDB1 As BitmapDrawable : PDB1.Initialize(LoadBitmap(File.DirAssets,"profile2.jpg"))
    MSP1.withName("tds1111").withEmail("[email protected]").withIcon(PDB1).withSelectable(True)
    MSP1.Identifier=999

    Dim Profiles(2) As MSProfile
    Profiles(0) = MSP1
  
    Dim msa As MSAccountHeaderBuilder
    Dim HeaderBackground As BitmapDrawable
    HeaderBackground.Initialize(LoadBitmap(File.DirAssets,"header.jpg"))
    msa.Initialize("MSA")
    msa.addProfiles(Profiles)
    msa.withAlternativeProfileHeaderSwitching(True)
  
    msa.withHeaderBackground(HeaderBackground)
    Dim MaterialHeaderResult As Object = msa.build
  
    Dim p1 As MSIconicDrawable : p1.Initialize("gmd_home")  : p1.Color = 0xffff4081

    MDB.Initialize("MD")
    MDB.withHeaderClickable(True)
    MDB.withAccountHeader(MaterialHeaderResult)
    'MDB.withHeader(pnlHdr, -1, 80dip)
    MDB.AddPrimaryDrawerItem  ("Weather"  , p1.Drawable ,Null ,"99+" ,True,1, "Shows the weather")
  
    MDB.withToolbar(ActionBar)
    MDB.withActionbarToggle(True)
    MDB.withActionbarToggleAnimated(True)
    MD = MDB.Build
End Sub

Sub MSA_ProfileClicked (Profile As MSProfile )
    Log(Profile.Name)
End Sub
 
Top