Skip to content

Commit

Permalink
Uses extension create method
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Feb 8, 2024
1 parent ea45e30 commit a7d11fe
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import com.ichi2.libanki.*
import com.ichi2.utils.DeckNameComparator
import com.ichi2.utils.KotlinCleanup
import com.ichi2.utils.TypedFilter
import com.ichi2.utils.create
import com.ichi2.utils.customView
import com.ichi2.utils.negativeButton
import com.ichi2.utils.positiveButton
Expand Down Expand Up @@ -98,15 +99,15 @@ open class DeckSelectionDialog : AnalyticsDialogFragment() {
recyclerView.scrollToPosition(getPositionOfDeck(did, adapter.getCurrentlyDisplayedDecks()))
}

return AlertDialog.Builder(requireActivity()).apply {
return AlertDialog.Builder(requireActivity()).create {
negativeButton(R.string.dialog_cancel)
customView(view = dialogView)
if (arguments.getBoolean(KEEP_RESTORE_DEFAULT_BUTTON)) {
positiveButton(R.string.restore_default) {
onDeckSelected(null)
}
}
}.create()
}
}

private fun getPositionOfDeck(did: DeckId, decks: List<SelectableDeck>) =
Expand Down

0 comments on commit a7d11fe

Please sign in to comment.