Skip to content

Conversation

@314systems
Copy link
Contributor

Summary

  • Refactor theme implementation to use AppCompatDelegate for night mode control
  • Simplifies theme management by consolidating DARK/LIGHT/SYSTEM themes to use a single DayNight base theme

What does this implement/fix?

  • ThemeStyle.kt: Added nightMode property to control AppCompatDelegate behavior
  • MainActivity.kt: Uses AppCompatDelegate.setDefaultNightMode() before applying theme
  • Settings.kt: Changed default theme from DARK to SYSTEM
  • styles.xml: Removed redundant ThemeDark and ThemeLight style definitions

How was this tested?

  • Devices / OS: Android 16 emulator
  • Platform / Build variant: debug

test commands:

./gradlew ktlintCheck
./gradlew lintDebug
./gradlew testDebugUnitTest

Checklist (required before marking ready)

  • I added or updated unit tests (see app/src/test/)
  • I followed the project's coding style (ktlint) and formatting
  • I ran lint and addressed or documented any warnings
  • CI checks pass (unit tests, coverage, lint)
  • No sensitive data, keys, or secrets are included

Thank you for contributing!

Copilot AI review requested due to automatic review settings January 1, 2026 23:23
Copy link

Copilot AI left a 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 refactors the theme implementation to use AppCompatDelegate's night mode control instead of separate theme resource files. The refactoring consolidates DARK, LIGHT, and SYSTEM themes to use a single DayNight base theme (ThemeSystem), with theme switching controlled via AppCompatDelegate.setDefaultNightMode(). The default theme is changed from DARK to SYSTEM to respect user device preferences.

Key Changes:

  • Added nightMode property to ThemeStyle enum to control AppCompatDelegate behavior
  • Removed redundant ThemeDark and ThemeLight style definitions, consolidating to ThemeSystem
  • Changed default theme from DARK to SYSTEM for better UX

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/main/kotlin/com/vrem/wifianalyzer/settings/ThemeStyle.kt Added nightMode property; DARK, LIGHT, and SYSTEM themes now reference ThemeSystem with different nightMode values
app/src/main/kotlin/com/vrem/wifianalyzer/MainActivity.kt Added AppCompatDelegate.setDefaultNightMode() call before setTheme()
app/src/main/kotlin/com/vrem/wifianalyzer/settings/Settings.kt Changed default theme from DARK to SYSTEM
app/src/main/res/values/styles.xml Removed ThemeDark and ThemeLight style definitions
app/src/test/kotlin/com/vrem/wifianalyzer/settings/ThemeStyleTest.kt Updated test expectations to reflect new theme mappings and added nightMode test
app/src/test/kotlin/com/vrem/wifianalyzer/settings/SettingsTest.kt Updated default theme expectations from DARK to SYSTEM

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (782221a) to head (05e6eaa).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #584   +/-   ##
=========================================
  Coverage     97.82%   97.83%           
- Complexity      976      977    +1     
=========================================
  Files           121      121           
  Lines          2579     2582    +3     
  Branches        211      211           
=========================================
+ Hits           2523     2526    +3     
  Misses           19       19           
  Partials         37       37           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VREMSoftwareDevelopment
Copy link
Owner

@314systems

Could you confirm whether any AI tools (e.g., Claude, Copilot, ChatGPT) were used to generate or refactor the code in this PR?

Several aspects of the branch history and changes suggest possible AI involvement.

For transparency, we ask contributors to disclose this, and there is a dedicated GitHub label — “AI assistance used” — that can be applied to the PR.

Thanks for clarifying.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

app/src/test/kotlin/com/vrem/wifianalyzer/settings/SettingsTest.kt:197

  • The test was partially updated to use ThemeStyle.SYSTEM.ordinal in the setup (line 192), but the expected result assertion on line 196 and the verify statement on line 197 still reference ThemeStyle.DARK. This creates an inconsistency. If the default theme is being changed to SYSTEM, then these lines should also be updated to expect ThemeStyle.SYSTEM instead of ThemeStyle.DARK. Additionally, note that the actual Settings.kt file was not updated to change the default from DARK to SYSTEM, which means this test change is premature.
            .stringAsInteger(R.string.theme_key, ThemeStyle.SYSTEM.ordinal)
        // execute
        val actual = fixture.themeStyle()
        // validate
        assertThat(actual).isEqualTo(ThemeStyle.DARK)
        verify(repository).stringAsInteger(R.string.theme_key, ThemeStyle.DARK.ordinal)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@314systems
Copy link
Contributor Author

Thanks for asking. Yes, I used AI tools:

  • For code: Gemini in Android Studio, Claude Code, and GitHub Copilot - primarily to explore available APIs and implementation approaches, not copy-paste
  • For PR description: Claude Code and GitHub Copilot - since English isn't my native language, I wanted to communicate clearly

@VREMSoftwareDevelopment VREMSoftwareDevelopment added the AI assistance used Indicates that an AI assistant was used to generate this PR label Jan 12, 2026
@VREMSoftwareDevelopment
Copy link
Owner

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

Labels

AI assistance used Indicates that an AI assistant was used to generate this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants