Kotlin Dsl for Android RecyclerView

Overview

KRecyclerDsl

download

Kotlin Dsl for Android RecyclerView

Exemple

recyclerView.adapter = dataClassAdapter<MyView, MyDataClass>(R.layout.my_view, myItems) {
    onBindViewHolder { view, dataClass ->
        view.name.text = dataClass.name
        view.description.text = dataClass.description
    }
    onItemClickListener { view, dataClass ->
        startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(dataClass.html_url)))
    }
}

Extensions functions

This library provide some useful (or not) extensions functions :

// Call the function when scroll down on the last visible item
recyclerView.addInfiniteScrollListener { search() }

// Add separation between each line.
recyclerView.addDividerItemDecorationVertical()

// Add separation between each column.
recyclerView.addDividerItemDecorationHorizontal()

Dependency

KRecyclerDsl has no dependency, you must add your RecyclerView library version.
This library generate a JAR, not an AAR, so you can use it with any compile version option.

compile "com.tgirard12.krecyclerdsl:krecyclerdsl:$LATEST_VERSION"

// Required
compile "com.android.support:recyclerview-v7:$your_version"
You might also like...
Code generation of Kotlin DSL for AWS CDK

Code generation of Kotlin DSL for AWS CDK

Regular expression DSL on Kotlin

Examples Characters Construct Equivalent Matches x character(Char) The character x \\ character('\\') The backslash character \0n octal(OctalValue(7))

Kotlin Object Notation - Lightweight DSL to build fluid JSON trees

Kotlin Object Notation Lightweight kotlin MPP DSL for building JSON trees Setup Just drop the dependency in your commonMain sourceSet kotlin { sourc

Kotlin parser library with an easy-to-use DSL
Kotlin parser library with an easy-to-use DSL

Pratt Library for parsing expressions and a beautiful Kotlin DSL Just define your operators and operands with the Kotlin DSL and the parser is ready!

Kotlin DSL for Junit5

Kupiter is Kotlin DSL for Junit5. Current API is only for dynamic tests. Get it repositories { maven { url 'https://jitpack.io' } } dependencies

GitHub Actions Kotlin DSL

GitHub Actions Kotlin DSL Work in progress! The goal is to be able to describe GH Actions in Kotlin with all its perks, like: workflow( name = "Te

Kotlin DSL inspired by bhailang.js

Kotlin DSL inspired by bhailang.js

A light weight Compose Animation library to choreograph low level Animation API through Kotlin DSL.

Koreography Choreograph your Compose Animation 💃 🕺 A lightweight Compose Animation utility library to choreograph low-level Animation API (https://d

A small DSL to make building a conversation in Bukkit easy.

Konversation Konversation provides a simple builder to construct chains of prompts to be used in the conversation API present in Bukkit. Bukkit only p

Comments
  • mutableItems is private

    mutableItems is private

    Intellij complains that mutableItems is declared private in DataClassAdapter in the current version 0.3.0. this makes it impossible to edit items once inserted.

    opened by mhashim6 2
Releases(v0.4.0)
Owner
Thomas Girard
Jug Leader, #kotlin dev passionate
Thomas Girard
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.

Carousel Recyclerview Create carousel effect in recyclerview with the CarouselRecyclerview in a simple way. Including in your project Gradle Add below

Jack and phantom 514 Jan 8, 2023
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️

kotlin-android-template ?? A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds. This templa

Nicola Corti 1.5k Jan 3, 2023
{ } Declarative Kotlin DSL for choreographing Android transitions

Transition X Kotlin DSL for choreographing Android Transitions TransitionManager makes it easy to animate simple changes to layout without needing to

Arunkumar 520 Dec 16, 2022
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
Kotlin-dsl-sample - Preferences project on android

kotlin-dsl-example Sample preferences project on android. How to use val

null 1 Dec 30, 2021
A simple, classic Kotlin MVI implementation based on coroutines with Android support, clean DSL and easy to understand logic

A simple, classic Kotlin MVI implementation based on coroutines with Android support, clean DSL and easy to understand logic

Nek.12 4 Oct 31, 2022
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

MaterialDrawerKt Create navigation drawers in your Activities and Fragments without having to write any XML, in pure Kotlin code, with access to all t

Márton Braun 517 Nov 19, 2022
Nice and simple DSL for Espresso in Kotlin

Kakao Nice and simple DSL for Espresso in Kotlin Introduction At Agoda, we have more than 1000 automated tests to ensure our application's quality and

Agoda Company Pte Ltd. 1.1k Nov 22, 2022
DSL for constructing the drawables in Kotlin instead of in XML

Android Drawable Kotlin DSL DSL for constructing the drawables in Kotlin instead of in XML Examples Shape drawables <?xml version="1.0" encoding="utf-

Infotech Group 178 Dec 4, 2022
Lightweight Kotlin DSL dependency injection library

Warehouse DSL Warehouse is a lightweight Kotlin DSL dependency injection library this library has an extremely faster learning curve and more human fr

Osama Raddad 18 Jul 17, 2022