🇧🇷 Aplicativo com tema do Rick and Morty, interatividade com seleção aleatória de personagens e listas, são 826 personagens que podem ser vistos na tela de detalhes e 42 listas com vários personagens da série, veja os detalhes de cada um deles e descubra curiosidades sobre todos eles! Ahhh mas eu não quero sortear uma lista ou um personagem, eu gostaria de passar por todos eles e olhar as curiosidades... Você pode, basta clicar no botão "Just navigate" na tela de menu das listas, ele irá te levar para a primeira página e você poderá paginar entre as 42 páginas, indo e voltando da maneira que quiser!
🇺🇸 Application with the theme of Rick and Morty, interactivity with random selection of characters and lists, are 826 characters that can be seen on the details screen and 42 lists with various characters from the series, see the details of each of them and discover curiosities about them all! Ahhh but I don't want to random a list or a character, I would like to go through them all and look at the curiosities... You can, just click on the "Just navigate" button on the menu screen of the lists, it will take you to the first page and you can scroll between the 42 pages, going back and forth as you like!
Link to the api documentation: https://rickandmortyapi.com/
- Couroutines
- JetPack Navigation Component
- Koin
- View Model
- RecyclerView
- Retrofit
- Live Data
- Core splashscreen
- MVVM
- Fragments
Link to the api documentation: https://rickandmortyapi.com/
To get a single character with id:
I used this method to get a specify character:
@GET("character/{id}")
suspend fun getSingleCharacter(
@Path("id") id: String
): SingleCharacter
To get a list of characters, you need to specify the page number... Case you don't specify the api will give to you just first page. :
- https://rickandmortyapi.com/api/character (just a first page)
- https://rickandmortyapi.com/api/character/?page=2 (will bring up page 2)
I used this method to get a specify list:
@GET("character/")
suspend fun getListCharacter(
@Query("page") page: String
): ListCharacterResponse
The character's life status can be returned in 3 different strings Alive, Dead, Unknown... To validate this point, I created a class that sends a ready-made object with the colors, texts, and the image that should appear on the screen...
enum class StatusCharacter(
@StringRes val status: Int,
@ColorRes val textColor: Int,
@DrawableRes val iconImg: Int,
) {
STATUS_ALIVE(
status = R.string.txt_status_alive,
textColor = Color.GREEN,
iconImg = R.drawable.alive_status
),
STATUS_DEAD(
status = R.string.txt_status_dead,
textColor = Color.RED,
iconImg = R.drawable.dead_status
),
STATUS_UNKNOWN(
status = R.string.txt_status_unknown,
textColor = Color.GRAY,
iconImg = R.drawable.unknow_status
)
}