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
internal fun <S : Any> Any.accessField(fieldName: String): S? = | |
javaClass.getDeclaredField(fieldName).let { field -> | |
field.isAccessible = true | |
return@let field.get(this) as S | |
} | |
internal fun Any.writeField(fieldName: String, value: Any) = | |
javaClass.getDeclaredField(fieldName).let { field -> | |
field.isAccessible = true | |
field.set(this, value) |
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
/* | |
** ------------------------------------------------------------------------------ | |
** 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 http://www.apache.org/licenses/LICENSE-2.0 | |
** ------------------------------------------------------------------------------ | |
*/ | |
package nl.sogeti.android.deviceprofiler.network; | |
import android.support.v4.util.LongSparseArray; |
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.graphics.Rect; | |
import android.view.TouchDelegate; | |
import android.view.View; | |
/** | |
* <p> | |
* Ensures minimum hitbox size of small touch targets. For example: | |
* <p> |