Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Haz3-jolt
Copy link
Contributor

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

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@david-allison david-allison left a 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

@Haz3-jolt
Copy link
Contributor Author

Thanks! You mentioned adding a few needs test annotations, but they don't seem to be in this PR

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To confirm; I wasn't just tired, there's a bug here

Screenshot 2024-12-18 at 22 44 22

Comment on lines +295 to +299
if (targetConfig.layoutId == R.id.export_extras_collection || targetConfig.layoutId == R.id.export_extras_apkg) {
collectionExportLegacyCheckbox.isVisible = true
} else {
apkgExportLegacyCheckbox.isVisible = false
}
Copy link
Member

@david-allison david-allison Dec 18, 2024

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

Suggested change
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
Copy link
Member

@david-allison david-allison Dec 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle 'Support older Anki Versions' when exporting
2 participants