Skip to content

Instantly share code, notes, and snippets.

View joshallenit's full-sized avatar

Josh Allen joshallenit

View GitHub Profile
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import androidx.fragment.app.Fragment
import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.typeText
import androidx.test.espresso.matcher.ViewMatchers.withClassName
@joshallenit
joshallenit / EditTextTest.kt
Last active December 1, 2021 02:01
Robolectric issue 5345 - code to reproduce crash - EditTextTest - NullPointerException at PopupWindow.getDecorViewLayoutParams
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import androidx.fragment.app.Fragment
import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.typeText
import androidx.test.espresso.matcher.ViewMatchers.withClassName
@joshallenit
joshallenit / ThreadMonitor.kt
Created November 8, 2018 00:37
ThreadMonitor
import kotlin.math.min
/**
* Prints useful information about all threads in our process. Information includes
* [Thread.getName], [Thread.getState] and the stacktrace of the [Thread] up to 10 items.
*
* To stop thread call [interrupt].
*
* Things to look for:
*
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
*
* Unless required by applicable law or agreed to in writing, software