This file contains hidden or 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
| class AssistedViewModel @AssistedInject constructor( | |
| private val dependency1: Dependency1, | |
| private val dependency2: Dependency2, | |
| ... | |
| @Assisted private val id: Int){ | |
| @AssistedInject.Factory | |
| interface Factory{ fun create(id: Int) : AssistedViewModel } | |
| } |
This file contains hidden or 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
| class SomeFragment: Fragment(){ | |
| @Inject factory: AssistedViewModel.Factory | |
| override fun onActivityCreated(savedInstanceState: Bundle?){ | |
| super.onActivityCreated(savedInstanceState) | |
| val viewModel = factory.create(301) | |
| ... | |
| } |
This file contains hidden or 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
| fun generateImage(width: Int, height: Int): Bitmap { | |
| val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) | |
| val canvas = Canvas(bitmap) | |
| val paint = Paint() | |
| val path = generatePath() | |
| canvas.drawPath(path, paint) | |
| return bitmap | |
| } |
This file contains hidden or 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
| package com.marchuck.accessibilitychecks | |
| import androidx.compose.foundation.clickable | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.size | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.semantics.contentDescription | |
| import androidx.compose.ui.semantics.semantics | |
| import androidx.compose.ui.test.junit4.accessibility.enableAccessibilityChecks |
OlderNewer