Skip to content

feat: add card flags to CardContentProvider and api#21322

Open
ColgateTotal77 wants to merge 4 commits into
ankidroid:mainfrom
ColgateTotal77:feature/add-card-flags-to-api
Open

feat: add card flags to CardContentProvider and api#21322
ColgateTotal77 wants to merge 4 commits into
ankidroid:mainfrom
ColgateTotal77:feature/add-card-flags-to-api

Conversation

@ColgateTotal77

@ColgateTotal77 ColgateTotal77 commented Jun 30, 2026

Copy link
Copy Markdown

Purpose / Description

Expand CardContentProvider and api to work with card flags.

Fixes

Approach

Added read/write for card flags in CardContentProvider and api.

How Has This Been Tested?

Implemented test for negative, too large, and valid flag codes.

Learning (optional, can help others)

I just looked at other api functions and content provider cases. Most of the code I just copied and a little tweaked for my case.

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

@welcome

welcome Bot commented Jun 30, 2026

Copy link
Copy Markdown

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

@sanjaysargam sanjaysargam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Welcome to the community @ColgateTotal77
Thanks for contributing 🚀

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/provider/CardContentProvider.kt Outdated
@sanjaysargam sanjaysargam added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Jul 1, 2026

@criticalAY criticalAY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really strong first PR, thank you!

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/provider/CardContentProvider.kt Outdated
Comment thread api/src/main/java/com/ichi2/anki/api/Flag.kt
Comment thread AnkiDroid/src/androidTest/java/com/ichi2/anki/tests/ContentProviderTest.kt Outdated
@criticalAY

Copy link
Copy Markdown
Contributor

The comments are not resolved?

@ColgateTotal77

Copy link
Copy Markdown
Author

The comments are not resolved?

Hi, closed some, but can you look at #21322 (comment)

and also do we need to mention David again in #21322 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author New contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] Extension ContentResolver / api to read/write card data

3 participants