Skip to content

Release 0.2.0: drop androidx.preference, read the default SharedPreferences directly - #15

Merged
JakubMrozek merged 2 commits into
mainfrom
trim-dependencies
Nov 2, 2026
Merged

JakubMrozek merged 2 commits into
mainfrom
trim-dependencies

Conversation

@JakubMrozek

Copy link
Copy Markdown
Member

What changed

  • TCFDataProvider reads the IAB TCF keys from context.getSharedPreferences("${packageName}_preferences", MODE_PRIVATE), the same file PreferenceManager.getDefaultSharedPreferences opens. It is still a one-shot read of prefs.all on each collect(), with no listener before or after, and the parsing and validation have not changed.
  • androidx.preference:preference-ktx is removed from build.gradle.kts, and its entries are removed from gradle/libs.versions.toml.
  • androidx.browser stays. InAppBrowserManager (ui/) opens Custom Tabs with CustomTabsIntent, and sdk-kotlin uses it. No other module declares it: :om depends only on the kit, coroutines and :omsdk-android.
  • TCFDataProviderTest writes to the prefs file by name, and a new test checks that values written through the framework's default-prefs API are read.
  • CHANGELOG: an Unreleased entry. The version is left at 0.1.0 for the release PR.

Dependencies (:releaseRuntimeClasspath; :om is the same set plus the kit and OMSDK)

60 modules before, 38 after.

Removed: preference, preference-ktx, appcompat, appcompat-resources, recyclerview, activity, activity-ktx, fragment-ktx, savedstate, savedstate-ktx, lifecycle-viewmodel-savedstate, lifecycle-runtime-ktx, lifecycle-viewmodel-ktx, lifecycle-livedata-core-ktx, core-ktx, collection-ktx, annotation-experimental, tracing, transition, vectordrawable, vectordrawable-animated, window.

Lower resolved versions (now set by browser and play-services-basement; an app's own newer versions still win): core 1.8.0 → 1.2.0, fragment 1.3.6 → 1.0.0, lifecycle-* 2.5.1 → 2.0.0, arch.core 2.1.0 → 2.0.0, customview 1.1.0 → 1.0.0, slidingpanelayout 1.2.0 → 1.0.0, versionedparcelable 1.1.1 → 1.1.0.

Still present: fragment 1.0.0, legacy-support-core-ui/-utils, viewpager, drawerlayout, coordinatorlayout, swiperefreshlayout, slidingpanelayout and others. play-services-ads-identifier 18.0.1 brings these in through play-services-basement 18.0.0 → fragment 1.0.0. Cutting those as well would mean changing how the advertising ID is read, which this PR does not do.

Testing

  • ./gradlew spotlessCheck detekt build test passed: 340 unit tests across the kit and :om, with 0 failures and 0 skipped.
  • I compared ./gradlew :dependencies and :om:dependencies --configuration releaseRuntimeClasspath before and after; the lists above come from that comparison.

🤖 Generated with Claude Code

JakubMrozek and others added 2 commits November 2, 2026 14:16
TCFDataProvider reads `<packageName>_preferences`, the file PreferenceManager.getDefaultSharedPreferences opens, so the kit no longer pulls in appcompat, recyclerview, activity, savedstate, window and the rest through preference-ktx. androidx.browser stays: InAppBrowserManager uses Custom Tabs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JakubMrozek JakubMrozek changed the title Drop androidx.preference: read the default SharedPreferences directly Release 0.2.0: drop androidx.preference, read the default SharedPreferences directly Nov 2, 2026
@JakubMrozek
JakubMrozek merged commit 35bbb53 into main Nov 2, 2026
1 check passed
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