Skip to content

Commit

Permalink
#187 refactor null 아닌지 체크하는 구문 함수로 빼서 사용할 경우 !! 연산자가 강요되기 때문에 != null…
Browse files Browse the repository at this point in the history
… 로 변경
  • Loading branch information
tgyuuAn committed Jul 25, 2023
1 parent 57c7bc6 commit cf727bf
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,11 @@ class MyPageMoreBottomSheetFragment(private val backCallback: () -> Unit) :
val bottomSheet = bottomSheetDialog
.findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)

if (isBottomSheetNotNull(bottomSheet)) {
blockBottomSheetDragging(bottomSheet!!)
if (bottomSheet != null) {
blockBottomSheetDragging(bottomSheet)
}
}

private fun isBottomSheetNotNull(bottomSheet: FrameLayout?): Boolean {
return bottomSheet != null
}

private fun blockBottomSheetDragging(bottomSheet: FrameLayout) {
val behavior: BottomSheetBehavior<*> = BottomSheetBehavior.from(bottomSheet)
behavior.isDraggable = false
Expand Down

0 comments on commit cf727bf

Please sign in to comment.