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
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. |
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
val advertisingId = AdvertisingIdClient.getAdvertisingIdInfo(this).id | |
// Do something with the advertising ID. |
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
@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() |
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
dependencyResolutionManagement { | |
versionCatalogs { | |
create("libs") { | |
from(files("../gradle/libs.versions.toml")) | |
} | |
} | |
} |
OlderNewer