From 08f92f961437d0f46814ff31aebeb4e71867cc4f Mon Sep 17 00:00:00 2001 From: ztimms73 Date: Mon, 28 Jun 2021 13:59:45 +0300 Subject: [PATCH] Fix possible crashes --- .../main/java/org/koitharu/kotatsu/base/ui/BaseActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/koitharu/kotatsu/base/ui/BaseActivity.kt b/app/src/main/java/org/koitharu/kotatsu/base/ui/BaseActivity.kt index d032ec3e9..ec2fab14e 100644 --- a/app/src/main/java/org/koitharu/kotatsu/base/ui/BaseActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/base/ui/BaseActivity.kt @@ -59,12 +59,12 @@ abstract class BaseActivity : AppCompatActivity(), OnApplyWindo this.binding = binding super.setContentView(binding.root) (binding.root.findViewById(R.id.toolbar) as? Toolbar)?.let(this::setSupportActionBar) - val params = (binding.root.findViewById(R.id.toolbar) as? Toolbar)?.layoutParams as AppBarLayout.LayoutParams + val params = (binding.root.findViewById(R.id.toolbar) as? Toolbar)?.layoutParams as? AppBarLayout.LayoutParams ViewCompat.setOnApplyWindowInsetsListener(binding.root, this) if (get().isToolbarHideWhenScrolling) { - params.scrollFlags = SCROLL_FLAG_SCROLL or SCROLL_FLAG_ENTER_ALWAYS + params?.scrollFlags = SCROLL_FLAG_SCROLL or SCROLL_FLAG_ENTER_ALWAYS } else { - params.scrollFlags = SCROLL_FLAG_NO_SCROLL + params?.scrollFlags = SCROLL_FLAG_NO_SCROLL } }