-
public final class DownloadableEmojiPack extends FileBasedEmojiPack
An emoji pack that can be downloaded through the UI. These packs are (usually) manually created and added to the EmojiPackList to offer a set of options to choose from as a used.
-
-
Field Summary
Fields Modifier and Type Field Description private VersiondownloadedVersionprivate Stringidprivate Stringnameprivate Stringdescriptionprivate Uriwebsiteprivate Urilicenseprivate StringdescriptionLongprivate BooleantintableIcon
-
Constructor Summary
Constructors Constructor Description DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong, Boolean tintableIcon, String hash)DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong, Boolean tintableIcon)DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong)DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license)DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website)DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version)
-
Method Summary
Modifier and Type Method Description final VersiongetDownloadedVersion()final UnitsetDownloadedVersion(Version downloadedVersion)final StringgetId()final UnitsetId(String id)final StringgetName()final UnitsetName(String name)final StringgetDescription()final UnitsetDescription(String description)final UrigetWebsite()final UnitsetWebsite(Uri website)final UrigetLicense()final UnitsetLicense(Uri license)final StringgetDescriptionLong()final UnitsetDescriptionLong(String descriptionLong)final BooleangetTintableIcon()final UnitsetTintableIcon(Boolean tintableIcon)final Unitdownload(File emojiStorage)Downloads the pack final DownloadStatusgetDownloadStatus()final BooleanisDownloaded()final BooleanisDownloading()final UnitcancelDownload()StringgetFileName()Returns the bare file name for a pack. final StringgetFileName(Boolean forDownloadedVersion)Returns the file name (i.e. final BooleanisCurrentVersion()Returns whether the version currently downloaded is the current one. DrawablegetIcon(Context context)Returns the icon for this emoji pack. -
Methods inherited from class de.c1710.filemojicompat_ui.packs.FileBasedEmojiPack
addDeletionListener, cancelDeletion, isGettingDeleted, removeDeletionListener, scheduleDeletion -
Methods inherited from class de.c1710.filemojicompat_ui.packs.DeletableEmojiPack
addSelectionListener, getVersion, removeSelectionListener, select, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong, Boolean tintableIcon, String hash)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.website- The URL of the website/repository for the emoji packlicense- The URL of the license for the emoji pack (This might be auto-downloaded in the future, so it should point to a rather small/plaintext file, if possible)descriptionLong- A longer description that is shown when the user expands the item for the emoji pack.hash- A SHA-256 hash that is used to confirm that the correct file has been downloaded.
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong, Boolean tintableIcon)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.website- The URL of the website/repository for the emoji packlicense- The URL of the license for the emoji pack (This might be auto-downloaded in the future, so it should point to a rather small/plaintext file, if possible)descriptionLong- A longer description that is shown when the user expands the item for the emoji pack.
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license, String descriptionLong)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.website- The URL of the website/repository for the emoji packlicense- The URL of the license for the emoji pack (This might be auto-downloaded in the future, so it should point to a rather small/plaintext file, if possible)descriptionLong- A longer description that is shown when the user expands the item for the emoji pack.
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website, Uri license)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.website- The URL of the website/repository for the emoji packlicense- The URL of the license for the emoji pack (This might be auto-downloaded in the future, so it should point to a rather small/plaintext file, if possible)
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version, Uri website)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.website- The URL of the website/repository for the emoji pack
-
DownloadableEmojiPack
DownloadableEmojiPack(String id, String name, Uri source, String description, Drawable icon, VersionProvider version)
- Parameters:
id- A unique name for the pack.name- The user-facing name of the pack.source- The URL to download the TTF-file from.description- The (short) user-facing description that is visible in the normal emoji pickericon- An icon for the pack, e.g.version- The current version of the pack.
-
-
Method Detail
-
getDownloadedVersion
final Version getDownloadedVersion()
-
setDownloadedVersion
final Unit setDownloadedVersion(Version downloadedVersion)
-
getDescription
final String getDescription()
-
setDescription
final Unit setDescription(String description)
- Parameters:
description- The (short) user-facing description that is visible in the normal emoji picker
-
getWebsite
final Uri getWebsite()
-
setWebsite
final Unit setWebsite(Uri website)
- Parameters:
website- The URL of the website/repository for the emoji pack
-
getLicense
final Uri getLicense()
-
setLicense
final Unit setLicense(Uri license)
- Parameters:
license- The URL of the license for the emoji pack (This might be auto-downloaded in the future, so it should point to a rather small/plaintext file, if possible)
-
getDescriptionLong
final String getDescriptionLong()
-
setDescriptionLong
final Unit setDescriptionLong(String descriptionLong)
- Parameters:
descriptionLong- A longer description that is shown when the user expands the item for the emoji pack.
-
getTintableIcon
final Boolean getTintableIcon()
-
setTintableIcon
final Unit setTintableIcon(Boolean tintableIcon)
- Parameters:
tintableIcon- Whether the icon should get a tint (if specified by the theme)
-
download
@Synchronized() final Unit download(File emojiStorage)
Downloads the pack
- Parameters:
emojiStorage- The directory to download the pack into (usually retrieved through EmojiPackList.emojiStorage)
-
getDownloadStatus
final DownloadStatus getDownloadStatus()
-
isDownloaded
final Boolean isDownloaded()
-
isDownloading
@Synchronized() final Boolean isDownloading()
-
cancelDownload
@Synchronized() final Unit cancelDownload()
-
getFileName
String getFileName()
Returns the bare file name for a pack. To actually get the (maybe not even existing) file, you need to prefix it with a directory
-
getFileName
final String getFileName(Boolean forDownloadedVersion)
Returns the file name (i.e. font.ttf or with a version) for the font.
- Parameters:
forDownloadedVersion- Whether or not to use downloadedVersion as the version to generate the file name (otherwise, version is used).
-
isCurrentVersion
final Boolean isCurrentVersion()
Returns whether the version currently downloaded is the current one.
-
getIcon
Drawable getIcon(Context context)
Returns the icon for this emoji pack. Note: This is done as a function, because at the time the pack object is created, the Context.getTheme might not be initialized yet, so a pre-set icon might be wrongly themed. However, if the icon is theme-independent, it may be stored permanently
-
-
-
-