'Combining Navigation Rail with Drawer

I am currently improving the tablet version of my app and was looking to add a "Navigation Rail" similar to the "Reply" app from the Material Design, you can see an example of the rail in this link: https://material.io/design/material-studies/reply.html#product-architecture and video example here: https://material.io/components/navigation-rail#behavior

Direct link to the video: https://kstatic.googleusercontent.com/files/7774e2fd23c0eee7d85dd9bd5015944191b6c0878da3539b269a39475f3c0aaaf87fa558802d4d8b95c916a69f8d99fda844dcdb19c646a1fbe8fd1f81f45556

The idea is to have the rail on the left side of the UI and on click it will expand into a Navigation Drawer, I have been trying different things for over a week now, implementing Navigation Rail or Drawer individually isn't a problem, combining both of them is a bit tricky.

Any ideas on how to achieve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source