Skip to content

Instantly share code, notes, and snippets.

@robsn
robsn / *.kt
Created March 21, 2018 08:28
Hide Show Scrolling FAB
dashboard.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
if (dy > 0 || dy < 0 && fab.isShown) {
fab.hide()
}
super.onScrolled(recyclerView, dx, dy)
}
override fun onScrollStateChanged(recyclerView: RecyclerView?, newState: Int) {
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
public final class DrawableCompat
{
private DrawableCompat()
{
}
/**
* Tints the given drawable with the given color.
@robsn
robsn / build.gradle.kts
Created August 17, 2020 05:55
Creating Android lint file for multi module project
lintOptions {
checkDependencies true
xmlReport false
htmlReport true
htmlOutput file("${project.rootDir}/build/reports/android-lint.html")
}
@robsn
robsn / timezones.kt
Created April 9, 2021 07:49
A list of all canonical marked timezones from wikipedia https://en.wikipedia.org/wiki/List_of_tz_database_time_zones Date: 9th April 2021
private val canonicalTimezonesList = listOf(
"Africa/Abidjan",
"Africa/Accra",
"Africa/Algiers",
"Africa/Bissau",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Africa/El_Aaiun",
"Africa/Johannesburg",