From e0de66b1bea0ca70859261f1872955734b5db2da Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sat, 28 Nov 2020 14:31:39 +0530 Subject: [PATCH] Fix some issues. --- .../newpipe/local/subscription/SubscriptionFragment.kt | 4 ++-- .../newpipe/local/subscription/item/HeaderWithMenuItem.kt | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index 61a6601fa..b74288a34 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -436,8 +436,8 @@ class SubscriptionFragment : BaseStateFragment() { return when (listMode) { getString(R.string.list_view_mode_auto_key) -> { val configuration = resources.configuration - configuration.orientation == Configuration.ORIENTATION_LANDSCAPE - && configuration.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE) + configuration.orientation == Configuration.ORIENTATION_LANDSCAPE && + configuration.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE) } getString(R.string.list_view_mode_grid_key) -> true else -> false diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderWithMenuItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderWithMenuItem.kt index 55f56b3f5..79a272178 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderWithMenuItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderWithMenuItem.kt @@ -34,12 +34,10 @@ class HeaderWithMenuItem( viewBinding.headerTitle.text = title viewBinding.headerMenuItem.setImageResource(itemIcon) - val listener: OnClickListener? = - onClickListener?.let { OnClickListener { onClickListener.invoke() } } + val listener = onClickListener?.let { OnClickListener { onClickListener.invoke() } } viewBinding.root.setOnClickListener(listener) - val menuItemListener: OnClickListener? = - menuItemOnClickListener?.let { OnClickListener { menuItemOnClickListener.invoke() } } + val menuItemListener = menuItemOnClickListener?.let { OnClickListener { menuItemOnClickListener.invoke() } } viewBinding.headerMenuItem.setOnClickListener(menuItemListener) updateMenuItemVisibility(viewBinding) }