aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt
blob: 6fbcced19b81b09a8f212da427b2615077d6f557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.pitchedapps.frost.utils

import android.content.Context
import com.bumptech.glide.Glide

/**
 * Created by Allan Wang on 2017-05-31.
 */
object GlideUtils {

    lateinit var applicationContext: Context

    operator fun invoke(applicationContext: Context) {
        this.applicationContext = applicationContext
    }

    fun downloadForLater(url: String) {
        Glide.with(applicationContext).download(url)
    }

    fun downloadProfile(id: Long) {
        L.d("Downloading profile photo")
        downloadForLater("http://graph.facebook.com/$id/picture?type=large")
    }

}