Skip to content

chore: replace deprecated Resources.getColor and Gradle space-assignment DSL - #46

Merged
tanderson-ld merged 1 commit into
mainfrom
devin/1785143610-fix-deprecated-apis
Jul 29, 2026
Merged

chore: replace deprecated Resources.getColor and Gradle space-assignment DSL#46
tanderson-ld merged 1 commit into
mainfrom
devin/1785143610-fix-deprecated-apis

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

No SDK bump needed — launchdarkly-android-client-sdk is already pinned to 5.13.2, the latest 5.x on Maven Central. This PR only clears deprecation warnings that the build currently emits.

Two deprecations fixed:

  • Resources.getColor(int) (deprecated since API 23) → ContextCompat.getColor(this, id) in MainActivity (5 call sites, both the initial render and the flag-change listener).
  • Groovy DSL space assignment in app/build.gradle, which Gradle 9 warns "will fail with an error in Gradle 10":
    - namespace "com.launchdarkly.hello_android"
    - compileSdk 37
    + namespace = "com.launchdarkly.hello_android"
    + compileSdk = 37
    (also applicationId, versionCode, versionName, minifyEnabled, source/targetCompatibility)

One remaining Gradle 9 deprecation ("Using a Project object as a dependency notation") originates inside the Android Gradle Plugin, not this repo's scripts, so it is not actionable here.

How verified

  • ./gradlew clean assembleDebug — BUILD SUCCESSFUL, and both the Kotlin getColor warnings and the namespace space-assignment warning are gone (verified with --warning-mode all).
  • Installed the debug APK on an Android 36 x86_64 emulator with the hello-apps mobile key injected locally (never committed) and launched it; the app initialized the SDK and rendered the flag evaluation, confirming the ContextCompat.getColor styling path works at runtime:

hello-android running on emulator

Link to Devin session: https://app.devin.ai/sessions/7a61003c1e984050ad12233068fab8a3


Note

Low Risk
Mechanical deprecation fixes in sample app build config and UI coloring with no auth, data, or SDK version changes.

Overview
Clears build and Kotlin deprecation warnings without changing SDK version or app behavior.

app/build.gradle switches Android/Groovy properties from space assignment to = (namespace, compileSdk, applicationId, versionCode, versionName, minifyEnabled, sourceCompatibility, targetCompatibility) so Gradle 9+ stops warning about Gradle 10 breakage.

MainActivity.kt replaces five resources.getColor(...) calls with ContextCompat.getColor(this, ...) for initial flag UI styling and the real-time flag listener backgrounds, and adds the androidx.core.content.ContextCompat import.

Reviewed by Cursor Bugbot for commit 4c21e08. Bugbot is set up for automated code reviews on this repo. Configure here.

…ent DSL

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion
kinyoklion marked this pull request as ready for review July 28, 2026 15:57
@kinyoklion
kinyoklion requested a review from a team as a code owner July 28, 2026 15:57
@tanderson-ld
tanderson-ld merged commit 82db8cc into main Jul 29, 2026
6 checks passed
@tanderson-ld
tanderson-ld deleted the devin/1785143610-fix-deprecated-apis branch July 29, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants