Skip to content

Commit

Permalink
inline things
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Jun 8, 2021
1 parent 39389cf commit c28d586
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions atox/src/main/kotlin/ui/chat/ChatFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ class ChatFragment : BaseFragment<FragmentChatBinding>(FragmentChatBinding::infl
startRecording()
startTimer()
} else {
requestRecordPermission()
ActivityCompat.requestPermissions(
requireActivity(),
arrayOf(permission.RECORD_AUDIO),
REQUEST_RECORD_PERMISSION
)
}
} else if (motionEvent.action == MotionEvent.ACTION_UP) {

Expand Down Expand Up @@ -486,13 +490,6 @@ class ChatFragment : BaseFragment<FragmentChatBinding>(FragmentChatBinding::infl
}
}

private fun requestRecordPermission() =
ActivityCompat.requestPermissions(
requireActivity(),
arrayOf(permission.RECORD_AUDIO),
REQUEST_RECORD_PERMISSION
)

fun checkRecordPermission(): Boolean =
ContextCompat.checkSelfPermission(
requireContext(),
Expand Down

0 comments on commit c28d586

Please sign in to comment.