![]() |
![]() |
View PowerplayDaggerModule.kt
This file contains 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
@Module | |
@InstallIn(SingletonComponent::class) | |
object PowerplayDaggerModule { | |
@EntryPoint | |
@InstallIn(SingletonComponent::class) | |
interface SampleAdapterEntryPointEntryPoint { | |
val sampleClass : SampleClass | |
} |
View SampleFragment.kt
This file contains 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
@AndroidEntryPoint | |
class SampleFragment : Fragment() { | |
@Inject lateinit var sampleWorker : SampleWorkerInterface | |
.... | |
.... | |
private fun sendData(input : String, onComplete: ((String?) -> Unit)?) { | |
sampleWorker.sendData(input) { responseString -> |
View SampleFragment.kt
This file contains 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
@AndroidEntryPoint | |
class SampleFragment : Fragment() { | |
// No need to extract it here | |
// private val expId by lazy { intent?.getStringExtra("EXPERIMENT_ID") } | |
val viewModel: SampleViewModel by activityViewModels() | |
..... | |
..... |
View SampleActivity.kt
This file contains 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
@AndroidEntryPoint | |
class SampleActivity : AppCompatActivity() { | |
@Inject lateinit var factory: SampleViewModelFactory | |
val viewModel: SampleViewModel by viewModels { | |
SampleViewModel.provideFactory( | |
factory, | |
"data" | |
) |