Skip to content

Commit

Permalink
Refactoring Visibility to isVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
Haz3-jolt committed Dec 19, 2024
1 parent 5f725d0 commit 07eca88
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ExportDialogFragment : DialogFragment() {
if (selectedDeck != null) {
deckSelector.setSelection(findDeckPosition(selectedDeck))
}
loadingIndicator.visibility = View.GONE
loadingIndicator.isVisible = false
deckSelector.isEnabled = true
}
}
Expand Down Expand Up @@ -291,24 +291,25 @@ class ExportDialogFragment : DialogFragment() {
container: View,
targetConfig: ExportConfiguration,
) {
// show the legacy checkbox only for collection and apkg exports
ExportConfiguration.entries.forEach { config ->
container.findViewById<View>(config.layoutId).isVisible =
config.layoutId == targetConfig.layoutId
}
// if we export as collection there's no deck/selected items to choose from
if (targetConfig.layoutId == R.id.export_extras_collection) {
decksSelectorContainer.visibility = View.GONE
selectedLabel.visibility = View.GONE
decksSelectorContainer.isVisible = false
selectedLabel.isVisible = false
} else {
if (arguments?.getSerializableCompat<ExportType>(ARG_TYPE) != null) {
decksSelectorContainer.visibility = View.GONE
selectedLabel.visibility = View.VISIBLE
decksSelectorContainer.isVisible = false
selectedLabel.isVisible = true
} else {
decksSelectorContainer.visibility = View.VISIBLE
selectedLabel.visibility = View.GONE
decksSelectorContainer.isVisible = true
selectedLabel.isVisible = false
}
}
exportTypeSelector.setSelection(targetConfig.index)
// Show the legacy checkbox for the selected export type
ExportConfiguration.entries.forEach { config ->
container.findViewById<View>(config.layoutId).visibility =
if (config.layoutId == targetConfig.layoutId) View.VISIBLE else View.GONE
}
}

private fun handleCollectionExport() {
Expand Down

0 comments on commit 07eca88

Please sign in to comment.