Skip to content

Instantly share code, notes, and snippets.

View SamueldaCostaAraujoNunes's full-sized avatar
🏠
Working from home

Samuel da Costa Araujo Nunes SamueldaCostaAraujoNunes

🏠
Working from home
View GitHub Profile
package br.com.samuelnunes.valorantpassbattle.ui.view.viewsCustom
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Rect
import android.renderscript.*
import android.util.AttributeSet
import android.util.TypedValue
@SamueldaCostaAraujoNunes
SamueldaCostaAraujoNunes / RickAndMortyApp.kt
Created July 30, 2021 13:33
Hilt Annotation Application
@HiltAndroidApp
class RickAndMortyApp : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
}
}
package br.com.samuelnunes.rickandmortyapp.di
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
/**
* @author Samuel da Costa Araujo Nunes
* Created 30/07/2021 at 10:35
*/
<?xml version="1.0" encoding="utf-8"?>
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
app:defaultNavHost="true"
package br.com.samuelnunes.rickandmortyapp.ui.charactersFragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import br.com.samuelnunes.rickandmortyapp.databinding.CharactersFragmentBinding
import dagger.hilt.android.AndroidEntryPoint
package br.com.samuelnunes.rickandmortyapp.ui.charactersFragment
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@HiltViewModel
class CharactersViewModel @Inject constructor() : ViewModel()
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph.xml"
app:startDestination="@id/charactersFragment">
<fragment
android:id="@+id/charactersFragment"
android:name="br.com.samuelnunes.rickandmortyapp.ui.charactersFragment.CharactersFragment"
package br.com.samuelnunes.rickandmortyapp.ui
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Menu
import androidx.activity.viewModels
import androidx.appcompat.widget.SearchView
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/characters_rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="1"
package br.com.samuelnunes.rickandmortyapp.data.entities
data class Character(
val id: Int,
val name: String,
val status: String,
val species: String,
val type: String,
val gender: String,
val image: String