package com.qimai.android.widget;

import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;

import androidx.appcompat.app.AppCompatActivity;

public class DrawerActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drawer);
       final FrameLayout frameLayout = findViewById(R.id.left);
       final DrawerLayout drawer = findViewById(R.id.drawer);
        Button btn = findViewById(R.id.btn_context);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                frameLayout.removeAllViews();
                frameLayout.addView(LayoutInflater.from(DrawerActivity.this).inflate(R.layout.other_layout,null));
                drawer.invalidate();
                drawer.openDrawer(Gravity.LEFT);


            }
        });




    }
}