Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network e Repository(Paging) layers implementados. #2

Merged
merged 4 commits into from May 21, 2021

Conversation

LucasCabralDevv
Copy link
Owner

Foi criado:

a camada de network em um modulo usando koin.

a classe de paginação (usando a biblioteca paging3), que esta sendo utilizada no viewModel dentro da função getListData. A activity através desta função observará as mudanças de paginação e notificará o Adapter.

OBS: Futuramente penso em fazer algumas modificações para deixar o código escalável e melhor testável. A classe criada para fazer a paginação não trabalha como um repositório em si. Como estou usando o paging3 pela primeira vez, resolvi fazer primeiro dessa maneira. Também penso em fazer cache das páginas usando room.
Após fazer essa modificações, consigo trabalhar melhor com o koin e criar os modulos para o repository e viewModel.

Link trello:
https://trello.com/c/XrDUhcKv/49-projeto-final-marvel-cria%C3%A7%C3%A3o-da-camada-de-repository-do-projeto

Copy link
Collaborator

@Lhmsouza Lhmsouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No geral, muito bom, bem organizado e seguindo boas práticas de programação. Deixei alguns comentários e alguns links de recomendações, mas pra um primeiro PR tá super bacana. 😄

.idea/discord.xml Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
Lucas Cabral added 3 commits May 21, 2021 09:24

val viewModelModule = module {

single { AllCharactersViewModel() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aqui poderia usar viewModel { AllCharactersViewModel() }, mas acredito que com um single funcione também.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vou testar.

@LucasCabralDevv LucasCabralDevv merged commit 621e23a into trunk May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants