51.5 Changing the Title and Scrim Color
As a final task, edit the MainActivity.java file and add some code to the onCreate() method to change the title text on the collapsing layout manager instance and to set a different scrim color (note that the scrim color may also be set within the layout resource file):
package com.ebookfrenzy.carddemo;
.
.
import com.google.android.material.appbar.CollapsingToolbarLayout;
import android.graphics.Color;
.
.
.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_card_demo);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
...