Skip to content

Commit

Permalink
chore(doc): update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed May 3, 2024
1 parent 3dc4fe5 commit 1ff7613
Showing 1 changed file with 1 addition and 109 deletions.
110 changes: 1 addition & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Android Emojify     [![Release](https://jitpack.io/v/anitrend/android-emojify.svg)](https://jitpack.io/#anitrend/android-emojify)   [![Codacy Badge](https://app.codacy.com/project/badge/Grade/6bace5612f8c4799ac86f104f5b2db0f)](https://www.codacy.com/gh/AniTrend/android-emojify/dashboard?utm_source=github.com&utm_medium=referral&utm_content=AniTrend/android-emojify&utm_campaign=Badge_Grade)   [![gradle-unit-test](https://github.com/AniTrend/android-emojify/actions/workflows/android-test.yml/badge.svg)](https://github.com/AniTrend/android-emojify/actions/workflows/android-test.yml)
# Android Emojify     [![Release](https://jitpack.io/v/anitrend/android-emojify.svg)](https://jitpack.io/#anitrend/android-emojify)   [![Codacy Badge](https://app.codacy.com/project/badge/Grade/6bace5612f8c4799ac86f104f5b2db0f)](https://www.codacy.com/gh/AniTrend/android-emojify/dashboard?utm_source=github.com&utm_medium=referral&utm_content=AniTrend/android-emojify&utm_campaign=Badge_Grade)   [![gradle-unit-test](https://github.com/AniTrend/android-emojify/actions/workflows/android-unit-test.yml/badge.svg)](https://github.com/AniTrend/android-emojify/actions/workflows/android-test.yml)

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FAniTrend%2Fandroid-emojify.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FAniTrend%2Fandroid-emojify?ref=badge_large)

Expand Down Expand Up @@ -36,114 +36,6 @@ emojis from [emojipedia](https://emojipedia.org/)**
returned [Spanned](https://developer.android.com/reference/android/text/Spanned.html) from
whichever framework you're using. (See sample in project)

## Migration

### From v0.x.x - v1.x.x

A quick run overview of some of the changes, see the rest of the changes under __Examples__
section. `EmojiManager.initEmojiData` has also been refactored
to throw exceptions rather than consuming them.

> See the __Getting Started__ section, and you can find more example in the library unit tests,
> e.g. `EmojiUtilTest.kt`
```java
import io.wax911.emojify.EmojiUtils; //becomes -> io.wax911.emojify.parser.EmojiParser;

EmojiUtils.emojify(); //becomes -> EmojiParser.parseToUnicode();
EmojiUtils.htmlify (); //becomes -> EmojiParser.parseToHtmlDecimal();
EmojiUtils.hexHtmlify(); //becomes -> EmojiParser.parseToHtmlHexadecimal();
EmojiUtils.shortCodify(); //becomes -> EmojiParser.parseToAliases();
```

> Starting v1.X conversion is only possible from `emoji -> hexHtml, decHtml or shortCodes`
> and `hexHtml, decHtml or shortCodes -> emoji`
> unlike in previous versions where you could convert hexHtml to decHtml or shortCodes & vice-versa.
>
> ```
> .
> ├── io
> │   └── wax911
> │   └── emojify
> │   ├── EmojiManager.kt
> │   ├── model
> │   │   └── Emoji.kt
> │   ├── parser
> │   │   └── EmojiParser.kt
> │   └── util
> │   ├── EmojiTrie.kt
> │   └── Fitzpatrick.kt
> ```
>
> __N.B Package names have been changed and would require refactoring, except for `EmojiManager`__
###

### From v1.x.x - v1.6.0

Starting from **v1.6.0** the project has had some parts rewritten, specifically `EmojiParser`
, `EmojiManager` and added support
for **[androidx.startup](https://developer.android.com/topic/libraries/app-startup#kotlin)** please
take the time to read the short description on what this does.

> __See [CHANGELOG.md](./CHANGELOG.md) for a detailed list of changes__
#### Summary of changes

- `EmojiManager` has been converted from an `object` to a class with the following
signature: `class EmojiManager(val emojiList: Collection<Emoji>)`. This has been done to allow **
you** to use your own emoji list and no longer required to explicitly initialize anything as
previously with a call to `EmojiManager.initEmojiData`
- `EmojiParser` has been converted to a set of extension function that are applied on
the `EmojiManager` see examples below:

```kotlin
// getting our emoji manager from our application class through an extension function
// see ./app/src/main/java/io/wax911/emojifysample/App.kt
val emojiManager = context.emojiManager()
EmojiParser.parseToUnicode(); //becomes -> emojiManager.parseToUnicode();
EmojiParser.parseToHtmlDecimal (); //becomes -> emojiManager.parseToHtmlDecimal();
EmojiParser.parseToHtmlHexadecimal(); //becomes -> emojiManager.parseToHtmlHexadecimal();
EmojiParser.parseToAliases(); //becomes -> emojiManager.parseToAliases();
```

##### New project structure

> ```sh
> .
> └── io
> └── wax911
> └── emojify
> ├── EmojiManager.kt
> ├── initializer
> │   └── EmojiInitializer.kt
> ├── manager
> │   └── IEmojiManager.kt
> ├── model
> │   └── Emoji.kt
> ├── parser
> │   ├── action
> │   │   └── FitzpatrickAction.kt
> │   ├── candidate
> │   │   ├── AliasCandidate.kt
> │   │   └── UnicodeCandidate.kt
> │   ├── common
> │   │   └── EmojiTransformer.kt
> │   ├── EmojiParser.kt
> │   └── transformer
> │   └── EmojiTransformer.kt
> └── util
> ├── EmojiTree.kt
> ├── Fitzpatrick.kt
> └── tree
> ├── Matches.kt
> └── Node.kt
> ```
> __N.B `EmojiManger` has been converted to class, thus an instance needs to be obtained
from `EmojiInitializer`
through [androidx.startup](https://developer.android.com/topic/libraries/app-startup#disable-individual#kotlin)
or manually create an instance of the class on your own__.

## Use Case

Trying to get emoji support in your application in a way that is both compatible with a browser and
Expand Down

0 comments on commit 1ff7613

Please sign in to comment.