-
Notifications
You must be signed in to change notification settings - Fork 45
Improve dark mode for profiles screen #137
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
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # app/src/main/res/values-night/colors.xml
…cessibility" This reverts commit a659c1c.
Improves the color contrast and accessibility of the profile cards in dark mode by applying a theme overlay. This ensures all buttons render correctly with proper contrast.
📝 WalkthroughWalkthroughUpdates the profile list item layout with new card theming, reorganized view constraints, and button styling. Adds color resources for light and dark themes to support the updated card background styling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull request overview
This PR aims to improve dark-mode contrast/accessibility on the Profiles screen by introducing dedicated profile card/background colors and applying a MaterialComponents dark theme overlay to the profile card so Material buttons render with appropriate contrast.
Changes:
- Add new
profile_backgroundandprofile_card_backgroundcolor resources for day/night. - Introduce
Theme.NetBird.Card(night variant) based onThemeOverlay.MaterialComponents.Dark. - Update
list_item_profile.xmlto apply the card theme overlay, set the card background color, and use Material button styles.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/src/main/res/values/colors.xml | Adds default (day) colors for profile background and card background. |
| app/src/main/res/values-night/colors.xml | Adds night colors for profile background and card background. |
| app/src/main/res/values-night/themes.xml | Adds Theme.NetBird.Card style in the night configuration. |
| app/src/main/res/layout/list_item_profile.xml | Applies the new card theme + background color and updates button styling/ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_margin="8dp" | ||
| android:theme="@style/Theme.NetBird.Card" |
Copilot
AI
Feb 7, 2026
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.
android:theme references @style/Theme.NetBird.Card, but that style is only defined in values-night/themes.xml. In light mode this style won't resolve at runtime (and can also break resource linking), causing the profile list item to fail to inflate. Add a non-night definition of Theme.NetBird.Card in app/src/main/res/values/themes.xml (likely using a light/neutral ThemeOverlay), keeping the dark parent only in the values-night variant.
| android:theme="@style/Theme.NetBird.Card" |
| app:layout_constraintBottom_toBottomOf="@+id/icon_profile" | ||
| app:layout_constraintEnd_toStartOf="@id/badge_active" | ||
| app:layout_constraintHorizontal_bias="0" | ||
| app:layout_constraintHorizontal_chainStyle="packed" /> | ||
| app:layout_constraintHorizontal_chainStyle="packed" | ||
| app:layout_constraintStart_toEndOf="@id/icon_profile" | ||
| app:layout_constraintTop_toTopOf="@+id/icon_profile" |
Copilot
AI
Feb 7, 2026
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.
Constraint references use @+id/icon_profile even though the id is already declared on the ImageView. Prefer @id/icon_profile for references to avoid creating/looking like a new id and to prevent lint warnings.
| app:layout_constraintBottom_toBottomOf="@+id/icon_profile" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0" /> | ||
| app:layout_constraintHorizontal_bias="0" | ||
| app:layout_constraintStart_toEndOf="@id/text_profile_name" | ||
| app:layout_constraintTop_toTopOf="@+id/icon_profile" |
Copilot
AI
Feb 7, 2026
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.
Same as above: use @id/icon_profile instead of @+id/icon_profile when constraining badge_active to icon_profile to avoid lint warnings and keep id usage consistent.
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/src/main/res/values-night/themes.xml`:
- Around line 60-61: Theme.NetBird.Card is only defined for night mode and is
referenced by list_item_profile.xml, causing crashes in light mode; add a
day-mode definition for Theme.NetBird.Card in the app's day themes resource
(values/themes.xml) mirroring the night variant but inheriting from
ThemeOverlay.MaterialComponents.Light so the style resolves during layout
inflation. Ensure the new entry uses the exact style name "Theme.NetBird.Card"
and parent "ThemeOverlay.MaterialComponents.Light" to match usage in
list_item_profile.xml and the existing night definition.
🧹 Nitpick comments (2)
app/src/main/res/values-night/colors.xml (1)
29-30: New profile colors duplicate existing values.
profile_background(#181A1D) is identical tonb_bg, andprofile_card_background(#32363D) is identical tonb_gray_light. Consider referencing the existing colors (e.g.,@color/nb_bg) to avoid drift, unless you intentionally want these to evolve independently.app/src/main/res/layout/list_item_profile.xml (1)
36-44: HardcodedtextColor,textSize, andtextStyleon the profile name.These attributes are set directly on the view rather than via a
TextAppearancestyle. This works but means any future typography changes must be applied in every layout file that uses similar headings. Consider extracting a reusable text appearance style if this pattern is used in multiple places.
|
|
||
| <style name="Theme.NetBird.Card" parent="ThemeOverlay.MaterialComponents.Dark" /> |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if Theme.NetBird.Card is defined in the day (non-night) themes file
echo "=== Searching for Theme.NetBird.Card in values/themes.xml ==="
fd "themes.xml" --full-path --glob '**/values/themes.xml' --exec cat {}
echo ""
echo "=== All files defining Theme.NetBird.Card ==="
rg -rn "Theme.NetBird.Card" --type=xmlRepository: netbirdio/android-client
Length of output: 486
🏁 Script executed:
#!/bin/bash
# Read the night themes file
echo "=== Content of values-night/themes.xml ==="
cat -n app/src/main/res/values-night/themes.xml
echo ""
echo "=== Check if day themes file exists ==="
find app/src/main/res -name "themes.xml" -type f
echo ""
echo "=== Content of day themes file (if exists) ==="
cat -n app/src/main/res/values/themes.xml 2>/dev/null || echo "File not found"Repository: netbirdio/android-client
Length of output: 6376
🏁 Script executed:
#!/bin/bash
# Check if Theme.NetBird.Card is referenced anywhere
echo "=== Searching for references to Theme.NetBird.Card ==="
rg "Theme\.NetBird\.Card" -t xml -t java -t kotlin
echo ""
echo "=== Searching for numeric references to the style ==="
rg "@style/Theme\.NetBird\.Card" -t xmlRepository: netbirdio/android-client
Length of output: 488
Add Theme.NetBird.Card definition to values/themes.xml (day theme)
Theme.NetBird.Card is defined only in values-night/themes.xml but is actively used in app/src/main/res/layout/list_item_profile.xml. The app will crash at layout inflation time in light mode because the style cannot be resolved from values/themes.xml.
Add the following to values/themes.xml:
Day theme style definition
<style name="Theme.NetBird.Card" parent="ThemeOverlay.MaterialComponents.Light" />🤖 Prompt for AI Agents
In `@app/src/main/res/values-night/themes.xml` around lines 60 - 61,
Theme.NetBird.Card is only defined for night mode and is referenced by
list_item_profile.xml, causing crashes in light mode; add a day-mode definition
for Theme.NetBird.Card in the app's day themes resource (values/themes.xml)
mirroring the night variant but inheriting from
ThemeOverlay.MaterialComponents.Light so the style resolves during layout
inflation. Ensure the new entry uses the exact style name "Theme.NetBird.Card"
and parent "ThemeOverlay.MaterialComponents.Light" to match usage in
list_item_profile.xml and the existing night definition.
This PR improves the color contrast and accessibility of the profile cards in dark mode.

A ThemeOverlay.MaterialComponents.Dark theme overlay is now applied to the cards, which ensures all buttons render with proper contrast and makes the UI more accessible and user-friendly.
Summary by CodeRabbit
Release Notes