+ private void setProfile(Profile profile) {
+ ProfileDetailModel model = new ViewModelProvider(this).get(ProfileDetailModel.class);
+ CollapsingToolbarLayout appBarLayout = findViewById(R.id.toolbar_layout);
+ if (appBarLayout != null) {
+ if (profile != null)
+ appBarLayout.setTitle(profile.getName());
+ else
+ appBarLayout.setTitle(getResources().getString(R.string.new_profile_title));
+ }
+ model.setValuesFromProfile(profile);
+ }