Skip to content

Instantly share code, notes, and snippets.

View segunfamisa's full-sized avatar
Segun is typing...

Segun Famisa segunfamisa

Segun is typing...
View GitHub Profile
segunfamisa / AdapterObservableListItem.kt
Created September 26, 2019 09:11
Delegated Properties for RecyclerView Adapters
View AdapterObservableListItem.kt
class ObservableListField<T, VH : RecyclerView.ViewHolder>(
private val adapter: RecyclerView.Adapter<VH>,
private val diffUtilCallbackProducer: ((List<T>, List<T>) -> DiffUtil.Callback)?,
initialValue: List<T>
) : ObservableProperty<List<T>>(initialValue = initialValue) {
private var result: DiffUtil.DiffResult? = null
override fun beforeChange(
property: KProperty<*>,
segunfamisa / SearchResponse.kt
Last active May 21, 2017 19:20
Response class for Github Search API response
View SearchResponse.kt
data class User(
val login: String,
val id: Long,
val url: String,
val html_url: String,
val followers_url: String,
val following_url: String,
val starred_url: String,
val gists_url: String,
val type: String,
segunfamisa /
Created May 21, 2017 18:39
User data class from the Github Search API
public class User {
private String login;
private long id;
public class Calculator {
private int a;
private int b;
public Calculator(int a, int b) {
this.a = a;
this.b = b;
public void sum() {
segunfamisa / app-module-build.gradle
Last active June 22, 2020 11:43
Using gradle extra properties to manage Android dependency versioning
View app-module-build.gradle
// app module build.gradle
apply plugin: ''
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion