diff --git a/.editorconfig b/.editorconfig index 6c98409464..cdadfbb946 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,15 @@ [*.{kt,kts}] +ktlint_code_style=intellij_idea indent_size=2 continuation_indent_size=2 -insert_final_newline=true ij_kotlin_allow_trailing_comma=true ij_kotlin_allow_trailing_comma_on_call_site=true +insert_final_newline=true ktlint_standard_annotation=disabled -ktlint_standard_argument-list-wrapping=disabled -ktlint_standard_spacing-between-declarations-with-annotations=disabled +ktlint_standard_max-line-length=disabled ktlint_standard_filename=disabled -ktlint_standard_property-naming=disabled +ktlint_standard_discouraged-comment-location=disabled +ktlint_standard_class-signature=disabled +ktlint_standard_spacing-between-declarations-with-annotations=disabled +ktlint_standard_argument-list-wrapping=disabled +ktlint_experimental=enabled \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5afdf68865..7a36739135 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Install JDK ${{ matrix.java_version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: ${{ matrix.java_version }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 083432d8f9..6c4dc8836b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Install JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 17 diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index a8b1cdd727..f8a4b10c11 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Install JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 17 diff --git a/app/build.gradle b/app/build.gradle index 64c7ba4a80..d234f4e869 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ kotlin { android { namespace = "com.vanniktech.emoji.sample" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -54,7 +54,6 @@ android { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' shrinkResources true - zipAlignEnabled true if (shouldSign) { signingConfig signingConfigs.release diff --git a/build.gradle b/build.gradle index 2914d56b5d..fd635eab63 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,6 @@ codeQualityTools { } ktlint { toolVersion = libs.versions.ktlint.get() - experimental = true } detekt { enabled = false diff --git a/emoji-facebook/build.gradle b/emoji-facebook/build.gradle index 283acf924c..fbc0445f42 100644 --- a/emoji-facebook/build.gradle +++ b/emoji-facebook/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -64,7 +64,7 @@ kotlin { android { namespace "com.vanniktech.emoji.facebook" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt b/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt index 5f7a355ab3..276bb86594 100644 --- a/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt +++ b/emoji-facebook/src/commonMain/kotlin/com/vanniktech/emoji/facebook/FacebookEmoji.kt @@ -17,11 +17,8 @@ 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, internal val x: Int, @@ -29,8 +26,8 @@ import com.vanniktech.emoji.Parcelize override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: FacebookEmoji? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -71,7 +68,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "FacebookEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "FacebookEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-google-compat/build.gradle b/emoji-google-compat/build.gradle index 7fc91f4c13..1c78aef9f9 100644 --- a/emoji-google-compat/build.gradle +++ b/emoji-google-compat/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -65,7 +65,7 @@ kotlin { android { namespace "com.vanniktech.emoji.googlecompat" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt index 3231f41760..21ecb67a4a 100644 --- a/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt +++ b/emoji-google-compat/src/androidMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmojiDrawable.kt @@ -81,9 +81,7 @@ internal class GoogleCompatEmojiDrawable( } @Suppress("OVERRIDE_DEPRECATION") - override fun getOpacity(): Int { - return PixelFormat.UNKNOWN - } + override fun getOpacity(): Int = PixelFormat.UNKNOWN internal companion object { private const val TEXT_SIZE_FACTOR = 0.8f diff --git a/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt b/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt index 2c2f6000da..4b097d6e04 100644 --- a/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt +++ b/emoji-google-compat/src/commonMain/kotlin/com/vanniktech/emoji/googlecompat/GoogleCompatEmoji.kt @@ -17,18 +17,15 @@ 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, override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: GoogleCompatEmoji? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -57,9 +54,7 @@ import com.vanniktech.emoji.Parcelize return true } - override fun toString(): String { - return "GoogleCompatEmoji(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "GoogleCompatEmoji(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" override fun hashCode(): Int { var result = unicode.hashCode() diff --git a/emoji-google/build.gradle b/emoji-google/build.gradle index 6efe50d9cb..c014362914 100644 --- a/emoji-google/build.gradle +++ b/emoji-google/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -64,7 +64,7 @@ kotlin { android { namespace "com.vanniktech.emoji.google" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt b/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt index 2a362cd1ef..2b8b4c9b1e 100644 --- a/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt +++ b/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/GoogleEmoji.kt @@ -17,11 +17,8 @@ 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, internal val x: Int, @@ -29,8 +26,8 @@ import com.vanniktech.emoji.Parcelize override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: GoogleEmoji? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -71,7 +68,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "GoogleEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "GoogleEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-ios/build.gradle b/emoji-ios/build.gradle index 382217fdf2..2a98a0c23a 100644 --- a/emoji-ios/build.gradle +++ b/emoji-ios/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -64,7 +64,7 @@ kotlin { android { namespace "com.vanniktech.emoji.ios" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt b/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt index 420ca66741..80b4f056c8 100644 --- a/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt +++ b/emoji-ios/src/commonMain/kotlin/com/vanniktech/emoji/ios/IosEmoji.kt @@ -17,11 +17,8 @@ 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, internal val x: Int, @@ -29,8 +26,8 @@ import com.vanniktech.emoji.Parcelize override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: IosEmoji? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -71,7 +68,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "IosEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "IosEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji-material/api/current.txt b/emoji-material/api/current.txt index 110aeb0361..9ae33e51bd 100644 --- a/emoji-material/api/current.txt +++ b/emoji-material/api/current.txt @@ -2,9 +2,9 @@ package com.vanniktech.emoji.material { public class EmojiMaterialButton extends com.google.android.material.button.MaterialButton implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiMaterialButton(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); - ctor public EmojiMaterialButton(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiMaterialButton(android.content.Context context); + ctor public EmojiMaterialButton(android.content.Context context, optional android.util.AttributeSet? attrs); + ctor public EmojiMaterialButton(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -13,9 +13,9 @@ package com.vanniktech.emoji.material { } public class EmojiMaterialCheckBox extends com.google.android.material.checkbox.MaterialCheckBox implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiMaterialCheckBox(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); - ctor public EmojiMaterialCheckBox(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiMaterialCheckBox(android.content.Context context); + ctor public EmojiMaterialCheckBox(android.content.Context context, optional android.util.AttributeSet? attrs); + ctor public EmojiMaterialCheckBox(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -24,9 +24,9 @@ package com.vanniktech.emoji.material { } public class EmojiMaterialRadioButton extends com.google.android.material.radiobutton.MaterialRadioButton implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiMaterialRadioButton(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); - ctor public EmojiMaterialRadioButton(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiMaterialRadioButton(android.content.Context context); + ctor public EmojiMaterialRadioButton(android.content.Context context, optional android.util.AttributeSet? attrs); + ctor public EmojiMaterialRadioButton(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -35,9 +35,9 @@ package com.vanniktech.emoji.material { } public class EmojiTextInputEditText extends com.google.android.material.textfield.TextInputEditText implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiTextInputEditText(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); - ctor public EmojiTextInputEditText(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiTextInputEditText(android.content.Context context); + ctor public EmojiTextInputEditText(android.content.Context context, optional android.util.AttributeSet? attrs); + ctor public EmojiTextInputEditText(android.content.Context context, optional android.util.AttributeSet? attrs, optional @AttrRes int defStyleAttr); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); diff --git a/emoji-material/build.gradle b/emoji-material/build.gradle index 8cc49a4c8a..e1efc537e7 100644 --- a/emoji-material/build.gradle +++ b/emoji-material/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -65,7 +65,7 @@ kotlin { android { namespace "com.vanniktech.emoji.material" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-twitter/build.gradle b/emoji-twitter/build.gradle index 567d17e9ec..72324e6985 100644 --- a/emoji-twitter/build.gradle +++ b/emoji-twitter/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -64,7 +64,7 @@ kotlin { android { namespace "com.vanniktech.emoji.twitter" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt b/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt index 065a8ae61c..018f1e8d7c 100644 --- a/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt +++ b/emoji-twitter/src/commonMain/kotlin/com/vanniktech/emoji/twitter/TwitterEmoji.kt @@ -17,11 +17,8 @@ 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, internal val x: Int, @@ -29,8 +26,8 @@ import com.vanniktech.emoji.Parcelize override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: TwitterEmoji? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -71,7 +68,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "TwitterEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "TwitterEmoji(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/emoji/api/current.txt b/emoji/api/current.txt index bcb041e4e3..97132fe87c 100644 --- a/emoji/api/current.txt +++ b/emoji/api/current.txt @@ -1,10 +1,7 @@ // Signature format: 4.0 package com.vanniktech.emoji { - public final class CommonParcelableAndroidApiKt { - } - - public interface Emoji extends android.os.Parcelable { + public interface Emoji { method public com.vanniktech.emoji.Emoji getBase(); method public java.util.List getShortcodes(); method public String getUnicode(); @@ -23,8 +20,8 @@ package com.vanniktech.emoji { } public class EmojiAutoCompleteTextView extends androidx.appcompat.widget.AppCompatAutoCompleteTextView implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiAutoCompleteTextView(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiAutoCompleteTextView(android.content.Context context); + ctor public EmojiAutoCompleteTextView(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -33,8 +30,8 @@ package com.vanniktech.emoji { } public class EmojiButton extends androidx.appcompat.widget.AppCompatButton implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiButton(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiButton(android.content.Context context); + ctor public EmojiButton(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -50,8 +47,8 @@ package com.vanniktech.emoji { } public class EmojiCheckbox extends androidx.appcompat.widget.AppCompatCheckBox implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiCheckbox(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiCheckbox(android.content.Context context); + ctor public EmojiCheckbox(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -68,8 +65,8 @@ package com.vanniktech.emoji { } public class EmojiEditText extends androidx.appcompat.widget.AppCompatEditText implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiEditText(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiEditText(android.content.Context context); + ctor public EmojiEditText(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -111,8 +108,8 @@ package com.vanniktech.emoji { } public class EmojiMultiAutoCompleteTextView extends androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiMultiAutoCompleteTextView(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiMultiAutoCompleteTextView(android.content.Context context); + ctor public EmojiMultiAutoCompleteTextView(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -121,20 +118,20 @@ package com.vanniktech.emoji { } public final class EmojiPopup { - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, optional com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, optional com.vanniktech.emoji.listeners.OnEmojiPopupDismissListener? onEmojiPopupDismissListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, optional com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji); - ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming); ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, optional com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener); + ctor public EmojiPopup(android.view.View rootView, android.widget.EditText editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer, optional @StyleRes int keyboardAnimationStyle, optional int popupWindowHeight, optional com.vanniktech.emoji.listeners.OnEmojiPopupShownListener? onEmojiPopupShownListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener? onSoftKeyboardCloseListener, optional com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener? onSoftKeyboardOpenListener, optional com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, optional com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, optional com.vanniktech.emoji.listeners.OnEmojiPopupDismissListener? onEmojiPopupDismissListener); method public void dismiss(); method public boolean isShowing(); method public void show(); @@ -162,8 +159,8 @@ package com.vanniktech.emoji { } public class EmojiTextView extends androidx.appcompat.widget.AppCompatTextView implements com.vanniktech.emoji.EmojiDisplayable { - ctor public EmojiTextView(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiTextView(android.content.Context context); + ctor public EmojiTextView(android.content.Context context, optional android.util.AttributeSet? attrs); method public float getEmojiSize(); method public void setEmojiSize(@Px int pixels); method public void setEmojiSize(@Px int pixels, boolean shouldInvalidate); @@ -198,14 +195,14 @@ package com.vanniktech.emoji { } public final class EmojiView extends android.widget.LinearLayout { - ctor public EmojiView(android.content.Context context, optional android.util.AttributeSet? attrs); ctor public EmojiView(android.content.Context context); - method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer); - method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji); - method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji); - method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji); - method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming); + ctor public EmojiView(android.content.Context context, optional android.util.AttributeSet? attrs); method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText); + method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming); + method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji); + method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji); + method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji); + method public void setUp(android.view.View rootView, com.vanniktech.emoji.listeners.OnEmojiClickListener? onEmojiClickListener, com.vanniktech.emoji.listeners.OnEmojiBackspaceClickListener? onEmojiBackspaceClickListener, android.widget.EditText? editText, optional com.vanniktech.emoji.EmojiTheming theming, optional com.vanniktech.emoji.recent.RecentEmoji recentEmoji, optional com.vanniktech.emoji.search.SearchEmoji searchEmoji, optional com.vanniktech.emoji.variant.VariantEmoji variantEmoji, optional androidx.viewpager.widget.ViewPager.PageTransformer? pageTransformer); method public void tearDown(); } @@ -235,10 +232,7 @@ package com.vanniktech.emoji.inputfilters { package com.vanniktech.emoji.internal { public final class ParcelableUtilsKt { - method public static inline T! parcelable(android.os.Bundle, String key); - } - - public final class UtilsKt { + method public static inline T? parcelable(android.os.Bundle, String key); } } @@ -287,8 +281,8 @@ package com.vanniktech.emoji.recent { } public final class RecentEmojiManager implements com.vanniktech.emoji.recent.RecentEmoji { - ctor public RecentEmojiManager(android.content.Context context, optional int maxRecents); ctor public RecentEmojiManager(android.content.Context context); + ctor public RecentEmojiManager(android.content.Context context, optional int maxRecents); method public void addEmoji(com.vanniktech.emoji.Emoji emoji); method public java.util.Collection getRecentEmojis(); method public void persist(); diff --git a/emoji/build.gradle b/emoji/build.gradle index 8ddae88506..0fd0bb8454 100644 --- a/emoji/build.gradle +++ b/emoji/build.gradle @@ -21,7 +21,7 @@ metalava { version = VERSION_NAME kotlin { - android("android") { + androidTarget("android") { publishLibraryVariants("release") } // ios("ios") @@ -71,7 +71,7 @@ kotlin { android { namespace "com.vanniktech.emoji" - compileSdkVersion libs.versions.compileSdk.get() as int + compileSdk(libs.versions.compileSdk.get() as int) compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiTheming.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiTheming.kt index 59eb707b57..3e18f4bff0 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiTheming.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/EmojiTheming.kt @@ -19,8 +19,10 @@ package com.vanniktech.emoji import android.content.Context +import android.os.Parcelable import androidx.annotation.ColorInt import com.vanniktech.emoji.internal.Utils +import kotlinx.parcelize.Parcelize /** Control the colors of all Emoji UI components. */ @Parcelize data class EmojiTheming( diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/commonParcelableAndroidApi.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/commonParcelableAndroidApi.kt deleted file mode 100644 index 697b4c1e5f..0000000000 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/commonParcelableAndroidApi.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.vanniktech.emoji - -actual typealias Parcelable = android.os.Parcelable -actual typealias Parcelize = kotlinx.parcelize.Parcelize -actual typealias IgnoredOnParcel = kotlinx.parcelize.IgnoredOnParcel diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt index ce046d43b7..09959d7b96 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/inputfilters/OnlyEmojisInputFilter.kt @@ -22,10 +22,8 @@ import com.vanniktech.emoji.isOnlyEmojis /** InputFilter that only accepts emojis. */ class OnlyEmojisInputFilter : InputFilter { - override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? { - return when { - !source.subSequence(start, end).isOnlyEmojis() -> "" // Reject. - else -> null - } + override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? = when { + !source.subSequence(start, end).isOnlyEmojis() -> "" // Reject. + else -> null } } diff --git a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/internal/EmojiSearchDialog.kt b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/internal/EmojiSearchDialog.kt index 6c8df7416d..9f8cc9cbff 100644 --- a/emoji/src/androidMain/kotlin/com/vanniktech/emoji/internal/EmojiSearchDialog.kt +++ b/emoji/src/androidMain/kotlin/com/vanniktech/emoji/internal/EmojiSearchDialog.kt @@ -160,6 +160,8 @@ internal class EmojiAdapter( setHasStableIds(true) } + override fun getItemId(position: Int) = items[position].emoji.hashCode().toLong() + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = EmojiViewHolder(parent) override fun onBindViewHolder(holder: EmojiViewHolder, position: Int) { diff --git a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/Emoji.kt b/emoji/src/commonMain/kotlin/com/vanniktech/emoji/Emoji.kt index 8299e8102c..9633e2cd74 100644 --- a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/Emoji.kt +++ b/emoji/src/commonMain/kotlin/com/vanniktech/emoji/Emoji.kt @@ -16,7 +16,7 @@ package com.vanniktech.emoji -interface Emoji : Parcelable { +interface Emoji { val base: Emoji val unicode: String val shortcodes: List diff --git a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/commonParcelableApi.kt b/emoji/src/commonMain/kotlin/com/vanniktech/emoji/commonParcelableApi.kt deleted file mode 100644 index c455a5a675..0000000000 --- a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/commonParcelableApi.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.vanniktech.emoji - -expect interface Parcelable - -@OptIn(ExperimentalMultiplatform::class) -@OptionalExpectation -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.BINARY) -expect annotation class Parcelize() - -@OptIn(ExperimentalMultiplatform::class) -@OptionalExpectation -@Target(AnnotationTarget.PROPERTY) -@Retention(AnnotationRetention.SOURCE) -expect annotation class IgnoredOnParcel() diff --git a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/search/SearchEmojiManager.kt b/emoji/src/commonMain/kotlin/com/vanniktech/emoji/search/SearchEmojiManager.kt index a2d0f47937..f77a7b40fb 100644 --- a/emoji/src/commonMain/kotlin/com/vanniktech/emoji/search/SearchEmojiManager.kt +++ b/emoji/src/commonMain/kotlin/com/vanniktech/emoji/search/SearchEmojiManager.kt @@ -25,7 +25,7 @@ class SearchEmojiManager : SearchEmoji { return when { query.length > 1 -> categories.flatMap { it.emojis.toList() } .mapNotNull { emoji -> - emoji.shortcodes.mapNotNull { shortcode -> + emoji.shortcodes.firstNotNullOfOrNull { shortcode -> val index = shortcode.indexOf(query, ignoreCase = true) if (index >= 0) { @@ -37,8 +37,9 @@ class SearchEmojiManager : SearchEmoji { } else { null } - }.firstOrNull() + } } + .sortedWith(compareBy({ it.range.first }, { it.shortcode })) else -> emptyList() } } diff --git a/emoji/src/commonTest/kotlin/com/vanniktech/emoji/TestEmoji.kt b/emoji/src/commonTest/kotlin/com/vanniktech/emoji/TestEmoji.kt index 82ffd17126..f546e58468 100644 --- a/emoji/src/commonTest/kotlin/com/vanniktech/emoji/TestEmoji.kt +++ b/emoji/src/commonTest/kotlin/com/vanniktech/emoji/TestEmoji.kt @@ -1,12 +1,12 @@ package com.vanniktech.emoji -@Parcelize data class TestEmoji( +data class TestEmoji( override val unicode: String, override val shortcodes: List, override val isDuplicate: Boolean, override val variants: List = emptyList(), private var parent: TestEmoji? = null, -) : Emoji, Parcelable { +) : Emoji { constructor( codePoints: IntArray, shortcodes: List, @@ -14,7 +14,7 @@ package com.vanniktech.emoji variants: List = emptyList(), ) : this(String(codePoints, 0, codePoints.size), shortcodes, isDuplicate, variants) - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! diff --git a/emoji/src/jvmMain/kotlin/com/vanniktech/emoji/commonParcelableJvmApi.kt b/emoji/src/jvmMain/kotlin/com/vanniktech/emoji/commonParcelableJvmApi.kt deleted file mode 100644 index 1a06cde4de..0000000000 --- a/emoji/src/jvmMain/kotlin/com/vanniktech/emoji/commonParcelableJvmApi.kt +++ /dev/null @@ -1,6 +0,0 @@ - -@file:Suppress("ktlint:standard:filename") - -package com.vanniktech.emoji - -actual interface Parcelable diff --git a/generator/index.js b/generator/index.js index 90e840a4f2..046c2e2156 100644 --- a/generator/index.js +++ b/generator/index.js @@ -16,7 +16,6 @@ import commandLineArgs from "command-line-args" import fs from "fs-extra" -import stable from "stable" import chunk from "lodash.chunk"; import template from "lodash.template"; import imagemin from "imagemin"; @@ -279,7 +278,7 @@ async function parse() { const result = new Map(); const filteredEmojiData = emojiData.filter(it => it.category !== "Component"); - const preparedEmojiData = stable(filteredEmojiData, (first, second) => first.sort_order - second.sort_order); + const preparedEmojiData = [...filteredEmojiData].sort((first, second) => first.sort_order - second.sort_order); for (const dataEntry of preparedEmojiData) { const category = dataEntry.category.replace(" & ", "And"); @@ -392,7 +391,7 @@ async function generateCode(map, targets) { const emojiProviderCompatTemplate = await fs.readFile("template/EmojiProviderCompat.kt", "utf-8"); const emojiProviderJvm = await fs.readFile("template/EmojiProviderJvm.kt", "utf-8"); - const entries = stable([...map.entries()], (first, second) => { + const entries = [...map.entries()].sort((first, second) => { return categoryInfo.findIndex(it => it.name === first[0]) - categoryInfo.findIndex(it => it.name === second[0]); }); diff --git a/generator/package.json b/generator/package.json index 491eb0b8a6..e9dedd6c0f 100644 --- a/generator/package.json +++ b/generator/package.json @@ -22,7 +22,6 @@ "imagemin-zopfli": "^7.0.0", "jimp": "^0.22.0", "lodash.chunk": "^4.2.0", - "lodash.template": "^4.5.0", - "stable": "^0.1.6" + "lodash.template": "^4.5.0" } } diff --git a/generator/template/Emoji.kt b/generator/template/Emoji.kt index 6681dec3cd..6556762c2f 100644 --- a/generator/template/Emoji.kt +++ b/generator/template/Emoji.kt @@ -17,11 +17,8 @@ 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, internal val x: Int, @@ -29,8 +26,8 @@ import com.vanniktech.emoji.Parcelize override val isDuplicate: Boolean, override val variants: List<<%= name %>> = emptyList(), private var parent: <%= name %>? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -71,7 +68,5 @@ import com.vanniktech.emoji.Parcelize return result } - override fun toString(): String { - return "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, x=$x, y=$y, isDuplicate=$isDuplicate, variants=$variants)" } diff --git a/generator/template/EmojiCompat.kt b/generator/template/EmojiCompat.kt index 458c2630bb..fc4b5750f5 100644 --- a/generator/template/EmojiCompat.kt +++ b/generator/template/EmojiCompat.kt @@ -17,18 +17,15 @@ 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, override val isDuplicate: Boolean, override val variants: List<<%= name %>> = emptyList(), private var parent: <%= name %>? = null, -) : Emoji, Parcelable { - @IgnoredOnParcel override val base by lazy(LazyThreadSafetyMode.NONE) { +) : Emoji { + override val base by lazy(LazyThreadSafetyMode.NONE) { var result = this while (result.parent != null) { result = result.parent!! @@ -57,9 +54,7 @@ import com.vanniktech.emoji.Parcelize return true } - override fun toString(): String { - return "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" - } + override fun toString() = "<%= name %>(unicode='$unicode', shortcodes=$shortcodes, isDuplicate=$isDuplicate, variants=$variants)" override fun hashCode(): Int { var result = unicode.hashCode() diff --git a/generator/yarn.lock b/generator/yarn.lock index 9ce7564ef0..5bd0f27287 100644 --- a/generator/yarn.lock +++ b/generator/yarn.lock @@ -1185,7 +1185,7 @@ imagemin-pngquant@^9.0.2: execa "^4.0.0" is-png "^2.0.0" is-stream "^2.0.0" - ow "^0.17.0" + ow "^0.18.0-SNAPSHOT" pngquant-bin "^6.0.0" imagemin-zopfli@^7.0.0: @@ -1684,9 +1684,9 @@ os-filter-obj@^2.0.0: dependencies: arch "^2.1.0" -ow@^0.17.0: - version "0.17.0" - resolved "https://registry.npmjs.org/ow/-/ow-0.17.0.tgz" +ow@^0.18.0-SNAPSHOT: + version "0.18.0-SNAPSHOT" + resolved "https://registry.npmjs.org/ow/-/ow-0.18.0-SNAPSHOT.tgz" integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== dependencies: type-fest "^0.11.0" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 32b8812c4b..58730e6be2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,17 @@ [versions] minSdk = "21" -compileSdk = "33" -targetSdk = "33" +compileSdk = "34" +targetSdk = "34" androidgradleplugin = "8.1.1" -kotlin = "1.8.22" -ktlint = "0.50.0" +kotlin = "1.9.21" +ktlint = "1.0.1" [libraries] androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" } androidx-cardview = { module = "androidx.cardview:cardview", version = "1.0.0" } androidx-emoji-appcompat = { module = "androidx.emoji:emoji-appcompat", version = "1.1.0" } -androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.1" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" } androidx-test-espresso = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" } androidx-test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" } androidx-test-rules = { module = "androidx.test:rules", version = "1.5.0" } @@ -26,16 +26,16 @@ leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", ve material = { module = "com.google.android.material:material", version = "1.10.0" } plugin-android-cache-fix = { module = "org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin", version = "3.0" } plugin-androidgradleplugin = { module = "com.android.tools.build:gradle", version.ref = "androidgradleplugin" } -plugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.0" } +plugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.10" } plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } plugin-licensee = { module = "app.cash.licensee:licensee-gradle-plugin", version = "1.8.0" } -plugin-metalava = { module = "me.tylerbwong.gradle.metalava:plugin", version = "0.3.3" } +plugin-metalava = { module = "me.tylerbwong.gradle.metalava:plugin", version = "0.3.5" } plugin-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.25.3" } -robolectric = { module = "org.robolectric:robolectric", version = "4.10.3" } +robolectric = { module = "org.robolectric:robolectric", version = "4.11.1" } screengrab = { module = "tools.fastlane:screengrab", version = "2.1.1" } timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" } ui = { module = "com.vanniktech:ui", version = "0.8.0" } [plugins] -codequalitytools = { id = "com.vanniktech.code.quality.tools", version = "0.23.0" } +codequalitytools = { id = "com.vanniktech.code.quality.tools", version = "0.24.0" } dependencygraphgenerator = { id = "com.vanniktech.dependency.graph.generator", version = "0.8.0" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d11cdd907d..e6aba2515d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME