Skip to content

Instantly share code, notes, and snippets.

View BenHenning's full-sized avatar

Ben Henning BenHenning

  • 09:45 (UTC -07:00)
View GitHub Profile
interface InteractionAnswerRetriever {
fun getPendingAnswer(): InteractionObject
}
class TextInputInteractionView: TextView, InteractionAnswerRetriever {
override fun getPendingAnswer(): InteractionObject {
return InteractionObject.newBuilder().setNormalizedAnswer(text).build()
}
}
class ListItemViewModel(val skillDescription: String): BaseObservable {
// Needs to be @Bindable?
var isChecked: Boolean = false
}
...
list_item.xml
<checkbox
@Module(subcomponents = [ChildComponent::class])
class SomeModule {
@Provides
@Singleton
fun provideComplexDependency(componentDep: ComponentDep): ComplexDependency { ... }
}
-----
@Scope annotation class ChildScope
class InMemoryBlockingCacheTest {
@ExperimentalCoroutinesApi
@Inject
@field:TestDispatcher
lateinit var testDispatcher: TestCoroutineDispatcher
@ExperimentalCoroutinesApi
private val backgroundTestCoroutineScope by lazy {
CoroutineScope(backgroundTestCoroutineDispatcher)
}
@BenHenning
BenHenning / test.kt
Last active September 13, 2019 07:23
@Singleton
class UserAppHistoryController @Inject constructor(
cacheStoreFactory: PersistentCacheStore.Factory
) {
// Use cacheStoreFactory...
}
class PersistentCacheStore private constructor() {
class Factory @Inject constructor (private val context: Context) {
// Use context...
@FragmentScope
class UserAppHistoryViewModel @Inject constructor(
private val userAppHistoryController: UserAppHistoryController,
private val logger: Logger
): ViewModel() {
...
private const val NAV_DRAWER_TAG = "navigation_drawer"
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.home_activity)
activity.supportFragmentManager
.beginTransaction()
.add(R.id.home_fragment_placeholder, HomeFragment())
010D05B3 E8 B5 FF F0 FF call @_RTC_CheckStackVars@8 (0FE056Dh)
010D05B8 58 pop eax
010D05B9 5A pop edx
010D05BA 8B 4D F4 mov ecx,dword ptr [ebp-0Ch]
010D05BD 64 89 0D 00 00 00 00 mov dword ptr fs:[0],ecx
010D05C4 59 pop ecx
010D05C5 5F pop edi
010D05C6 83 C4 48 add esp,48h
010D05C9 3B EC cmp ebp,esp
010D05CB E8 FB D3 F0 FF call __RTC_CheckEsp (0FDD9CBh)
0x010D05B3 e8 b5 ff f0 ff 58 5a 8b 4d f4 64 89 0d 00 00 00 00 59 5f 83 c4 48 3b ec e8 fb d3 f0 ff 8b e5 5d èµÿðÿXZ.Môd......Y_ƒÄH;ìèûÓðÿ.å]
0x010D05D3 c2 04 00 66 90 02 00 00 00 e0 05 0d 01 d8 ff ff ff 0c 00 00 00 01 06 0d 01 c4 ff ff ff 0c 00 00 Â..f.....à...Øÿÿÿ........Äÿÿÿ...
0x010D05F3 00 f8 05 0d 01 3c 65 6e 64 3e 24 4c 30 00 3c 62 65 67 69 6e 3e 24 4c 30 00 cc cc cc cc 55 8b ec .ø...<end>$L0.<begin>$L0.ÌÌÌÌU.ì
010D05B3 call @_RTC_CheckStackVars@8 (0FE056Dh)
010D05B8 pop eax
010D05B9 pop edx
010D05BA mov ecx,dword ptr [ebp-0Ch]
010D05BD mov dword ptr fs:[0],ecx
010D05C4 pop ecx
010D05C5 pop edi
010D05C6 add esp,48h
010D05C9 cmp ebp,esp
010D05CB call __RTC_CheckEsp (0FDD9CBh)