SkillAgentSearch skills...

Splitties

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

Install / Use

/learn @LouisCAD/Splitties

README

Splitties

Splitties is a collection of small Kotlin multiplatform libraries (with Android as first target).

These libraries are intended to reduce the amount of code you have to write, freeing code reading and writing time, so you can focus more on what you want to build for your users (even if you're the only one), or have more time to have fun.

This project is named "Splitties" because it is split in small modules, distributed as independent libraries, so you can add only the ones you need to your project/module, helping reduce the size of the final binary that users devices will need to download and keep in the limited storage (BTW, everything is limited).

Some Android targeting modules have a content similar to what Anko offers. See a short comparison of Splitties with Anko here.

Each module has been designed to have a small footprint and be as efficient as possible.

A few examples

Splitties is all about simplifying your code. Here are a few examples:

Kotlin:

startActivity(Intent(this, DemoActivity::class.java))

Kotlin with Splitties Activities:

start<DemoActivity>()

Kotlin:

Snackbar.make(root, R.string.refresh_successful, Snackbar.LENGTH_SHORT)
    .show()

Kotlin with Splitties Snackbar:

root.snack(R.string.refresh_successful)

Racing coroutines: (raceOf(…) comes from the Coroutines module)

suspend fun awaitUserChoice(ui: SomeUi, choices: List<Stuff>): Stuff? = raceOf({
    ui.awaitSomeUserAction(choices)
}, {
    ui.awaitDismissal()
    null
}, {
    ui.showSomethingInRealtimeUntilCancelled() // Returns Nothing, will run, but never "win".
})

Kotlin:

Snackbar.make(root, getString(R.string.deleted_x_items, deletedCount), Snackbar.LENGTH_LONG)
    .setAction(android.R.string.cancel) {
        deleteOperation.requestRollback()
    }
    .setActionTextColor(ContextCompat.getColor(this, R.color.fancy_color))
    .show()

Kotlin with Splitties Snackbar:

root.longSnack(str(R.string.deleted_x_items, deletedCount)) {
    action(android.R.string.cancel, textColor = color(R.color.fancy_color)) {
        deleteOperation.requestRollback()
    }
}

Overview

System interaction (Android only):

  • App Context: Always have your application Context at hand with appCtx.
  • System Services: No more context.getSystemService(NAME_OF_SERVICE) as NameOfManager.

User input and user interface related splits:

Small messages (Android only)

Dialogs (Android only)

System UI (Android only)

Extensions for Views (Android only)

Creating View based UIs with the power of Kotlin (Android only)

Various UI utilities (Android only)

Material Design helpers (Android only)

Inter and cross app communication: Activities, Fragments, Intents, and Bundles

  • Activities: Start activities with minimal boilerplate.
  • Intents: Transform companion objects into powerful typesafe intent specs, and create PendingIntents the clean and easy way.
  • Fragments: Start activities from fragments and do transactions with minimal boilerplate.
  • Fragment Args: Fragment arguments without ceremony thanks to delegated properties.
  • Bundle: BundleSpec to use Bundle with property syntax for Intent extras and more.

Concurrency (Multiplatform)

Data persistence (Multiplatform)

  • Preferences: Property syntax for Android's SharedPreferences/DataStore and macOS/iOS/watchOS NSUserDefaults.
  • Arch Room: Room helpers to instantiate your DB and perform transactions in Kotlin.

Utilities (Multiplatform)

  • Bit Flags: hasFlag, withFlag and minusFlag extensions on Long, Int, Short, Byte, and their unsigned counterparts.
  • Collections: forEach for Lists without Iterator allocation.

Debugging (Android only)

Legacy (Android only)

Related Skills

View on GitHub
GitHub Stars2.6k
CategoryDesign
Updated25d ago
Forks162

Languages

Kotlin

Security Score

100/100

Audited on Feb 28, 2026

No findings