A collection of hand-crafted extensions for your Kotlin projects.
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:
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.
The hasFlag
, withFlag
, and minusFlag
extensions for unsigned integers (UByte
, UShort
, UInt
, and ULong
) are no longer annotated with the @ExperimentalUnsignedTypes
annotation.
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!
Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.
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.
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.
Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.
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
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.
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.
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.
All previously deprecated symbols were either removed, or hidden:
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.
All previously deprecated symbols were either removed, or moved one step closer to it:
Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.
Fix iOS/multiplatform publication (see issue #280).
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.
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.
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
Raise the deprecation level of the implicit key delegates from warning to error.
Raise the deprecation level of Context.withStyledAttributes
to error.
Raise the deprecation level of ActionBar.showHomeAsUp
to error.
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!
Add "calls in place exactly once" contracts for the lambdas of all the alertDialog
functions.
Add "calls in place exactly once" contracts for the lambdas of all the alertDialog
functions.
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.
Add "calls in place exactly once" contracts for the lambdas of all the materialAlertDialog
functions.
Replace the initializing ContentProvider
with AndroidX App Startup.
Deprecate awaitCancellation()
in favor of the one now included right into kotlinx.coroutines.
Introduce the whileStarted(Lifecyle)
extension function for Flow
to have a flow emit values only while the passed Lifecycle
is started.
Replace the initializing ContentProvider
with AndroidX App Startup.
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…).
watchOS support has been added to the following splits:
All CPU architectures are supported (arm32, arm64 & X86 for simulator).
Deprecated the transaction
and inTransaction
extension functions in favor of withTransaction
(Room KTX) and runInTransaction
(Room runtime) itself.
Now requires to opt-in to @ObsoleteContentProviderHack
.
This split will be deprecated once App Startup from AndroidX goes stable.
Deprecated symbols now have error level. Next release will remove them.
LifecycleOwner.coroutineScope
that was at error deprecation level. Use LifecycleOwner.lifecycleScope
from AndroidX instead.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).
Add the following read/write extensions properties for View
:
startPadding
endPadding
leftPadding
rightPadding
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.
All lambdas in AndroidStyles
now have a contract. That allows you to initialize val
s declared in the outer scope.
AppCompatStyles
now have a contract. That allows you to initialize val
s declared in the outer scope.Add the missing AppCompat version of ToggleButton
.
MaterialComponentsStyles
now have a contract. That allows you to initialize val
s declared in the outer scope.Add the following missing Material Components counterparts of Android widgets:
CheckBox
, RadioButton
, TextView
, AutoCompleteTextView
.