Splitties Versions Save

A collection of hand-crafted extensions for your Kotlin projects.

v3.0.0

2 years ago

Version 3.0.0 (2021-08-20)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

Finally! Splitties 3.0.0 is there, and it's ready to keep iterating.

The last 2.x version, the 2.1.1 dates back from 2018-11-25, close to 3 years ago. Why did it take so long to have version 3.0.0?

Let's say making a multi-modules, multiplatform library isn't full of easy and straightforward steps. A blog post (my first!) will be published later to share that experience from start to now. Feel free to click follow on blog.louiscad.com, or on Twitter to know when the story is published.

I'll also share a roadmap for Splitties there, which I hope will get you excited for your future endeavors.

Let's get into the actual content of this release:

Documentation updates and improvements, and website

In case you missed it, Splitties now has a website, happily powered by Material for MKDocs. The address is splitties.louiscad.com.

The main page shows a better overview of what Splitties is about, and its content. It should be helpful for newcomers.

The setup info for each module is now upfront in their respective doc pages, be it on the website, or on GitHub, and they have been updated to recommend using the dependency notations from refreshVersions, which will also help you update Splitties, along with other libraries, and all that in less time.

Full disclosure: I am working on refreshVersions myself, in close collaboration with its author, Jean-Michel Fayard. I use it, and I totally recommend it for all Gradle projects. Splitties is using it of course.

Bit Flags

Changed

The hasFlag, withFlag, and minusFlag extensions for unsigned integers (UByte, UShort, UInt, and ULong) are no longer annotated with the @ExperimentalUnsignedTypes annotation.

Preferences

Added

There's a new DataStorePreferences class for the Android side, which you can use as a substitute of the Preferences class. If you were already using SuspendPrefsAccessor, that's all you need to change.

This AndroidX DataStore backed implementation should remove the risks of your app and their users being affected by the potential performance issues of Android platform's SharedPreferences. Be sure to check out the updated docs!

v3.0.0-rc03

2 years ago

Version 3.0.0-rc03 (2021-08-06)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

App Context

Added

The AppCtxInitializer class is now public, so you can put it in the list of dependencies of your own AndroidX App Startup Initializer in case it relies on appCtx to be initialized.

Resources

Fix

