A Kotlin library set dedicated to Android platform which will make programming sweet again!
All modules are available on the jcenter. In order to import them, make sure your project includes the appropriate repository.
repositories {
// ...
jcenter()
}
Highly flexible list view which will help you to write much less code and spend much less time for such basic thing as list view.
Forget about writing copy-pasting another RecyclerView.Adapter
.
Let Kandy List Views set everything up for you.
Basically, all you need to do is write a custom view holder for each model you want to see as a list item.
You can use any number of any types of list items within a single adapter.
KandyListAdapter
will take care of defining and managing view types.
onBind
method of a view holder provide you a type-safe getter of a list item.
No need to keep an eye on a collection of data you've passed to the list view adapter.
Let this method retrieve the appropriate object for you (including the inside of event listeners.)
class StringViewHolder(itemView: View) : AbstractDefaultKandyViewHolder<String>(itemView) {
private val textView = itemView as TextView
override fun onBind(position: Int, adapter: KandyListAdapter, listItemGetter: () -> KandyListItem<String>) {
textView.text = listItemGetter().item
}
}
val adapter = KandyListAdapter(
KandyListItem(
"String item",
KandyItemView { TextView(this) }
) { itemView -> StringViewHolder(itemView) }
)
For full example, please refer to this file.
dependencies {
// ...
implementation("com.kwezal.kandy:listviews:${Version.kandy}@aar")
{ isTransitive = true } // Includes RecyclerView dependency
}
Simple DSL-like wrapper for AlertDialog
s. Not only it makes the code shorter and prettier, but also more convenient to use.
show { dialog("Message", "Title") { positiveButton("OK") } }
For full example, please refer to this file.
dependencies {
// ...
implementation("com.kwezal.kandy:dialogs:${Version.kandy}@aar")
}
Android logs made so super simple you'll KISS them. No installation required. Automatic tag generation. Featherweight. No runtime overhead on production.
logD { "Message" }
For full example, please refer to this file.
debugImplementation("com.kwezal.kandy:logs-debug:${Version.kandy}@aar")
releaseImplementation("com.kwezal.kandy:logs-release:${Version.kandy}@aar")
Other modules of this set of libraries will be published soon. As for now I'd appreciate any kind of feedback or contribution.