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