Skip to content

Instantly share code, notes, and snippets.

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

Messias Junior MessiasLima

🏠
Working from home
View GitHub Profile
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json",
"basics": {
"name": "Messias Junior",
"label": "Android Engineer",
"email": "messiaslima.03@gmail.com",
"summary": "Senior Android Engineer with 8+ years of mobile specialization backed by a 12-year career in software engineering. Expert in Kotlin, Jetpack Compose, and Kotlin Multiplatform, with deep proficiency in Hilt and Kotlin Coroutines. Proven track record of delivering scalable Fintech and Travel solutions using clean architecture and modern Android SDK standards.",
"location": {
"countryCode": "PT",
"city": "Oporto"
{
"basics": {
"name": "Thomas Edison",
"label": "Inventor and Businessman",
"picture": "https://example.com/photo.jpg",
"email": "thomas.edison@example.com",
"phone": "(123) 456-7890",
"url": "https://thomasedison.com",
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.",
"location": {
@MessiasLima
MessiasLima / StoreViewModel.kt
Created March 7, 2022 21:01
StoreViewModelAfter.kt
import androidx.lifecycle.ViewModel
import com.messiaslima.promogamer.domain.Store
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
@FlowPreview
class StoreViewModel(private val storeOrchestrator: StoreOrchestrator) : ViewModel() {
private val retryTrigger = RetryTrigger()
@MessiasLima
MessiasLima / retryableFlow.kt
Created March 7, 2022 20:46
Retryable Flow implementation
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapConcat
import kotlinx.coroutines.flow.onEach
@FlowPreview
fun <T> retryableFlow(retryTrigger: RetryTrigger, flowProvider: () -> Flow<T>) =
retryTrigger.retryEvent.filter { it == RetryTrigger.State.RETRYING }
@MessiasLima
MessiasLima / SampleComposable.kt
Created March 7, 2022 20:32
Sample composable
@Composable
fun SampleComposable(viewModel: StoreViewModel = viewModel()){
val uiState by viewModel.uiState.collectAsState(initial = UiState.Idle)
// Some nice composables here
}
@MessiasLima
MessiasLima / SplashViewModelBefore.kt
Last active March 7, 2022 20:30
SplashViewModelBefore
import androidx.lifecycle.ViewModel
import com.messiaslima.promogamer.domain.Store
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
class StoreViewModel(private val storeOrchestrator: StoreOrchestrator) : ViewModel() {
val uiState = storeOrchestrator.getStores()
.map<List<Store>, UiState> { UiState.Success(it) }