Skip to content

Instantly share code, notes, and snippets.

@atfox7
atfox7 / RxFilterMap
Created June 26, 2017 21:19
RxJava Filter and Map by class type
fun <T, R> Observable<T>.filterMap(type: Class<R>): Observable<R> {
return filter { type.isInstance(it) }
.cast(type)
}
@atfox7
atfox7 / ReorderRecyclerView.java
Last active August 29, 2015 14:10 — forked from mohlendo/ReorderRecyclerView.java
Modified ReorderRecyclerView implementing smoother item swap logic and a scaled drawable for the dragging view instead of a line drawn around it.
/*
* Modified version of GitHub user mohlendo's ReorderRecyclerView gist
* original at https://gist.github.com/mohlendo/68b7e2f89d0b1b354abe
*
* Copyright (C) 2014 I.C.N.H GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*