app / sg.edu.ntu.scse.cz2006.gymbuddies.util / ProfilePicHelper

ProfilePicHelper

object ProfilePicHelper

Helper class for handling profile pictures in the application

For sg.edu.ntu.scse.cz2006.gymbuddies.util in Gym Buddies!

Author
Kenneth Soh

Since
2019-09-09

Types

ProfilePicOneTimeListener

Internal interface for Profile Picture One Time Listener

interface ProfilePicOneTimeListener

Properties

profilePic

A global profile picture storeage area

var profilePic: RoundedBitmapDrawable?

profilePicUpdateListener

Add to this list if you wish to receive an update when the profile pic updates

val profilePicUpdateListener: ArrayList<ProfilePicOneTimeListener>

Functions

getBitmap

Internal method to generate a bitmap from a vectorDrawable

fun getBitmap(vectorDrawable: VectorDrawable): Bitmap
fun getBitmap(vectorDrawable: VectorDrawableCompat): Bitmap

Generates a bitmap from a drawableResId in the app drawable folder. Requires an application context to use

fun getBitmap(context: Context, drawableResId: Int): Bitmap

getImageBitmap

Generates a bitmap given a url to the image to download and generate

fun getImageBitmap(url: String): Bitmap?

updateCall

Internal method called after updating the profile pic

fun updateCall(): Unit