File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
WordPress/src/main/java/org/wordpress/android/ui/stats/refresh Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class StatsViewAllFragment : DaggerFragment() {
8383 super .onSaveInstanceState(outState)
8484 }
8585
86- private fun initializeViews (savedInstanceState : Bundle ? ) {
86+ private fun initializeViews (savedInstanceState : Bundle ? ) {
8787 val layoutManager = LinearLayoutManager (activity, LinearLayoutManager .VERTICAL , false )
8888
8989 savedInstanceState?.getParcelable<Parcelable >(listStateKey)?.let {
@@ -225,8 +225,16 @@ class StatsViewAllFragment : DaggerFragment() {
225225 })
226226
227227 viewModel.toolbarHasShadow.observe(this , Observer { hasShadow ->
228- val elevation = if (hasShadow == true ) resources.getDimension(R .dimen.appbar_elevation) else 0f
229- app_bar_layout.postDelayed({ ViewCompat .setElevation(app_bar_layout, elevation) }, 100 )
228+ app_bar_layout.postDelayed({
229+ if (app_bar_layout != null ) {
230+ val elevation = if (hasShadow == true ) {
231+ resources.getDimension(R .dimen.appbar_elevation)
232+ } else {
233+ 0f
234+ }
235+ ViewCompat .setElevation(app_bar_layout, elevation)
236+ }
237+ }, 100 )
230238 })
231239 }
232240
You can’t perform that action at this time.
0 commit comments