Rick And Morty App
?? 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/
Technology / Others
- Couroutines
- JetPack Navigation Component
- Koin
- View Model
- RecyclerView
- Retrofit
- Live Data
- Core splashscreen
- MVVM
- Fragments
About the api / Sobre a api
Link to the api documentation: https://rickandmortyapi.com/
I used the following routes:
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
Curiosities / Curiosidades
I would like to show a very cool curiosity about one of the items returned in the api object
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
)
}
The Nav Graph
The beta version app / A versão beta do app
Success
Splash screen and home
2022_01_20_13_02_36.mp4
Random single character
2022_01_20_13_03_01.mp4
Type number to get a single character
2022_01_20_13_03_31.mp4
Random list of the characters
2022_01_20_13_03_58.mp4
Just navigate between pages
2022_01_20_13_04_33.mp4
Error tratament
The number you entered is incorrect
2022_01_20_13_15_59.mp4
Details Exception
2022_01_20_13_17_17.mp4
List Exception
2022_01_20_13_17_47.mp4