layout id 값 live template 으로 처리 하기 원래 반복되는 코드를 매우 귀찮아 하던 차에 layout id 를 class name 을 기반으로 가져오도록 코딩을 해 놓은게 있었는데 (아래 참조) private var mLayoutName = generateLayoutName() inline fun Fragment.generateLayoutName(): String { val name = javaClass.simpleName var layoutName = name[0].toLowerCase().toString() name.substring(1, name.length).forEach { layoutName += if (it.isUpperCase()) { "_${it.toLowerCase()}" } else { it } } return layoutNam.. 더보기 robolectric 에서 leak canary 오류 발생 java.lang.NoSuchMethodError: com.squareup.leakcanary.RefWatcher testImplementation "org.robolectric:robolectric:4.1" 에서 괜찮다가 4.3 으로 변경 시 오류가 발생 했는데 글들을 뒤져보다가 보니 결론 난건 https://github.com/square/leakcanary/issues/1180 https://github.com/square/leakcanary/issues/1198 https://github.com/square/leakcanary/issues/979 신규 버전에서 고쳤으니 그걸 사용하라고 하는 것 https://square.github.io/leakcanary/getting_started/ 더보기 final static class 를 mock 하기 final static class 를 mock 하기 위해서는 testImplementation 'org.mockito:mockito-inline:2.13.0' 를 추가해야 된다. https://stackoverflow.com/questions/14292863/how-to-mock-a-final-class-with-mockito 더보기 이전 1 ··· 7 8 9 10 11 12 13 ··· 1216 다음