Skip to content

Instantly share code, notes, and snippets.

View kfaraj's full-sized avatar

Kamal Faraj kfaraj

View GitHub Profile
val reviewManager = ReviewManagerFactory.create(this)
reviewManager.requestReviewFlow()
.addOnCompleteListener { task ->
if (task.isSuccessful) {
reviewManager.launchReviewFlow(this, task.result)
.addOnCompleteListener {
// Continue the normal user flow.
}
} else {
// Continue the normal user flow.
val advertisingId = AdvertisingIdClient.getAdvertisingIdInfo(this).id
// Do something with the advertising ID.
@Test
fun loadNote() = runTest {
val testDispatcher = UnconfinedTestDispatcher(testScheduler)
Dispatchers.setMain(testDispatcher)
try {
val viewModel = NoteViewModel()
viewModel.loadNote()
assertEquals("Lorem ipsum", viewModel.note.value)
} finally {
Dispatchers.resetMain()
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}