Merge "Add null checker to AppBarLayout" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-07-01 05:58:08 +00:00
committed by Android (Google) Code Review

View File

@@ -58,7 +58,9 @@ public class CollapsingToolbarBaseActivity extends FragmentActivity implements
super.setContentView(R.layout.collapsing_toolbar_base_layout);
mCollapsingToolbarLayout = findViewById(R.id.collapsing_toolbar);
mAppBarLayout = findViewById(R.id.app_bar);
mAppBarLayout.addOnOffsetChangedListener(this);
if (mAppBarLayout != null) {
mAppBarLayout.addOnOffsetChangedListener(this);
}
if (savedInstanceState != null) {
mIsToolbarCollapsed = savedInstanceState.getBoolean(KEY_IS_TOOLBAR_COLLAPSED);
}