Skip to content

Conversation

@Haz3-jolt
Copy link
Member

@Haz3-jolt Haz3-jolt commented Dec 27, 2025

Purpose / Description

Fixes tab layout color inconsistency in set due date dialog when theme is black/dark

Fixes

Approach

Sets background color of tab layout to transparent

How Has This Been Tested?

Tested on the following Android Emulators:
Pixel Tablet API 36

Before:
Screenshot_20251227_152813

After:
Screenshot_20251227_153031

Learning (optional, can help others)

Why the TabLayout background changed

  • ViewBinding requires us to inflate the layout manually. In commit 42450f1, this changed who provides the LayoutInflater.
  • Previously, we used setView(R.layout.dialog_set_due_date), which allows MaterialAlertDialog to inflate the layout using its dialog theme overlay.
  • After migrating to ViewBinding, we now call DialogSetDueDateBinding.inflate(layoutInflater). This uses a plain inflater without the dialog’s theme overlay.
  • TabLayout derives its default background color from the currently applied theme/overlay. Because the dialog overlay was no longer applied during inflation, it fell back to the app’s surface color, resulting in the visible theme-colored bar.

Checklist

Please, go through these checks before submitting the PR.

  • 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

- fixes tab layout color inconsistency in set due date dialog when theme is black/dark

- Ref: ankidroid#19936
@david-allison
Copy link
Member

The fix LGTM

  • Could you edit this to note the commit hash causing the issue
  • Could you explain why the commit caused the issue? I don't see the issue immediately, and I'm worried I missed something

#19936 (comment)

@Haz3-jolt
Copy link
Member Author

The fix LGTM

* Could you edit this to note the commit hash causing the issue

* Could you explain why the commit caused the issue? I don't see the issue immediately, and I'm worried I missed something

#19936 (comment)

* [42450f1](https://github.com/ankidroid/Anki-Android/commit/42450f1386cc21a68964dccf154d21c457ea177b)

* [chore: convert SetDueDateDialog to ViewBinding  #19483](https://github.com/ankidroid/Anki-Android/pull/19483)

Done!

@BrayanDSO BrayanDSO added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Dec 27, 2025
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

all of David's requests are handled, great explanation, looks like a good fix, thanks

@mikehardy mikehardy added this pull request to the merge queue Dec 27, 2025
Merged via the queue into ankidroid:main with commit 60fae6e Dec 27, 2025
18 checks passed
@github-actions github-actions bot removed the Needs Second Approval Has one approval, one more approval to merge label Dec 27, 2025
@github-actions github-actions bot added this to the 2.24 release milestone Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dark mode] Set due date dialog theme issue

4 participants