Chapter 29 - Testing the ArtListScreen for Left Swipe and Deletion of Art RecordNov 12, 2025·3 min read
Chapter 31 : ImageSearchScreen Composable Testing (Final Code)package androidavatar.learning.artlearnersapp.presentation.ui import androidx.compose.ui.test.* import androidx.compose.ui.test.junit4.createComposeRule import org.junit.Rule import org.junit.Test class ImageSearchScreenTest { @get:Rule va...Nov 12, 2025·3 min read
Chapter 27 - Testing the Repository Implementation for the Insert and Delete Use CasesNov 12, 2025·4 min read
Chapter 26 - Testing the Insert and Delete Use CasesSince InsertArtUseCase and DeleteArtUseCase are pure domain logic, they’re easy to test — no Android dependencies, just Kotlin coroutines and a fake repository. Let’s write clear, minimal, and clean unit tests using JUnit + Kotlin coroutines test. We...Nov 12, 2025·2 min read
Chapter 25 - Coding the Composable ArtListScreen with the Left Swipe Functionality@OptIn(ExperimentalMaterialApi::class) @Composable fun ArtListScreen( viewModel: ArtViewModel = hiltViewModel(), isLoading: Boolean = false, onFabClick: () -> Unit = {}, onDeleteClick: (Art) -> Unit = {}, errorMessage: String? = n...Nov 12, 2025·4 min read
Chapter 24 - Coding the Composable AddArtScreen@Composable fun AddArtScreen( imageUrl: String?, // Displayed image onSaveClick: (String, String, String,String) -> Unit, // Emits form data upward modifier: Modifier = Modifier, onNavigateToImageSearch:() -> Unit, ...Nov 12, 2025·3 min read
Chapter 23 - Coding the Navigation Graph/** * ## AppNavGraph * * This composable function defines the **navigation graph** for the entire app. * * ### Responsibilities: * - Sets up navigation destinations (screens) for the app. * - Manages a **shared `ArtViewModel`** across multiple...Nov 12, 2025·5 min read
Chapter 22 - Updating the ArtViewModel for the Insert and Delete Use casesThe Insert and Delete Use Cases delegates the Room DB updates for insertion and deletion to the Repository. The ArtViewModel will implement the insert and delete cases. /** * Inserts a new artwork into the local database. * * @par...Nov 9, 2025·2 min read
Chapter 21 - Coding the Data layer for the InsertArtUseCase and DeleteArtUseCaseHere we implement the repository implementation class @Singleton class ArtRepositoryImpl @Inject constructor(private val artDao: ArtDao, private val imageApi:ImageApi, ...Nov 9, 2025·1 min read