|
|
|
@ -27,19 +27,18 @@ import android.widget.TextView;
|
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
|
private AppBarConfiguration mAppBarConfiguration;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TextView menu_name;
|
|
|
|
|
TextView menu_role;
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
setContentView(R.layout.activity_main);
|
|
|
|
|
TextView menu_name = findViewById(R.id.user_name);
|
|
|
|
|
TextView menu_role = findViewById(R.id.user_role);
|
|
|
|
|
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
|
User user;
|
|
|
|
|
user = (User) intent.getSerializableExtra("user");
|
|
|
|
|
//menu_name.setText(user.getName());
|
|
|
|
|
//menu_role.setText(user.getPasd());
|
|
|
|
|
|
|
|
|
|
setContentView(R.layout.activity_main);
|
|
|
|
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
|
FloatingActionButton fab = findViewById(R.id.fab);
|
|
|
|
@ -62,6 +61,14 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
|
|
|
|
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
|
|
|
|
NavigationUI.setupWithNavController(navigationView, navController);
|
|
|
|
|
|
|
|
|
|
if(navigationView.getHeaderCount() > 0) {
|
|
|
|
|
View header = navigationView.getHeaderView(0);
|
|
|
|
|
TextView menu_name = header.findViewById(R.id.user_name);
|
|
|
|
|
TextView menu_role = header.findViewById(R.id.user_role);
|
|
|
|
|
menu_name.setText(user.getName());
|
|
|
|
|
menu_role.setText(user.getRole());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|