Skip to content

Instantly share code, notes, and snippets.

Focusing on testing on android. and Koin at present.

eoin_a eoinahern

Focusing on testing on android. and Koin at present.
Block or report user

Report or block eoinahern

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View myTest.kt
fun testGetCurrency() {
val item: Pair<DomainCurrency, List<DomainCurrency>> = Pair(
DomainCurrency("USD", "1.00", 2, "US DOLLAR"),
listOf(DomainCurrency("EUR", "12.00", 1, "EURO"))
eoinahern / FormatRealTime.kt
Created Apr 9, 2019
trying to format text in edittext using the Locale to add decimal places and comma seperators after user has typed
View FormatRealTime.kt
val df = DecimalFormat("#,###", DecimalFormatSymbols(Locale.getDefault()))
var textChanged = false
df.minimumFractionDigits = 0
df.maximumFractionDigits = asset.investmentDecimalPlaces
.debounce(400, TimeUnit.MILLISECONDS)
.map { layout.txt_amount.text.toString() }
View CustomShrinkLayoutBehavior.kt
class CustomShrinkLayoutBehavior(context: Context, attrs: AttributeSet) :
CoordinatorLayout.Behavior<NestedScrollView>(context, attrs) {
private var screenHeight: Int = context.resources.displayMetrics.heightPixels
override fun layoutDependsOn(parent: CoordinatorLayout, child: NestedScrollView, dependency: View): Boolean {
return dependency is AppBarLayout
override fun onDependentViewChanged(parent: CoordinatorLayout, child: NestedScrollView, dependency: View): Boolean {
View ViewModel.kt
val whatsappRelay: BehaviorRelay<Boolean> = BehaviorRelay.create()
val telegramRelay: BehaviorRelay<Boolean> = BehaviorRelay.create()
val checkTextValid: BehaviorRelay<Boolean> = BehaviorRelay.create()
val openAppIntentRelay: BehaviorRelay<Intent> = BehaviorRelay.create()
val checkShowTextUnderSend: BehaviorRelay<Boolean> = BehaviorRelay.create()
val messageSent: BehaviorRelay<Boolean> = BehaviorRelay.create()
fun checkAppsInstalled() {
View loadFavourites.kt
override fun loadFavourites() {
.subscribe {
if (it.isEmpty()) {
} else {
eoinahern /
Created Dec 20, 2018
android keystore encryption class
public class KeyStoreHelper {
private static final String ALIAS = "mikey";
private static final String ANDROID_KEYSTORE = "AndroidKeyStore";
private final Context context;
private Calendar start;
private Calendar end;
private KeyStore keyStore;
eoinahern /
Created Jun 22, 2018
rx problem a guy was having on slack. put into a gist because the code was formatted badly. An attempt to make the code more readable.
Interceptor addHeadersInterceptor = chain -> {
if (tokenInvalid){
String token = getToken()); //If multiple call stays here blocked.
public String getToken() {
View backNavigation.kt
//back navigation in android
//initate toolbar
val detailsToolbar: Toolbar by lazy { findViewById<Toolbar>( }
//in onCreate
actionBar = supportActionBar
actionBar?.apply {
View download_from_bitchute.go
package main
import (
func main() {
View client.go
package main
import (
You can’t perform that action at this time.