diff --git a/atox/src/main/kotlin/ui/chat/ChatFragment.kt b/atox/src/main/kotlin/ui/chat/ChatFragment.kt index 0007ab2ea..6647bb5ce 100644 --- a/atox/src/main/kotlin/ui/chat/ChatFragment.kt +++ b/atox/src/main/kotlin/ui/chat/ChatFragment.kt @@ -286,7 +286,11 @@ class ChatFragment : BaseFragment(FragmentChatBinding::infl startRecording() startTimer() } else { - requestRecordPermission() + ActivityCompat.requestPermissions( + requireActivity(), + arrayOf(permission.RECORD_AUDIO), + REQUEST_RECORD_PERMISSION + ) } } else if (motionEvent.action == MotionEvent.ACTION_UP) { @@ -486,13 +490,6 @@ class ChatFragment : BaseFragment(FragmentChatBinding::infl } } - private fun requestRecordPermission() = - ActivityCompat.requestPermissions( - requireActivity(), - arrayOf(permission.RECORD_AUDIO), - REQUEST_RECORD_PERMISSION - ) - fun checkRecordPermission(): Boolean = ContextCompat.checkSelfPermission( requireContext(),