-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added checkbox for colpkg and apkg exports to match Anki desktop #17626
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! You mentioned adding a few needs test annotations, but they don't seem to be in this PR
AnkiDroid/src/main/java/com/ichi2/anki/export/ExportDialogFragment.kt
Outdated
Show resolved
Hide resolved
Whoops, missed a commit, will do in a sec |
@@ -273,40 +291,47 @@ class ExportDialogFragment : DialogFragment() { | |||
container: View, | |||
targetConfig: ExportConfiguration, | |||
) { | |||
// if we export as collection there's no deck/selected items to choose from | |||
// show the legacy checkbox only for collection and apkg exports | |||
if (targetConfig.layoutId == R.id.export_extras_collection || targetConfig.layoutId == R.id.export_extras_apkg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (targetConfig.layoutId == R.id.export_extras_collection || targetConfig.layoutId == R.id.export_extras_apkg) { | ||
collectionExportLegacyCheckbox.isVisible = true | ||
} else { | ||
apkgExportLegacyCheckbox.isVisible = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this code should exist at all. The code below should handle visibility of the container which contains the checkbox. Since this was unclear, I'd comment a little more
if (targetConfig.layoutId == R.id.export_extras_collection || targetConfig.layoutId == R.id.export_extras_apkg) { | |
collectionExportLegacyCheckbox.isVisible = true | |
} else { | |
apkgExportLegacyCheckbox.isVisible = false | |
} |
code below
ExportConfiguration.entries.forEach { config ->
container.findViewById<View>(config.layoutId).isVisible =
config.layoutId == targetConfig.layoutId
}
if (targetConfig.layoutId == R.id.export_extras_collection) { | ||
decksSelectorContainer.visibility = View.GONE | ||
selectedLabel.visibility = View.GONE | ||
decksSelectorContainer.isVisible = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're no longer modifying this method, I'd split this isVisible
change into a separate commit
Purpose / Description
Describe the problem or feature and motivation
Fixes
Approach
Adds a checkbox and uses the common string to interop with Ani Desktop
How Has This Been Tested?
Did visual confirmation along with a screen recording of the changes and checked the sizes of the exports to confirm that legacy is being triggered properly.
Screen_recording_20241218_215818.webm
Learning (optional, can help others)
Had to play around with the XML for a bit to get it to align, and other than that nothing much
Checklist