From 74591f526111eb5472a3090014488170ca7944ff Mon Sep 17 00:00:00 2001 From: Jonny Andrew Date: Mon, 24 Oct 2022 09:20:51 +0100 Subject: [PATCH] Refactor to use view visibility helper --- .../attachments/AttachmentTypeSelectorBottomSheet.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorBottomSheet.kt b/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorBottomSheet.kt index 88cad2ab0b..af17800455 100644 --- a/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorBottomSheet.kt @@ -20,6 +20,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isVisible import androidx.fragment.app.FragmentManager import androidx.fragment.app.viewModels import com.airbnb.mvrx.fragmentViewModel @@ -47,9 +48,9 @@ class AttachmentTypeSelectorBottomSheet : VectorBaseBottomSheetDialogFragment super.invalidate() - views.location.visibility = if (viewState.isLocationVisible) View.VISIBLE else View.GONE - views.voiceBroadcast.visibility = if (viewState.isVoiceBroadcastVisible) View.VISIBLE else View.GONE - views.poll.visibility = if (!timelineState.isThreadTimeline()) View.VISIBLE else View.GONE + views.location.isVisible = viewState.isLocationVisible + views.voiceBroadcast.isVisible = viewState.isVoiceBroadcastVisible + views.poll.isVisible = !timelineState.isThreadTimeline() } override fun onViewCreated(view: View, savedInstanceState: Bundle?) {