Skip to content

Instantly share code, notes, and snippets.

View TinasheMzondiwa's full-sized avatar

Tinashe Mzondiwa TinasheMzondiwa

View GitHub Profile
@TinasheMzondiwa
TinasheMzondiwa / AndroidWorkerInjection.kt
Last active February 14, 2024 08:29
Android Dagger 2 Setup with Work Manager
import androidx.work.Worker
import dagger.Module
import dagger.android.AndroidInjector
import dagger.android.ContributesAndroidInjector
import dagger.multibindings.Multibinds
object AndroidWorkerInjection {
fun inject(worker: Worker) {
val application = worker.applicationContext
@TinasheMzondiwa
TinasheMzondiwa / RxFirebase.kt
Last active November 15, 2017 12:04
RxFirebase using kotlin
import com.google.android.gms.tasks.Task
import com.google.firebase.database.*
import io.reactivex.Observable
/**
* Created by tinashe on 2017/11/15.
*/
object RxFirebase {
@TinasheMzondiwa
TinasheMzondiwa / RxFirebase.java
Created October 14, 2016 09:56
RxFirebase implementation. Fork from https://gist.github.com/gsoltis/86210e3259dcc6998801 with my improvements.
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import rx.Observable;
import rx.Subscriber;