Skip to content

Conversation

jo-elimu
Copy link
Member

@jo-elimu jo-elimu commented Sep 25, 2025

Issue Number

  • Resolves #

Purpose

Technical Details

Testing Instructions

Regression Tests

  • I tested my changes on Android 16 (API 36)
  • I tested my changes on Android 15 (API 35)
  • I tested my changes on Android 14 (API 34)
  • I tested my changes on Android 13 (API 33)
  • I tested my changes on Android 12L (API 32)
  • I tested my changes on Android 12 (API 31)
  • I tested my changes on Android 11 (API 30)
  • I tested my changes on Android 10 (API 29)
  • I tested my changes on Android 9 (API 28)
  • I tested my changes on Android 8.1 (API 27)
  • I tested my changes on Android 8.0 (API 26)

Screenshots

Summary by CodeRabbit

  • Bug Fixes

    • Improved status bar appearance and behavior on newer Android versions (Android 11+ and 15+), preventing content overlap by correctly applying system bar insets and padding.
    • Ensured consistent light status bar handling across supported devices.
  • Refactor

    • Simplified Android version checks to numeric thresholds for more predictable behavior across SDKs.
    • Updated internal bundle handling to maintain compatibility without changing public behavior.

@jo-elimu jo-elimu self-assigned this Sep 25, 2025
@jo-elimu jo-elimu requested a review from a team as a code owner September 25, 2025 14:13
Copy link

coderabbitai bot commented Sep 25, 2025

Walkthrough

Replaces symbolic API checks with numeric SDK thresholds in two Kotlin utility files. In Bundle extensions, compares against 33. In Window extensions, compares against 30 and 35, and adds inset handling/consumption for API 35+ in setStatusBarColorCompat. Legacy branches retained for older APIs. No public signatures changed. elimu.ai's mission is to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

Changes

Cohort / File(s) Summary of Changes
Bundle Parcelable API threshold
utils/src/main/java/ai/elimu/common/utils/BundleExt.kt
Replaced Build.VERSION_CODES.TIRAMISU checks with numeric 33. Logic still selects new Parcelable APIs for >=33; deprecated methods used below with suppression. No API surface change.
Window status bar behavior and thresholds
utils/src/main/java/ai/elimu/common/utils/ui/WindowExtension.kt
Replaced symbolic SDK checks with numeric thresholds: >=30 for light status bar; >=35 for status bar color compat. For >=35, added WindowInsetsCompat-based padding application and returns CONSUMED. Older branches unchanged (systemUiVisibility and statusBarColor with DrawsSystemBarBackgrounds).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor UI as UI Layer
  participant WE as WindowExtension
  participant W as Window
  participant VI as View
  participant IC as InsetsCompat

  UI->>WE: setStatusBarColorCompat(window, view, color)
  alt SDK >= 35 (new path)
    WE->>W: setDecorFitsSystemWindows(false)
    WE->>VI: setOnApplyWindowInsetsListener(...)
    note over WE,VI: Compute systemBars insets, set padding on view<br/>Return WindowInsetsCompat.CONSUMED
    UI-->>UI: Insets applied and consumed
  else SDK < 35
    alt SDK >= 30
      WE->>W: addFlags(DRAWS_SYSTEM_BAR_BACKGROUNDS)
      WE->>W: setStatusBarColor(color)
      UI-->>UI: Uses modern window flags
    else Legacy
      WE->>W: addFlags(DRAWS_SYSTEM_BAR_BACKGROUNDS)
      WE->>W: setStatusBarColor(color)
      UI-->>UI: Legacy behavior retained
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description includes the required headings but all sections are left blank or contain placeholders, so it does not convey the issue reference, purpose, technical details, testing steps, or regression test outcomes. Please complete each template section by specifying the issue number, describing the purpose and technical implementation, outlining how to test the changes, and marking the regression tests you have executed.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title “refactor: use version numbers instead of names” accurately summarizes the primary change of replacing symbolic API level constants with their numeric equivalents in the codebase, making it clear and specific to the refactoring performed.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-api-levels

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bd3181 and 2baf41e.

📒 Files selected for processing (2)
  • utils/src/main/java/ai/elimu/common/utils/BundleExt.kt (2 hunks)
  • utils/src/main/java/ai/elimu/common/utils/ui/WindowExtension.kt (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: lint
  • GitHub Check: build (ubuntu-latest, 21)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (macos-latest, 21)
  • GitHub Check: build (ubuntu-latest, 17)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (macos-latest, 17)
🔇 Additional comments (2)
utils/src/main/java/ai/elimu/common/utils/BundleExt.kt (2)

14-19: Numeric threshold swap looks good.

The move to compare against 33 directly keeps the branch logic intact while aligning with the refactor goal, and it helps us keep iterating toward elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.


31-36: ArrayList branch stays correct.

The numeric check mirrors the Parcelable path and maintains behavior, keeping us focused on elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jo-elimu jo-elimu merged commit 1a1a321 into main Sep 25, 2025
7 checks passed
@jo-elimu jo-elimu deleted the refactor-api-levels branch September 25, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant