0

I'm using the MaterialDrawer library by Mike Penz.

I made an AccountHeader and now wondered how to add such an "add Account" button (see the picture). Is there allready a provided method how to do this? Like by pressing this button sth appears to let you insert information of a new account?

enter image description here

Makarele
  • 59
  • 9

2 Answers2

1

The AccountHeaderBuilder.build() function returns a AccountHeader object. You should keep the reference to this one, as it will allow you to update contents of the AccountHeader at a later time.

So you'll create your AccountHeader like this

AccountHeader headerResult = new AccountHeaderBuilder()
    .withActivity(this)
    .addProfiles(...)
    .build();

After that you have the headerResult if you take a look in the javadoc you will see that there are 2 methods which will be useful for you.

There is addProfiles and addProfile which allows you to add a new profile to the drawer. Equally there is removeProfile, and updateProfile (which you will use when one profile was modified)

mikepenz
  • 12,708
  • 14
  • 77
  • 117
0

How you are doing for the other two...same thing you have to do for that.

  • I guess I'll edit my question to be more specific. I don't want just an item for my drawer, but a method which let's you add a new account on button press. – Makarele Jun 26 '17 at 15:04
  • Then you have to create a list view or recycler view inside your navigation view and handle it. – Achintya Mongia Jun 27 '17 at 07:13