Skip to content

Instantly share code, notes, and snippets.

View Fenscode's full-sized avatar

Fenil Patel Fenscode

View GitHub Profile
@Fenscode
Fenscode / AndroidUsefulLinksResources.md
Last active March 12, 2019 06:55
This gist is just about useful links, docs, blog or resources which are very useful during the write an Application. It makes the development process much easier and fun.

Data Binding

How to Use Data Binding Library with Kotlin – A Step By Step Guide

If you want to use data binding and Kotlin, here are a few things to keep in mind:

Data binding is a support library, so it can be used with all Android platform versions all the way back to Android 2.1 (API level 7+). To use data binding, you need Android Plugin for Gradle 1.5.0-alpha1 or higher. You can see here how to update the Android Plugin for Gradle.

Reference:

@arunkumar9t2
arunkumar9t2 / PreferencesX.kt
Last active September 6, 2023 15:20
Android PreferenceScreen DSL for using with androidx.preference framework.
@file:Suppress("NOTHING_TO_INLINE")
import android.content.Context
import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import androidx.preference.*
/**
* DSL marker for restricting access scope when [PreferencesBuilder.preference] is nested.
*/
@nesquena
nesquena / SnappyRecyclerView.java
Last active June 21, 2023 23:04
Snap-to-Center RecyclerView Extension
// From: http://stackoverflow.com/a/37816976
public class SnappyRecyclerView extends RecyclerView {
// Use it with a horizontal LinearLayoutManager
// Based on http://stackoverflow.com/a/29171652/4034572
public SnappyRecyclerView(Context context) {
super(context);
}