mirror of
				https://github.com/SimpleMobileTools/Simple-Keyboard.git
				synced 2025-06-05 21:49:26 +02:00 
			
		
		
		
	Close emoji palette on visibility change
This commit is contained in:
		| @@ -158,7 +158,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL | |||||||
|             } |             } | ||||||
|             MyKeyboard.KEYCODE_EMOJI -> { |             MyKeyboard.KEYCODE_EMOJI -> { | ||||||
|                 keyboardView?.vibrateIfNeeded() |                 keyboardView?.vibrateIfNeeded() | ||||||
|                 keyboardView?.openEmojiChooser() |                 keyboardView?.openEmojiPalette() | ||||||
|             } |             } | ||||||
|             else -> { |             else -> { | ||||||
|                 var codeChar = code.toChar() |                 var codeChar = code.toChar() | ||||||
|   | |||||||
| @@ -262,6 +262,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut | |||||||
|     override fun onVisibilityChanged(changedView: View, visibility: Int) { |     override fun onVisibilityChanged(changedView: View, visibility: Int) { | ||||||
|         super.onVisibilityChanged(changedView, visibility) |         super.onVisibilityChanged(changedView, visibility) | ||||||
|         closeClipboardManager() |         closeClipboardManager() | ||||||
|  |         closeEmojiPalette() | ||||||
|  |  | ||||||
|         if (visibility == VISIBLE) { |         if (visibility == VISIBLE) { | ||||||
|             mTextColor = context.getProperTextColor() |             mTextColor = context.getProperTextColor() | ||||||
| @@ -417,7 +418,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut | |||||||
|         mEmojiPaletteHolder!!.apply { |         mEmojiPaletteHolder!!.apply { | ||||||
|             emoji_palette_close.setOnClickListener { |             emoji_palette_close.setOnClickListener { | ||||||
|                 vibrateIfNeeded() |                 vibrateIfNeeded() | ||||||
|                 closeEmojiChooser() |                 closeEmojiPalette() | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -1392,7 +1393,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut | |||||||
|             emoji_palette_mode_change.apply { |             emoji_palette_mode_change.apply { | ||||||
|                 setTextColor(bottomTextColor) |                 setTextColor(bottomTextColor) | ||||||
|                 setOnClickListener { |                 setOnClickListener { | ||||||
|                     closeEmojiChooser() |                     closeEmojiPalette() | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             emoji_palette_backspace.apply { |             emoji_palette_backspace.apply { | ||||||
| @@ -1423,12 +1424,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut | |||||||
|         setupEmojis() |         setupEmojis() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun openEmojiChooser() { |     fun openEmojiPalette() { | ||||||
|         mEmojiPaletteHolder!!.emoji_palette_holder.beVisible() |         mEmojiPaletteHolder!!.emoji_palette_holder.beVisible() | ||||||
|         setupEmojis() |         setupEmojis() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun closeEmojiChooser() { |     private fun closeEmojiPalette() { | ||||||
|         mEmojiPaletteHolder?.apply { |         mEmojiPaletteHolder?.apply { | ||||||
|             emoji_palette_holder?.beGone() |             emoji_palette_holder?.beGone() | ||||||
|             mEmojiPaletteHolder?.emojis_list?.scrollToPosition(0) |             mEmojiPaletteHolder?.emojis_list?.scrollToPosition(0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user