asdsolutions-os / duo-navigation-drawer

A flexible, easy to use, unique drawer library for your Android project.
http://psdcompany.nl/
Apache License 2.0
1.1k stars 191 forks source link

Custom Header and Footer Layout Don't Work #43

Closed saleho27 closed 4 years ago

saleho27 commented 4 years ago

Hi, I try to change the text John Doe and its subtitle Manager by using new layout and set it in the menu.xml but seems doesn't work...

I follow the instruction here https://github.com/psdcompany/duo-navigation-drawer/issues/14 but the header and footer still show the same text.

How to make it works?


Edit: Sorry it works, I edited the menu.xml but actually the menu is written directly in main activity xml, thanks

erichamaxsa commented 2 years ago

In your mainactivity create this function and call it.

public void letsee() { try { TextView userMenuName = findViewById(nl.psdcompany.psd.duonavigationdrawer.R.id.duo_view_header_text_title); userMenuName.setText("YOur Name");

        TextView userMenuDesignation = findViewById(nl.psdcompany.psd.duonavigationdrawer.R.id.duo_view_header_text_sub_title);
        userMenuDesignation.setText("Admin");
    }
    catch (Exception ex)
    {
        ex.printStackTrace();
    }
}