0

I have a navigation drawer in my App. When I open the drawer I want it to open below the content, I changed some attributes to get the image what I have. but what I want is show in image What I want to reach, and you can find my code here:

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    final CoordinatorLayout content = (CoordinatorLayout) findViewById(R.id.content);
    drawerLayout.setScrimColor(Color.TRANSPARENT);
    ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
        private float scaleFactor = 6f;//  private float scaleFactor = 6f;


        @Override
        public void onDrawerSlide(View drawerView, float slideOffset) {
            super.onDrawerSlide(drawerView, slideOffset);

            float slideX = drawerView.getWidth() * slideOffset;
            content.setTranslationX(slideX);

           content.setScaleX(1 );
           content.setScaleY(1 - (slideOffset / scaleFactor));
        }
    };

    drawerLayout.setScrimColor(Color.TRANSPARENT);
    drawerLayout.setDrawerElevation(0f);
    drawerLayout.addDrawerListener(actionBarDrawerToggle);
Gourav
  • 2,746
  • 5
  • 28
  • 45

0 Answers0