Repository navigation
Conversation
…roguard configuration.
This commit addresses several points from the issue:
1. **ViewModel Interaction (Issue 2):**
I refactored `PokemonListScreen` and `PokemonDetailScreen` to use lambda functions for event callbacks to child composables (`EmptyErrorState`, `PokemonList`, `PokemonDetailed`, etc.). This replaces direct ViewModel passing, improving composable reusability and testability.
2. **Repository Location (Issue 4):**
I moved the `PokemonRepo.kt` (repository interface) from the `repo` package to the `domain` package within the `core-base` module. All import statements have been updated accordingly. This aligns the project with clean architecture principles.
3. **Unused Files (Issue 3):**
I removed empty `proguard-rules.pro` and `consumer-rules.pro` files from `core-base`, `core-ui`, `features/pokemonDetail`, and `features/pokemonList` modules.
I also updated the corresponding `build.gradle.kts` files to remove references to these deleted files, simplifying the build configurations.
4. **LazyColumn Performance (Issue 1):**
I reviewed the usage of `LazyColumn` extensions in `PokemonListScreen`. The existing pagination logic, which relies on `LazyListState` attributes, was confirmed to be correctly using `derivedStateOf`. No further changes were needed for this point based on the initial issue description.
I've added necessary JVM arguments (`--add-opens`) to `gradle.properties` to allow Kotlin Kapt to access internal Java compiler APIs. This addresses the `java.lang.IllegalAccessError: class ... cannot access class com.sun.tools.javac.main.JavaCompiler (in module jdk.compiler)` error that occurs when using Kapt (e.g., for Room) with JDK versions 16 and above due to Java Platform Module System (JPMS) restrictions. The `core-base` module uses Kapt for Room's annotation processor, which was triggering this error.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: Improve ViewModel interactions, repository structure, and Proguard configuration.
This commit addresses several points from the issue:
ViewModel Interaction (Issue 2):
I refactored
PokemonListScreenandPokemonDetailScreento use lambda functions for event callbacks to child composables (EmptyErrorState,PokemonList,PokemonDetailed, etc.). This replaces direct ViewModel passing, improving composable reusability and testability.Repository Location (Issue 4):
I moved the
PokemonRepo.kt(repository interface) from therepopackage to thedomainpackage within thecore-basemodule. All import statements have been updated accordingly. This aligns the project with clean architecture principles.Unused Files (Issue 3):
I removed empty
proguard-rules.proandconsumer-rules.profiles fromcore-base,core-ui,features/pokemonDetail, andfeatures/pokemonListmodules.I also updated the corresponding
build.gradle.ktsfiles to remove references to these deleted files, simplifying the build configurations.LazyColumn Performance (Issue 1):
I reviewed the usage of
LazyColumnextensions inPokemonListScreen. The existing pagination logic, which relies onLazyListStateattributes, was confirmed to be correctly usingderivedStateOf. No further changes were needed for this point based on the initial issue description.