Skip to content

PublicPhoto is a library which enables you to fetch user's public photo as published on Gravatar. If no image is published against the given email, then you can fetch a palceholder instead (similar to Github & Stackoverflow).

License

Notifications You must be signed in to change notification settings

TusharGogna/PublicPhoto

Repository files navigation

PublicPhoto

PublicPhoto is a library which enables you to fetch user's public photo as published on Gravatar. If no image is published against the given email, then you can fetch a palceholder instead (similar to Github & Stackoverflow).

How to use:

In your Settings.gradle.kts, add:

    maven { url = uri("https://jitpack.io") }

and in your app level build.gradle.kts, add:

    implementation("com.github.TusharGogna:PublicPhoto:LATEST_VERSION")

Current version is 1.0

Then, in order to fetch the public Gravatar photo, simply call the method: getPublicPhoto(...) which returns a URL in the form of a String. The method looks something like this:

    getPublicPhoto(EMAIL (String), IMAGE_SIZE (Int), IS_DEFAULT (Boolean) , DEFAULT_IMAGE_TYPE (ENUM of Type PlaceHolderType))

Example:

  getPublicPhoto("[email protected]", 400, true, PlaceHolderType.ROBOHASH)

Similarly, you can use different PlaceHolderType as per your needs. Following are the different types available:

MP
IDENTICON
MONSTERID
WAVATAR
RETRO
ROBOHASH
BLANK
Screenshot 2023-12-11 at 11 24 11 PM

About

PublicPhoto is a library which enables you to fetch user's public photo as published on Gravatar. If no image is published against the given email, then you can fetch a palceholder instead (similar to Github & Stackoverflow).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages