In a basic sense this library is a wrapper class for Twemoji, targetting the Android platform. All icons have been split into their unicode-given categories and converted to WebP resources. Each category has a class which for now is a very basic object with val
references to drawables. At the moment, subcategories are not accessible but are present, if there is a need for such granualarity then these can also be made available.
If you're like me and have lots of good app ideas but not enough artistic skill to draw yourself a set of icons then this might be the library for you! Imagine a registration form where users are required to sign up with their phone number. More than likely users are going to need to pick their country code and instead of display some simple digits, why not accompany those digits with a flag icon?
Due to the vast array and diverse pool of emoji these days it is only fitting that developers can use these emoji as icons, and instead of said developers having to do most of the work manually, picking out the icons they want, you could use this library to pick out the icon set(s) applicable for your project.
This project will be kept up-to-date and include new emoji as the unicode & Twemoji spec is updated and currently follows version v13.1.
In this repository will you find the library itself (core project and categories) and in addition a sample app (written in Compose) which implements each module and loads the icons into a LazyGrid
. Just in case you don't want to go and run the sample yourself, he's a couple of screenshots:
- Smileys & emotion
- People & body
- Animals & nature
- Food & drink
- Travel & places
- Activities
- Objects
- Symbols
- Flags
Alternatively you can visit the Category and Subcategory classes respectively, but please not that subcategories are not publicly accessible at the moment.
The library is currently provided via JitPack so first be sure that your project is already setup for accessing JitPack dependencies.
The latest version of twemoji-icons-android is 0.2.0
.
If you would like to have access to the entire icons set then you can simple add the following to your apps build.gradle
file, in the dependencies closure:
implementation 'com.github.maxhvesser:twemoji-icons-android:0.2.0'
If you would however like access to specific categories then you would need to add the following:
// Abstract the version to your root build.gradle
ext {
...
twemoji_icons_version = '0.2.0'
}
// Continue with app build.gradle dependencies
...
// The core dependency must be present because this is where the model classes live
implementation "com.github.maxhvesser.twemoji-icons-android:core:$twemoji_icons_version"
// Next you can add the categories you want access to
implementation "com.github.maxhvesser.twemoji-icons-android:smileys:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:people:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:animals:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:food:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:travel:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:activities:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:objects:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:symbols:$twemoji_icons_version"
implementation "com.github.maxhvesser.twemoji-icons-android:flags:$twemoji_icons_version"
Each category (module) has it's own providing class that is an object with statically defined references, these providers can be accessed via the following:
SmileysAndEmotion.all
PeopleAndBody.all
AnimalsAndNature.all
FoodAndDrink.all
TravelAndPlaces.all
Activities.all
Objects.all
Symbols.all
Flags.all
Whereby each provider, provides a List<EmojiIcon>
, EmojiIcon
provides the following properties:
/**
* @property name A camelCase string representation of the emoji icon aka it's name
* @property unicode The unicode equivalent of the emoji icon
* @property category The belonging-to-category
* @property subcategory The belonging-to-subcategory
* @property font The font set, which in this case is always Twemoji
* @property resource The drawable reference statically defined in the provider class
*/
data class EmojiIcon(
val name: String,
val unicode: String,
val category: TwemojiCategory,
val subcategory: TwemojiSubcategory,
val font: Font,
@DrawableRes val resource: Int
)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.