Fix background image visibility based on collection state #18073#18162
Fix background image visibility based on collection state #18073#18162lukstbit merged 6 commits intoankidroid:mainfrom
Conversation
This commit ensures that the background image is correctly shown or hidden based on the collection state. Previously, `currentAnkiDroidDirectory` was being redeclared locally, causing unnecessary shadowing. The fix properly assigns the directory to the existing class-level property and correctly references it. Changes: - Removed redundant local variable declaration for `currentAnkiDroidDirectory`. - Used the existing `lateinit var currentAnkiDroidDirectory` to store the directory path. - Updated the `updateBackgroundVisibility` function to correctly toggle the background image based on whether the collection is empty. Impact: - Prevents redundant memory allocation. - Ensures the background image is hidden when the collection is empty. - Shows the background image when decks are added. Tested to verify the correct behavior of background visibility when decks are added or removed.
Screen.Recording.2025-03-26.at.6.37.36.PM.mov |
Re implemented the solution based on the placeholder logic
|
Hi! It's advised that you force push on top of your old commit so that there's only one commit associated with each issue. This way, the commit history of the repo stays clean and descriptive. This was a mistake I made when I first contributed. You can do this by running |
533d82f to
7dc967a
Compare
david-allison
left a comment
There was a problem hiding this comment.
Code looks good! A couple of 'line noise' changes in the diff which should be reverted to keep things clean
And a request for a comment change to explain why the line exists
david-allison
left a comment
There was a problem hiding this comment.
Cheers, thanks so much, looks great!
| fabLinearLayout.layoutParams = layoutParams | ||
| } | ||
| } | ||
| Timber.d("Startup - Deck List UI Completed") |
There was a problem hiding this comment.
Wait... this line shouldn't be removed
(missed this on the diff from my notifications)
There was a problem hiding this comment.
okay i'll just add it again
|
done |
lukstbit
left a comment
There was a problem hiding this comment.
Ok, thanks for contributing!
Purpose / Description
Previously, the background image remained visible even when the collection was empty, causing readability issues. This update ensures that the background image is correctly toggled based on whether there are decks in the collection.
Fixes
Approach
How Has This Been Tested?
Checklist
Uploading Screen Recording 2025-03-26 at 6.37.36 PM.mov…