Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 18, 2023
1 parent 068af29 commit d9e5f2e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ class SortFilesBottomSheetDialog : SelectBottomSheetDialog() {

private val navigationArgs: SortFilesBottomSheetDialogArgs by navArgs()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) = with(navigationArgs) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) = with(binding) {
super.onViewCreated(view, savedInstanceState)
binding.selectTitle.setText(R.string.sortTitle)
binding.selectRecyclerView.adapter = SortFilesBottomSheetAdapter(sortType, sortTypeUsage) { onSortTypeClicked(it) }

selectTitle.setText(R.string.sortTitle)

selectRecyclerView.adapter = SortFilesBottomSheetAdapter(
selectedType = navigationArgs.sortType,
usage = navigationArgs.sortTypeUsage,
onItemClicked = ::onSortTypeClicked,
)
}

private fun onSortTypeClicked(sortType: SortType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import kotlinx.android.synthetic.main.item_select_bottom_sheet.view.itemSelectTe

class SelectIntervalTypeBottomSheetAdapter(
private val selectedIntervalType: SyncSettings.IntervalType,
private val onItemClicked: (intervalType: SyncSettings.IntervalType) -> Unit
private val onItemClicked: (intervalType: SyncSettings.IntervalType) -> Unit,
) : RecyclerView.Adapter<ViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand All @@ -47,4 +47,4 @@ class SelectIntervalTypeBottomSheetAdapter(
}

override fun getItemCount() = SyncSettings.IntervalType.values().size
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ class SelectIntervalTypeBottomSheetDialog : SelectBottomSheetDialog() {
dismiss()
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ class SelectSaveDateBottomSheetDialog : SelectBottomSheetDialog() {
dismiss()
}
}

}

0 comments on commit d9e5f2e

Please sign in to comment.