Skip to content

Instantly share code, notes, and snippets.

Avatar
😄
Learning

Juan Antonio Cobos Obrero juancoob

😄
Learning
View GitHub Profile
@juancoob
juancoob / PlacesViewModel.java
Last active April 17, 2022 19:35
This is my place ViewModel to load all nearest places by selected type from my location
View PlacesViewModel.java
package com.juancoob.nanodegree.and.vegginner.viewmodel;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.Transformations;
import android.arch.lifecycle.ViewModel;
import android.arch.paging.LivePagedListBuilder;
import android.arch.paging.PagedList;
import com.juancoob.nanodegree.and.vegginner.data.places.ISearchApiService;
@juancoob
juancoob / PlacesFragment.java
Last active April 17, 2022 19:36
ItemKeyedDataSource is not calling LoadAfter and my list is not filled. I think I have a race condition
View PlacesFragment.java
package com.juancoob.nanodegree.and.vegginner.ui.places;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.arch.lifecycle.ViewModelProviders;
import android.arch.paging.PagedList;
import android.content.Context;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.location.Location;