From b5bfd08ffb7f5f84f3730a8140115b4413c16690 Mon Sep 17 00:00:00 2001 From: Kieran W <41634689+FredHappyface@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:46:10 +0000 Subject: [PATCH] add haptic feedback and enable search options --- app/build.gradle.kts | 5 ++-- .../fredhappyface/ewesticker/ImageKeyboard.kt | 24 ++++++++++++---- .../fredhappyface/ewesticker/MainActivity.kt | 2 ++ .../ewesticker/adapter/StickerPackAdapter.kt | 6 ++++ app/src/main/res/layout/activity_main.xml | 28 +++++++++++++++++++ app/src/main/res/values-ar/strings.xml | 2 ++ app/src/main/res/values-bn/strings.xml | 2 ++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-hi/strings.xml | 2 ++ app/src/main/res/values-in/strings.xml | 4 ++- app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-ko/strings.xml | 2 ++ app/src/main/res/values-pt/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-ur/strings.xml | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ build.gradle.kts | 2 +- .../-sticker-pack-adapter.md | 2 +- .../-sticker-pack-adapter/index.md | 4 +-- .../index.md | 2 +- .../get-sticker-packs-from-pref.md | 6 ---- .../-shared-pref-helper/index.md | 12 -------- .../index.md | 1 - .../app/com.fredhappyface.ewesticker/index.md | 2 +- .../trim-string.md | 18 +++++++++++- documentation/reference/app/package-list | 6 ++-- 30 files changed, 113 insertions(+), 39 deletions(-) delete mode 100644 documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/get-sticker-packs-from-pref.md delete mode 100644 documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/index.md diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c587d46..37bdd56 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,13 +24,14 @@ tasks.register("genDocs") { dependsOn("dokkaGfm") doLast { copy { - from("$ref/index.md") - into(ref) + from("${ref.get()}/index.md") + into(ref.get()) rename { "README.md" } } } } + android { compileSdk = 34 buildToolsVersion = "34.0.0" diff --git a/app/src/main/java/com/fredhappyface/ewesticker/ImageKeyboard.kt b/app/src/main/java/com/fredhappyface/ewesticker/ImageKeyboard.kt index 4fd808d..62f0143 100644 --- a/app/src/main/java/com/fredhappyface/ewesticker/ImageKeyboard.kt +++ b/app/src/main/java/com/fredhappyface/ewesticker/ImageKeyboard.kt @@ -50,6 +50,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { private var restoreOnClose = false private var vertical = false private var scroll = false + private var vibrate = false private var iconsPerX = 0 private var iconSize = 0 @@ -108,6 +109,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { this.restoreOnClose = this.sharedPreferences.getBoolean("restoreOnClose", false) this.vertical = this.sharedPreferences.getBoolean("vertical", false) this.scroll = this.sharedPreferences.getBoolean("scroll", false) + this.vibrate = this.sharedPreferences.getBoolean("vibrate", true) this.iconsPerX = this.sharedPreferences.getInt("iconsPerX", 3) this.totalIconPadding = @@ -247,7 +249,12 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { stickers = loadedPacks[packName]?.stickerList ?: return } val recyclerView = RecyclerView(this) - val adapter = StickerPackAdapter(iconSize, stickers, this, gestureDetector) + val adapter = StickerPackAdapter( + iconSize, + stickers, + this, + gestureDetector, + this.vibrate) val layoutManager = GridLayoutManager( this, iconsPerX, @@ -299,6 +306,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { stickers.take(128).toTypedArray(), this, gestureDetector, + this.vibrate, ) val layoutManager = GridLayoutManager( baseContext, @@ -351,7 +359,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { val sText = buttonView.findViewById(R.id.secondaryText) sText.text = secondaryChar button.setOnClickListener { - if (SDK_INT >= Build.VERSION_CODES.O_MR1) { + if (this.vibrate && SDK_INT >= Build.VERSION_CODES.O_MR1) { it.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_PRESS) } tap((it.tag as Array)[0]) @@ -416,10 +424,14 @@ class ImageKeyboard : InputMethodService(), StickerClickListener { closeKeyboard() } } - val searchButton = addPackButton("__search__") - searchButton.load(getDrawable(R.drawable.search_circle)) - searchButton.setOnClickListener { - searchView() + + // Search + if (this.sharedPreferences.getBoolean("showSearchButton", true)) { + val searchButton = addPackButton("__search__") + searchButton.load(getDrawable(R.drawable.search_circle)) + searchButton.setOnClickListener { + searchView() + } } // Recent val recentPackName = "__recentSticker__" diff --git a/app/src/main/java/com/fredhappyface/ewesticker/MainActivity.kt b/app/src/main/java/com/fredhappyface/ewesticker/MainActivity.kt index 89aa94c..52f866b 100644 --- a/app/src/main/java/com/fredhappyface/ewesticker/MainActivity.kt +++ b/app/src/main/java/com/fredhappyface/ewesticker/MainActivity.kt @@ -56,6 +56,8 @@ class MainActivity : AppCompatActivity() { seekBar(findViewById(R.id.iconsPerXSb), findViewById(R.id.iconsPerXLbl), "iconsPerX", 3) seekBar(findViewById(R.id.iconSizeSb), findViewById(R.id.iconSizeLbl), "iconSize", 80, 20) toggle(findViewById(R.id.showBackButton), "showBackButton", true) {} + toggle(findViewById(R.id.showSearchButton), "showSearchButton", true) {} + toggle(findViewById(R.id.vibrate), "vibrate", true) {} toggle(findViewById(R.id.vertical), "vertical") { isChecked: Boolean -> findViewById(R.id.iconSizeSb).isEnabled = !isChecked } diff --git a/app/src/main/java/com/fredhappyface/ewesticker/adapter/StickerPackAdapter.kt b/app/src/main/java/com/fredhappyface/ewesticker/adapter/StickerPackAdapter.kt index d8133c7..c44b35c 100644 --- a/app/src/main/java/com/fredhappyface/ewesticker/adapter/StickerPackAdapter.kt +++ b/app/src/main/java/com/fredhappyface/ewesticker/adapter/StickerPackAdapter.kt @@ -1,6 +1,8 @@ package com.fredhappyface.ewesticker.adapter +import android.os.Build import android.view.GestureDetector +import android.view.HapticFeedbackConstants import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView @@ -15,6 +17,7 @@ class StickerPackAdapter( private val stickers: Array, private val listener: StickerClickListener, private val gestureDetector: GestureDetector, + private val vibrate: Boolean, ) : RecyclerView.Adapter() { @@ -33,6 +36,9 @@ class StickerPackAdapter( holder.stickerThumbnail.tag = stickerFile holder.stickerThumbnail.setOnClickListener { val file = it.tag as File + if (vibrate && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { + it.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_PRESS) + } listener.onStickerClicked(file) } holder.stickerThumbnail.setOnLongClickListener { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index e4fa916..9012fb9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -175,6 +175,34 @@ android:text="@string/options_show_back_button" /> + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index d616aba..f500f25 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -20,6 +20,8 @@ الخيارات إظهار زر الرجوع في شريط التنقل + تمكين البحث + تغذية هزازة عند الضغط على المفتاح استخدام تخطيط عمودي استعادة لوحة المفاتيح السابقة عند إغلاق لوحة المفاتيح تمكين التمرير بين الحزم (عرضيًا لاتجاه التمرير) diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index bdfcd44..39d66cc 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -20,6 +20,8 @@ বিকল্পসমূহ ন্যাভবারে ব্যাক বাটন দেখান + অনুসন্ধান সক্ষম করুন + কী-প্রেসে হ্যাপটিক প্রতিক্রিয়া ভার্টিক্যাল লেআউট ব্যবহার করুন কীবোর্ড বন্ধ হলে পূর্বের কীবোর্ড পুনরুদ্ধার করুন প্যাক মধ্যে স্বাইপ সক্রিয় করুন (স্ক্রল দিকে লম্ব) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d23d521..a22c115 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -20,6 +20,8 @@ Optionen Zurück-Button in der Navigationsleiste anzeigen + Suche aktivieren + Haptisches Feedback bei Tastendruck Vertikales Layout verwenden Vorherige Tastatur wiederherstellen, wenn Tastatur geschlossen wird Wischen zwischen Packs aktivieren (senkrecht zur Scrollrichtung) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1c6f027..5b8e301 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -20,6 +20,8 @@ Opciones Mostrar botón atrás en navbar + Habilitar búsqueda + Comentarios hápticos al presionar teclas Usar layout vertical Restaurar el teclado anterior al cerrar el teclado Habilitar el deslizamiento entre paquetes (perpendicular a la dirección de desplazamiento) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f5110b9..937c12d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -19,6 +19,8 @@ - Total: Options Afficher le bouton dans la barre de navigation + Activer la recherche + Retour haptique lors de l’appui sur une touche Utiliser la mise en page verticale Restaurer le clavier précédent en fermant le clavier Permet de glisser entre les paquets (perpendiculaire à la direction de défilement) diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 8055e60..4990d2f 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -19,6 +19,8 @@ विकल्प नैविगेशन बार में बैक बटन दिखाएं + खोज सक्षम करें + कुंजी-दबाने पर हैप्टिक प्रतिक्रिया उद्देश्य खगोल उपयोग करें कीबोर्ड बंद होने पर पिछली स्थिति को पुनर्स्थापित करें पैक के बीच स्वाइप को सक्षम करें (स्क्रॉल दिशा के पर्पेंडिक्युलर) diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index b04b54a..62acddb 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -20,7 +20,9 @@ Opsi Tampilkan tombol kembali di navbar - Gunakan tata letak vertikal + Aktifkan pencarian + Umpan balik haptik saat menekan tombol + Gunakan tata letak vertikal Pulihkan keyboard sebelumnya saat menutup keyboard Aktifkan swipe antara paket stiker (tegak lurus terhadap arah gulir) "Jumlah Baris: " diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 7a8ebbf..d52c56d 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -19,6 +19,8 @@ オプション ナビゲーションバーに戻るボタンを表示 + 検索を有効にする + キー操作時の触覚フィードバック 垂直レイアウトを使用 キーボードを閉じた際に前回のキーボードを復元 パック間をスワイプで切り替えるを有効にする(スクロール方向に対して垂直) diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index f03b6db..63a1de7 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -20,6 +20,8 @@ 옵션 네비게이션 바에 뒤로 가기 버튼 표시 + 검색 활성화 + 키를 누를 때 햅틱 피드백 수직 레이아웃 사용 키보드 닫을 때 이전 키보드 복원 팩 간 스와이프 활성화 (스크롤 방향과 수직) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 8b58af0..c8d036a 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,6 +19,8 @@ Opções Mostrar botão de voltar na barra de navegação + Ativar busca + Feedback háptico ao pressionar teclas Usar layout vertical Restaurar teclado anterior ao fechar o teclado Habilitar deslize entre pacotes (perpendicular à direção de rolagem) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4b8d7e0..a82109d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,6 +19,8 @@ Опции Показать кнопку назад в навигационной панели + Ativar busca + Feedback háptico ao pressionar teclas Использовать вертикальное расположение Восстановить предыдущую клавиатуру при закрытии Включить переключение между пакетами (перпендикулярно направлению прокрутки) diff --git a/app/src/main/res/values-ur/strings.xml b/app/src/main/res/values-ur/strings.xml index dff384e..f227955 100644 --- a/app/src/main/res/values-ur/strings.xml +++ b/app/src/main/res/values-ur/strings.xml @@ -20,6 +20,8 @@ اختیارات نیویگیشن بار میں پیچھے جائیں کا بٹن دکھائیں + تلاش کو فعال کریں + کی پریس پر ہیپٹک فیڈ بیک عمودی لے آؤٹ استعمال کریں کی بورڈ بند ہونے پر پچھلا کی بورڈ بحال کریں پیک کے درمیان میں چھلانے کی اجازت دیں (سکرول کی سمت کے عمودی) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 6d20936..8fba7d4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -20,6 +20,8 @@ 选项 在导航栏中显示返回按钮 + 启用搜索 + 按键时触觉反馈 使用垂直布局 在键盘关闭时还原上一个键盘 启用在贴纸包之间滑动(垂直于滚动方向) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index c9bcd52..84fa16a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -20,6 +20,8 @@ 選項 在導航欄中顯示返回按鈕 + 啟用搜尋 + 按鍵時觸覺回饋 使用垂直佈局 在鍵盤關閉時還原先前的鍵盤 啟用在貼圖包之間滑動(垂直於滾動方向) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 77b550e..935fdc2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,6 +20,8 @@ Options Show back button in navbar + Enable search + Haptic feedback on key-press Use vertical layout Restore previous keyboard on keyboard close Enable swipe between packs (perpendicular to scroll direction) diff --git a/build.gradle.kts b/build.gradle.kts index 42adcf2..d1de2fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("com.android.application") version "8.3.0" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false - id("org.jetbrains.dokka") version "1.8.20" + id("org.jetbrains.dokka") version "1.9.20" id("org.jlleitschuh.gradle.ktlint") version "11.6.0" } diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md index ed74d9f..9fa250a 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md @@ -3,4 +3,4 @@ # StickerPackAdapter [androidJvm]\ -constructor(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html)) +constructor(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html), vibrate: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)) diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/index.md b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/index.md index 29db524..1db52c5 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/index.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/index.md @@ -3,13 +3,13 @@ # StickerPackAdapter [androidJvm]\ -class [StickerPackAdapter](index.md)(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html)) : [RecyclerView.Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter.html)<[StickerPackViewHolder](../../com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/index.md)> +class [StickerPackAdapter](index.md)(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html), vibrate: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)) : [RecyclerView.Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter.html)<[StickerPackViewHolder](../../com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/index.md)> ## Constructors | | | |---|---| -| [StickerPackAdapter](-sticker-pack-adapter.md) | [androidJvm]
constructor(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html)) | +| [StickerPackAdapter](-sticker-pack-adapter.md) | [androidJvm]
constructor(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html), vibrate: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)) | ## Functions diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/index.md b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/index.md index 03fdfeb..f059f98 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker.adapter/index.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker.adapter/index.md @@ -6,4 +6,4 @@ | Name | Summary | |---|---| -| [StickerPackAdapter](-sticker-pack-adapter/index.md) | [androidJvm]
class [StickerPackAdapter](-sticker-pack-adapter/index.md)(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html)) : [RecyclerView.Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter.html)<[StickerPackViewHolder](../com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/index.md)> | +| [StickerPackAdapter](-sticker-pack-adapter/index.md) | [androidJvm]
class [StickerPackAdapter](-sticker-pack-adapter/index.md)(iconSize: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), stickers: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[File](https://developer.android.com/reference/kotlin/java/io/File.html)>, listener: [StickerClickListener](../com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md), gestureDetector: [GestureDetector](https://developer.android.com/reference/kotlin/android/view/GestureDetector.html), vibrate: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)) : [RecyclerView.Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter.html)<[StickerPackViewHolder](../com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/index.md)> | diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/get-sticker-packs-from-pref.md b/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/get-sticker-packs-from-pref.md deleted file mode 100644 index 23c8de5..0000000 --- a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/get-sticker-packs-from-pref.md +++ /dev/null @@ -1,6 +0,0 @@ -//[app](../../../index.md)/[com.fredhappyface.ewesticker.utilities](../index.md)/[SharedPrefHelper](index.md)/[getStickerPacksFromPref](get-sticker-packs-from-pref.md) - -# getStickerPacksFromPref - -[androidJvm]\ -fun [getStickerPacksFromPref](get-sticker-packs-from-pref.md)(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html)): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[StickerPack](../../com.fredhappyface.ewesticker.model/-sticker-pack/index.md)> diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/index.md b/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/index.md deleted file mode 100644 index 06e4a40..0000000 --- a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/index.md +++ /dev/null @@ -1,12 +0,0 @@ -//[app](../../../index.md)/[com.fredhappyface.ewesticker.utilities](../index.md)/[SharedPrefHelper](index.md) - -# SharedPrefHelper - -[androidJvm]\ -object [SharedPrefHelper](index.md) - -## Functions - -| Name | Summary | -|---|---| -| [getStickerPacksFromPref](get-sticker-packs-from-pref.md) | [androidJvm]
fun [getStickerPacksFromPref](get-sticker-packs-from-pref.md)(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html)): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[StickerPack](../../com.fredhappyface.ewesticker.model/-sticker-pack/index.md)> | diff --git a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/index.md b/documentation/reference/app/com.fredhappyface.ewesticker.utilities/index.md index 79527bd..a7b327a 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker.utilities/index.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker.utilities/index.md @@ -7,7 +7,6 @@ | Name | Summary | |---|---| | [Cache](-cache/index.md) | [androidJvm]
class [Cache](-cache/index.md)(capacity: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) = 30)
Basically this behaved like an ordered set with some maximum capacity. When this capacity is exceeded an element is removed from the start | -| [SharedPrefHelper](-shared-pref-helper/index.md) | [androidJvm]
object [SharedPrefHelper](-shared-pref-helper/index.md) | | [StickerClickListener](-sticker-click-listener/index.md) | [androidJvm]
interface [StickerClickListener](-sticker-click-listener/index.md) | | [StickerSender](-sticker-sender/index.md) | [androidJvm]
class [StickerSender](-sticker-sender/index.md)(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html), toaster: [Toaster](-toaster/index.md), internalDir: [File](https://developer.android.com/reference/kotlin/java/io/File.html), currentInputConnection: [InputConnection](https://developer.android.com/reference/kotlin/android/view/inputmethod/InputConnection.html)?, currentInputEditorInfo: [EditorInfo](https://developer.android.com/reference/kotlin/android/view/inputmethod/EditorInfo.html)?, compatCache: [Cache](-cache/index.md), imageLoader: ImageLoader)
The StickerSender Class used to contain all of the methods used for sending a sticker to an InputConnection | | [Toaster](-toaster/index.md) | [androidJvm]
class [Toaster](-toaster/index.md)(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html))
The Toaster class provides a simplified interface to android.widget.Toast. Pass in the android.content.Context to the constructor and call the 'toast' function (others as below) toaster.state keeps track of an error state or similar. | diff --git a/documentation/reference/app/com.fredhappyface.ewesticker/index.md b/documentation/reference/app/com.fredhappyface.ewesticker/index.md index f23c5b4..63ff202 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker/index.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker/index.md @@ -14,4 +14,4 @@ | Name | Summary | |---|---| -| [trimString](trim-string.md) | [androidJvm]
fun [trimString](trim-string.md)(str: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | +| [trimString](trim-string.md) | [androidJvm]
fun [trimString](trim-string.md)(str: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
trimString | diff --git a/documentation/reference/app/com.fredhappyface.ewesticker/trim-string.md b/documentation/reference/app/com.fredhappyface.ewesticker/trim-string.md index 0970d75..91862c7 100644 --- a/documentation/reference/app/com.fredhappyface.ewesticker/trim-string.md +++ b/documentation/reference/app/com.fredhappyface.ewesticker/trim-string.md @@ -3,4 +3,20 @@ # trimString [androidJvm]\ -fun [trimString](trim-string.md)(str: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) +fun [trimString](trim-string.md)(str: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) + +trimString + +for strings longer than 32 chars, trim to 32 chars and add ellipsis ... + +#### Return + +String + +#### Parameters + +androidJvm + +| | | +|---|---| +| str | : String | diff --git a/documentation/reference/app/package-list b/documentation/reference/app/package-list index 49a9d66..a07dc6c 100644 --- a/documentation/reference/app/package-list +++ b/documentation/reference/app/package-list @@ -2,7 +2,7 @@ $dokka.format:gfm-v1 $dokka.linkExtension:md $dokka.location:com.fredhappyface.ewesticker.adapter////PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/index.md $dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter///PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/index.md -$dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter/StickerPackAdapter/#kotlin.Int#kotlin.Array[java.io.File]#com.fredhappyface.ewesticker.utilities.StickerClickListener#android.view.GestureDetector/PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md +$dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter/StickerPackAdapter/#kotlin.Int#kotlin.Array[java.io.File]#com.fredhappyface.ewesticker.utilities.StickerClickListener#android.view.GestureDetector#kotlin.Boolean/PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/-sticker-pack-adapter.md $dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter/getItemCount/#/PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/get-item-count.md $dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter/onBindViewHolder/#com.fredhappyface.ewesticker.view.StickerPackViewHolder#kotlin.Int/PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/on-bind-view-holder.md $dokka.location:com.fredhappyface.ewesticker.adapter/StickerPackAdapter/onCreateViewHolder/#android.view.ViewGroup#kotlin.Int/PointingToDeclaration/app/com.fredhappyface.ewesticker.adapter/-sticker-pack-adapter/on-create-view-holder.md @@ -18,8 +18,6 @@ $dokka.location:com.fredhappyface.ewesticker.utilities/Cache/add/#kotlin.String/ $dokka.location:com.fredhappyface.ewesticker.utilities/Cache/fromSharedPref/#kotlin.String/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-cache/from-shared-pref.md $dokka.location:com.fredhappyface.ewesticker.utilities/Cache/toFiles/#/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-cache/to-files.md $dokka.location:com.fredhappyface.ewesticker.utilities/Cache/toSharedPref/#/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-cache/to-shared-pref.md -$dokka.location:com.fredhappyface.ewesticker.utilities/SharedPrefHelper///PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/index.md -$dokka.location:com.fredhappyface.ewesticker.utilities/SharedPrefHelper/getStickerPacksFromPref/#android.content.Context/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-shared-pref-helper/get-sticker-packs-from-pref.md $dokka.location:com.fredhappyface.ewesticker.utilities/StickerClickListener///PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-sticker-click-listener/index.md $dokka.location:com.fredhappyface.ewesticker.utilities/StickerClickListener/onStickerClicked/#java.io.File/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-sticker-click-listener/on-sticker-clicked.md $dokka.location:com.fredhappyface.ewesticker.utilities/StickerClickListener/onStickerLongClicked/#java.io.File/PointingToDeclaration/app/com.fredhappyface.ewesticker.utilities/-sticker-click-listener/on-sticker-long-clicked.md @@ -39,7 +37,7 @@ $dokka.location:com.fredhappyface.ewesticker.view/StickerPackViewHolder///Pointi $dokka.location:com.fredhappyface.ewesticker.view/StickerPackViewHolder/StickerPackViewHolder/#android.view.View/PointingToDeclaration/app/com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/-sticker-pack-view-holder.md $dokka.location:com.fredhappyface.ewesticker.view/StickerPackViewHolder/stickerThumbnail/#/PointingToDeclaration/app/com.fredhappyface.ewesticker.view/-sticker-pack-view-holder/sticker-thumbnail.md $dokka.location:com.fredhappyface.ewesticker////PointingToDeclaration/app/com.fredhappyface.ewesticker/index.md -$dokka.location:com.fredhappyface.ewesticker//trimString/#kotlin.String/PointingToDeclaration/app/com.fredhappyface.ewesticker/trim-string.md +$dokka.location:com.fredhappyface.ewesticker//trimString/#kotlin.String?/PointingToDeclaration/app/com.fredhappyface.ewesticker/trim-string.md $dokka.location:com.fredhappyface.ewesticker/ImageKeyboard///PointingToDeclaration/app/com.fredhappyface.ewesticker/-image-keyboard/index.md $dokka.location:com.fredhappyface.ewesticker/ImageKeyboard/ImageKeyboard/#/PointingToDeclaration/app/com.fredhappyface.ewesticker/-image-keyboard/-image-keyboard.md $dokka.location:com.fredhappyface.ewesticker/ImageKeyboard/onCreate/#/PointingToDeclaration/app/com.fredhappyface.ewesticker/-image-keyboard/on-create.md