Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	filemojicompat-ui/build.gradle
  • Loading branch information
C1710 committed Oct 29, 2022
2 parents 80fdbdc + 22091fb commit 56a8090
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 24 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ The library is available on Maven Central, Github Packages are **not** maintaine
Integrating this library is done in a few steps.
1. To use `Emoji2` without special widgets, you should use `androidx.appcompat` >= `1.4.0`. This way, all AppCompat components are already EmojiCompat-enabled.
2. You need to include a dependency for the library in your app's `build.gradle`. It is split into four parts - you only need one of these:
| Package name | Description |
|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`de.c1710:filemojicompat:3.2.2`](https://search.maven.org/artifact/de.c1710/filemojicompat) | The main library part. It supports emoji fonts to be placed in your app's `data` directory. Works like FilemojiCompat 2 |
| [`de.c1710:filemojicompat-ui:3.2.2`](https://search.maven.org/artifact/de.c1710/filemojicompat-ui) | Includes an emoji picker and an emoji pack management. Can be integrated with `androidx.preferences`. Recommended |
| [`de.c1710:filemojicompat-defaults:3.2.2`](https://search.maven.org/artifact/de.c1710/filemojicompat-defaults) | A default list of four downloadable emoji packs: Blobmoji, Noto-Emoji, Openmoji and Twemoji. Recommended if the app has internet permissions |
| [`de.c1710:filemojicompat-autoinit:3.2.2`](https://search.maven.org/artifact/de.c1710/filemojicompat-autoinit) | An extension for `filemojicompat-defaults` which uses the `androidx.startup` library to directly initialize EmojiCompat with FilemojiCompat without having to modify your `Application` class, similar to how `Emoji2` would work. Recommended if you don't want to change the defaults or add any other emoji packs. |
| Package name | Description |
|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `de.c1710:filemojicompat:3.2.6` | The main library part. It supports emoji fonts to be placed in your app's `data` directory. Works like FilemojiCompat 2 |
| `de.c1710:filemojicompat-ui:3.2.6` | Includes an emoji picker and an emoji pack management. Can be integrated with `androidx.preferences`. Recommended |
| `de.c1710:filemojicompat-defaults:3.2.6` | A default list of four downloadable emoji packs: Blobmoji, Noto-Emoji, Openmoji and Twemoji. Recommended if the app has internet permissions |
| `de.c1710:filemojicompat-autoinit:3.2.6` | An extension for `filemojicompat-defaults` which uses the `androidx.startup` library to directly initialize EmojiCompat with FilemojiCompat without having to modify your `Application` class, similar to how `Emoji2` would work. Recommended if you don't want to change the defaults or add any other emoji packs. |
3. If you don't want to use the emoji picker, you can continue with the [instructions for FilemojiCompat 2 below](#old-instructions-for-filemojicompat-2-maybe-not-up-to-date).
Otherwise, you need to initialize EmojiCompat/Emoji2/FilemojiCompat. If you use `filemojicompat-autoinit`, you can skip this step.
In your main `Application`''s `onCreate` function, the initialization can be done with one line (this example is for Kotlin, but it is the same for Java):
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildscript {

ext {
kotlin_version = '1.6.10'
kotlin_version = '1.7.10'
}
repositories {
google()
Expand Down
4 changes: 2 additions & 2 deletions filemojicompat-defaults/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
api project(path: ':filemojicompat-ui')
}
7 changes: 7 additions & 0 deletions filemojicompat-defaults/icons/ic_fluent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@ class DefaultEmojiPackList {
URI("https://github.com/C1710/blobmoji/raw/main/fonts/BlobmojiCompat.ttf"),
context.resources.getString(R.string.blobmoji_description),
ResourcesCompat.getDrawable(context.resources, R.drawable.ic_blobmoji, null),
Version(intArrayOf(14, 0, 1)),
Version(intArrayOf(15, 0)),
Uri.parse("https://github.com/C1710/blobmoji"),
Uri.parse("https://raw.githubusercontent.com/C1710/blobmoji/emoji14/LICENSE"),
context.resources.getString(R.string.blobmoji_description_long),
tintableIcon = false
)

val fluent = DownloadableEmojiPack (
"fluent",
context.resources.getString(R.string.fluent_broken_name),
URI("https://github.com/C1710/fluentui-emoji/raw/main/fonts/FluentEmojiCompat.ttf"),
context.resources.getString(R.string.fluent_description),
ResourcesCompat.getDrawable(context.resources, R.drawable.ic_fluent, null),
Version(intArrayOf(14, 0)),
Uri.parse("https://github.com/microsoft/fluentui-emoji"),
Uri.parse("https://github.com/microsoft/fluentui-emoji/blob/main/LICENSE"),
context.resources.getString(R.string.fluent_description_long),
tintableIcon = false
)

val noto = DownloadableEmojiPack (
"noto",
"Noto Emoji",
Expand Down Expand Up @@ -58,15 +71,15 @@ class DefaultEmojiPackList {
URI("https://github.com/C1710/openmoji/raw/master/fonts/OpenMojiCompat.ttf"),
context.resources.getString(R.string.openmoji_description),
ResourcesCompat.getDrawable(context.resources, R.drawable.ic_openmoji, null),
Version(intArrayOf(13, 1)),
Version(intArrayOf(14, 0, 1)),
Uri.parse("https://openmoji.org/"),
Uri.parse("https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/LICENSE.txt"),
context.resources.getString(R.string.openmoji_description_long),
tintableIcon = false
)

// Using alphabetical order here (although Blobmoji would probably stay on top anyway :P)
return arrayListOf(blobmoji, noto, openmoji, twemoji)
return arrayListOf(blobmoji, noto, openmoji, twemoji, fluent)
}
}
}
9 changes: 9 additions & 0 deletions filemojicompat-defaults/src/main/res/drawable/ic_fluent.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector android:autoMirrored="true" android:height="32dp"
android:viewportHeight="32" android:viewportWidth="32"
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFB02E" android:pathData="M15.9989,29.9978C25.3333,29.9978 29.9978,23.7303 29.9978,15.9989C29.9978,8.2675 25.3333,2 15.9989,2C6.6644,2 2,8.2675 2,15.9989C2,23.7303 6.6644,29.9978 15.9989,29.9978Z"/>
<path android:fillColor="#402A32" android:pathData="M8.9816,11.1909C9.0296,10.9436 9.1397,10.6405 9.349,10.4125C9.5283,10.2171 9.847,10 10.4999,10C11.1417,10 11.4685,10.2216 11.6572,10.4288C11.8753,10.6683 11.9804,10.9737 12.0147,11.1711C12.1092,11.7152 12.6269,12.0797 13.171,11.9853C13.7152,11.8908 14.0797,11.373 13.9852,10.8289C13.9062,10.374 13.6799,9.6794 13.1357,9.082C12.562,8.4522 11.6955,8 10.4999,8C9.3156,8 8.4527,8.4313 7.8755,9.0601C7.3283,9.6564 7.107,10.3533 7.0183,10.8091C6.9129,11.3513 7.2669,11.8762 7.8091,11.9816C8.3512,12.087 8.8761,11.733 8.9816,11.1909Z"/>
<path android:fillColor="#402A32" android:pathData="M19.9818,11.1909C20.0299,10.9436 20.14,10.6405 20.3492,10.4125C20.5285,10.2171 20.8472,10 21.5002,10C22.1419,10 22.4687,10.2216 22.6574,10.4288C22.8756,10.6683 22.9807,10.9737 23.0149,11.1711C23.1094,11.7152 23.6271,12.0797 24.1713,11.9853C24.7154,11.8908 25.0799,11.373 24.9854,10.8289C24.9064,10.374 24.6802,9.6794 24.1359,9.082C23.5623,8.4522 22.6957,8 21.5002,8C20.3159,8 19.4529,8.4313 18.8758,9.0601C18.3285,9.6564 18.1072,10.3533 18.0186,10.8091C17.9132,11.3513 18.2672,11.8762 18.8093,11.9816C19.3514,12.087 19.8764,11.733 19.9818,11.1909Z"/>
<path android:fillColor="#F70A8D" android:pathData="M18.3683,22.3683L15.5,19.5L23.5,16L24.455,18.292C25.2894,20.2946 24.2473,22.5842 22.1892,23.2703C20.8475,23.7175 19.3683,23.3683 18.3683,22.3683Z"/>
<path android:fillColor="#402A32" android:pathData="M8.4001,15.2C8.8419,14.8686 9.4687,14.9582 9.8001,15.4C10.0981,15.7973 11.7922,17.5 16.0001,17.5C20.2079,17.5 21.9021,15.7973 22.2001,15.4C22.5314,14.9582 23.1582,14.8686 23.6001,15.2C24.0419,15.5314 24.1314,16.1582 23.8001,16.6C23.0981,17.536 20.7922,19.5 16.0001,19.5C11.2079,19.5 8.9021,17.536 8.2001,16.6C7.8687,16.1582 7.9582,15.5314 8.4001,15.2Z"/>
</vector>
3 changes: 3 additions & 0 deletions filemojicompat-defaults/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
<string name="twemoji_description_long">Ein Emoji-Paket, das an vielen Stellen im Internet gefunden werden kann, darunter Twitter oder Mastodon.\n<i>CC BY 4.0, Copyright 2020 Twitter, Inc and other contributors\nAngepasst auf die Nutzung mit EmojiCompat</i></string>
<string name="openmoji_description">Ein open-source Emoji-Paket</string>
<string name="openmoji_description_long">Ein relativ neues Emoji-Paket mit einem minimalistischen Design.\n<i>All emojis designed by OpenMoji – the open-source emoji and icon project. License: CC BY-SA 4.0\nAngepasst auf die Nutzung mit EmojiCompat</i></string>
<string name="fluent_description">Die neuen Emojis von Microsoft</string>
<string name="fluent_description_long">Das frische, neue Emoji-Paket in seiner flachen Version\n<i>Copyright (c) Microsoft Corporation.\nAngepasst auf die Nutzung mit EmojiCompat</i>\nDerzeit fehlen Emojis mit Hauttönen, sowie die Büroklammer.</string>
<string name="fluent_broken_name">Fluent Emoji (derzeit unvollständig)</string>
</resources>
3 changes: 3 additions & 0 deletions filemojicompat-defaults/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
<string name="twemoji_description_long">Twemoji is an emoji pack that can be found on many platforms throughout the internet, including Twitter and Mastodon.\n<i>CC BY 4.0, Copyright 2020 Twitter, Inc and other contributors\nAdapted for usage with EmojiCompat</i></string>
<string name="openmoji_description">An open-source emoji pack</string>
<string name="openmoji_description_long">A rather recent emoji pack featuring a minimalistic style.\n<i>All emojis designed by OpenMoji – the open-source emoji and icon project. License: CC BY-SA 4.0\nAdapted for usage with EmojiCompat</i></string>
<string name="fluent_description">The new emojis from Microsoft</string>
<string name="fluent_description_long">The fresh, new emoji pack in its flat version.\n<i>Copyright (c) Microsoft Corporation.\nAdapted for usage with EmojiCompat</i>\nCurrently, emojis with skin tones, and the paperclip emoji are missing.</string>
<string name="fluent_broken_name">Fluent Emoji (currently incomplete)</string>
</resources>
18 changes: 8 additions & 10 deletions filemojicompat-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
implementation 'androidx.activity:activity-ktx:1.5.1'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.5.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation "androidx.multidex:multidex:2.0.1"
// We don't want to use an alpha version of okhttp here
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.emoji2:emoji2:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'androidx.emoji2:emoji2:1.2.0'
api project(path: ':filemojicompat')
}
2 changes: 1 addition & 1 deletion filemojicompat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.emoji2:emoji2:1.1.0'
implementation 'androidx.emoji2:emoji2:1.2.0'
}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android.useAndroidX=true


# Some config for maven
VERSION_NAME=3.2.2
VERSION_NAME=3.2.6
GROUP=de.c1710

POM_URL=https://github.com/c1710/filemojicompat
Expand Down

0 comments on commit 56a8090

Please sign in to comment.