This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinearLayoutManagerWithAccurateOffset(context: Context?) : LinearLayoutManager(context) { | |
// map of child adapter position to its height. | |
private val childSizesMap = mutableMapOf<Int, Int>() | |
override fun onLayoutCompleted(state: RecyclerView.State?) { | |
super.onLayoutCompleted(state) | |
for (i in 0 until childCount) { | |
val child = getChildAt(i) | |
childSizesMap[getPosition(child)] = child.height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion "0.7.1.201405082137" | |
reportsDir = file("$buildDir/intermediates/test") | |
} | |
// Taken from https://blog.gouline.net/2015/06/23/code-coverage-on-android-with-jacoco/ | |
project.afterEvaluate { | |
// Grab all build types and product flavors | |
def buildTypes = android.buildTypes.collect { type -> type.name } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.VisibleForTesting; | |
import java.io.Closeable; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.LinkedList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.animation.Interpolator; | |
/** | |
* An interpolator that eases past the final value then back towards it elastically. | |
* <p/> | |
* math taken from link provided in see also section. | |
* | |
* @see <a href="https://github.com/greensock/GreenSock-JS/blob/master/src/uncompressed/easing/EasePack.js">Greensock Github</a></a> | |
*/ | |
public class EaseOutElasticInterpolator implements Interpolator { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.util.Log; | |
import com.crashlytics.android.Crashlytics; | |
import com.koushikdutta.ion.Ion; |