Skip to content

Commit

Permalink
Breaking change: Emoji is no longer Parcelable.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed Dec 10, 2023
1 parent 4b61d7d commit 9843e6f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ package com.vanniktech.emoji.facebook

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class FacebookEmoji internal constructor(
internal class FacebookEmoji internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
internal val x: Int,
internal val y: Int,
override val isDuplicate: Boolean,
override val variants: List<FacebookEmoji> = emptyList(),
private var parent: FacebookEmoji? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ package com.vanniktech.emoji.googlecompat

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class GoogleCompatEmoji internal constructor(
internal class GoogleCompatEmoji internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
override val isDuplicate: Boolean,
override val variants: List<GoogleCompatEmoji> = emptyList(),
private var parent: GoogleCompatEmoji? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ package com.vanniktech.emoji.google

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class GoogleEmoji internal constructor(
internal class GoogleEmoji internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
internal val x: Int,
internal val y: Int,
override val isDuplicate: Boolean,
override val variants: List<GoogleEmoji> = emptyList(),
private var parent: GoogleEmoji? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ package com.vanniktech.emoji.ios

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class IosEmoji internal constructor(
internal class IosEmoji internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
internal val x: Int,
internal val y: Int,
override val isDuplicate: Boolean,
override val variants: List<IosEmoji> = emptyList(),
private var parent: IosEmoji? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ package com.vanniktech.emoji.twitter

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class TwitterEmoji internal constructor(
internal class TwitterEmoji internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
internal val x: Int,
internal val y: Int,
override val isDuplicate: Boolean,
override val variants: List<TwitterEmoji> = emptyList(),
private var parent: TwitterEmoji? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
2 changes: 1 addition & 1 deletion emoji/src/commonMain/kotlin/com/vanniktech/emoji/Emoji.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.vanniktech.emoji

interface Emoji : Parcelable {
interface Emoji {
val base: Emoji
val unicode: String
val shortcodes: List<String>
Expand Down
6 changes: 2 additions & 4 deletions generator/template/Emoji.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ package com.vanniktech.emoji.<%= package %>

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class <%= name %> internal constructor(
internal class <%= name %> internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
internal val x: Int,
internal val y: Int,
override val isDuplicate: Boolean,
override val variants: List<<%= name %>> = emptyList(),
private var parent: <%= name %>? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down
6 changes: 2 additions & 4 deletions generator/template/EmojiCompat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ package com.vanniktech.emoji.<%= package %>

import com.vanniktech.emoji.Emoji
import com.vanniktech.emoji.IgnoredOnParcel
import com.vanniktech.emoji.Parcelable
import com.vanniktech.emoji.Parcelize

@Parcelize internal class <%= name %> internal constructor(
internal class <%= name %> internal constructor(
override val unicode: String,
override val shortcodes: List<String>,
override val isDuplicate: Boolean,
override val variants: List<<%= name %>> = emptyList(),
private var parent: <%= name %>? = null,
) : Emoji, Parcelable {
) : Emoji {
@IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) {
var result = this
while (result.parent != null) {
Expand Down

0 comments on commit 9843e6f

Please sign in to comment.