In 3.0.0-rc02, changes in styledColorSL made it break when the theme attribute was pointing to a color resource that had no selector (i.e. a non inlined plain color code like #00bbff). This has now been fixed, and the code also got simpler.

v3.0.0-rc02

2 years ago

Version 3.0.0-rc02 (2021-08-03)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

Resources

Fixes

By resolving a subtle issue that could break IDE preview, the version 3.0.0-alpha07 of Splitties also broke the styledColor function and some other in come cases. If you had a color theme attribute and had a theme that was setting its value, pointing to another color resource, you'd be in luck. However, if the color value was set inline, right into the theme, it'd crash (as you can see in this issue). This release fixes this kind of problem for all the affected functions:

  • styledColor
  • styledColorSL
  • styledDimen
  • styledDimenPxSize
  • styledDimenPxOffset
  • styledBool
  • styledInt
  • styledTxt
  • styledStr

v3.0.0-rc01

2 years ago

Version 3.0.0-rc01 (2021-08-01)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

This release removes previously deprecated code.

Make sure you don't have transitive dependencies that relied on deprecated code from a previous release of Splitties! If that's the case, you'll see the host app crash at runtime.

Removed

The "Init provider" split has been removed and is no longer published starting with this release.

You can find if you are using it by searching for its maven coordinates: com.louiscad.splitties:splitties-initprovider (the "Find in Path" IDE option can help you locate it).

If you used it, you'll need to move to AndroidX App Startup.

All the other previously deprecated symbols at hidden level have been removed. This completes the deprecation cycle for the upcoming Splitties 3.0.0 release.

v3.0.0-beta06

2 years ago

Version 3.0.0-beta06 (2021-08-01)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

This release is advancing deprecation cycles further before the upcoming 3.0.0 release.

Deprecation cycle

All previously deprecated symbols were either removed, or hidden:

  • Error → Hidden
  • Hidden → Removed

v3.0.0-beta05

2 years ago

Version 3.0.0-beta05 (2021-08-01)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

This release is advancing deprecation cycles before the upcoming 3.0.0 release.

Deprecation cycle

All previously deprecated symbols were either removed, or moved one step closer to it:

  • Warning → Error
  • Error → Hidden
  • Hidden → Removed

v3.0.0-beta04

2 years ago

Version 3.0.0-beta04 (2021-07-31)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

Fix

Fix iOS/multiplatform publication (see issue #280).

v3.0.0-beta03

2 years ago

Version 3.0.0-beta03 (2021-07-17)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

Other transitive dependencies have also been upgraded to the latest stable version.

It includes upgrades to various AndroidX libraries, Material Design Components 1.4.0, and Stetho 1.6.0.

This release is advancing deprecation cycles before the upcoming, long awaited 3.0.0 release.

Coroutines

Deprecations

The SendChannel.offerCatching has been deprecated in favor of trySend from kotlinx.coroutines 1.5+

The deprecation level of awaitCancellation() has been raised from warning to error. Use the one from kotlinx.coroutines instead.

Lifecycle coroutines

Deprecations

Dispatchers.MainAndroid deprecation level has been raised from warning to error. Using Dispatchers.Main is fine performance wise since kotlinx.coroutines 1.3.3. The PotentialFutureAndroidXLifecycleKtxApi annotation deprecation level was also raised to error.

The following symbols that were previously deprecated at error level are now hidden and will be removed in the next release:

  • Lifecycle.coroutineScope
  • Lifecycle.job
  • LifecycleOwner.lifecycleScope
  • MainDispatcherPerformanceIssueWorkaround

Preferences

Deprecations

Raise the deprecation level of the implicit key delegates from warning to error.

Resources

Deprecations

Raise the deprecation level of Context.withStyledAttributes to error.

Views AppCompat

Deprecations

Raise the deprecation level of ActionBar.showHomeAsUp to error.

v3.0.0-beta02

2 years ago

Version 3.0.0-beta02 (2021-07-08)

Compiled with Kotlin 1.4.32 and kotlinx.coroutines 1.4.3-native-mt.

This is the first release of Splitties that is published on MavenCentral! The maven coordinates are the same.

Also, there's now a documentation website on splitties.louiscad.com, check it out!

Alert Dialog

Add "calls in place exactly once" contracts for the lambdas of all the alertDialog functions.

Alert Dialog AppCompat

Add "calls in place exactly once" contracts for the lambdas of all the alertDialog functions.

Alert Dialog AppCompat Coroutines

Fix rare crash that could happen when waiting for a button click if multiple ones were clicked simultaneously.

Now, only the first one to be considered clicked by the system will trigger, and the second one will be ignored.

Alert Dialog Material

Add "calls in place exactly once" contracts for the lambdas of all the materialAlertDialog functions.

App Context

Replace the initializing ContentProvider with AndroidX App Startup.

Coroutines

Deprecate awaitCancellation() in favor of the one now included right into kotlinx.coroutines.

Lifecycle Coroutines

Introduce the whileStarted(Lifecyle) extension function for Flow to have a flow emit values only while the passed Lifecycle is started.

Stetho Init

Replace the initializing ContentProvider with AndroidX App Startup.

v3.0.0-beta01

3 years ago

Compiled with Kotlin 1.4.10 and kotlinx.coroutines 1.3.9-native-mt.

This release has multiplatform splits compatible with iOS, macOS and watchOS projects that use Kotlin/Native 1.4.0 and 1.4.10. Feedback is appreciated (Twitter, Kotlin's Slack, GitHub issues…).

Platforms added

watchOS support has been added to the following splits:

All CPU architectures are supported (arm32, arm64 & X86 for simulator).

Arch Room

Deprecated

Deprecated the transaction and inTransaction extension functions in favor of withTransaction (Room KTX) and runInTransaction (Room runtime) itself.

Init Provider

Changed

Now requires to opt-in to @ObsoleteContentProviderHack. This split will be deprecated once App Startup from AndroidX goes stable.

Lifecycle Coroutines

Deprecated

Deprecated symbols now have error level. Next release will remove them.

Removed

  • LifecycleOwner.coroutineScope that was at error deprecation level. Use LifecycleOwner.lifecycleScope from AndroidX instead.

Toast

Changed

Using this API now requires to opt-in to @UnreliableToastApi so the developers acknowledge the gotchas of android.widget.Toast or use something else (like snackbars, banners or dialogs).

Views

Added

Add the following read/write extensions properties for View:

  • startPadding
  • endPadding
  • leftPadding
  • rightPadding

Changed

The onClick parameter changed from a crossinline lambda to a View.OnClickListener now that Kotlin 1.4 brings SAM conversion for Kotlin functions taking SAM Java interfaces. Usage should not change. Note that there is now an implicit it parameter of type View that might break existing code if an outer it was used in the onClick lambda.

Views DSL

Changed

All lambdas in AndroidStyles now have a contract. That allows you to initialize vals declared in the outer scope.

Views DSL AppCompat

Changed

  • Only instantiate AppCompat version of Android widgets if the current theme inherits an AppCompat theme.
  • All lambdas in AppCompatStyles now have a contract. That allows you to initialize vals declared in the outer scope.

Added

Add the missing AppCompat version of ToggleButton.

Views DSL Material

Changed

  • Only instantiate Material Components version of Android widgets if the current theme inherits a material theme.
  • All lambdas in MaterialComponentsStyles now have a contract. That allows you to initialize vals declared in the outer scope.

Added

Add the following missing Material Components counterparts of Android widgets: CheckBox, RadioButton, TextView, AutoCompleteTextView.