Skip to content

Instantly share code, notes, and snippets.

View SteveKamau72's full-sized avatar

Steve Kamau SteveKamau72

View GitHub Profile
@SteveKamau72
SteveKamau72 / RxBroadcastReceiver.java
Created January 14, 2020 12:28 — forked from magillus/RxBroadcastReceiver.java
RxJava2.0 Broadcast Receiver for getting intent broadcasts as Observable<Intent>
/**
* RxJava based broadcast reciever that registers its local BroadcastReceiver until end of subscription.
* Listens for update and passes Intent to the Stream (Subscriber).
*
* Copyright 2016 Mateusz Perlak - http://www.apache.org/licenses/LICENSE-2.0
* Created on 11/18/16.
*/
public class RxBroadcastReceiver implements ObservableOnSubscribe<Intent> {
protected final WeakReference<Context> contextWeakReference;
{
"data": [{
"view_type": "viewpager",
"section_title": "New items",
"section_data": [{
"image": "https://dummyimage.com/600x400/000/fff"
}, {
"image": "https://dummyimage.com/600x400/000/fff"
}, {
"image": "https://dummyimage.com/600x400/000/fff"
@SteveKamau72
SteveKamau72 / ImageDownloadManager.java
Created October 6, 2020 13:54 — forked from bpr10/ImageDownloadManager.java
This is a simple ImageDownloader which uses Picasso do download images and write them to a folder.
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.squareup.picasso.MemoryPolicy;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.RequestCreator;