add logic show emoji for typingPreview and file md
This commit is contained in:
@@ -13,7 +13,7 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
[Tooltip("Root của box xem trước nội dung đang gõ.")]
|
||||
[SerializeField] private GameObject typingPreviewRoot;
|
||||
[Tooltip("Text hiển thị nội dung đang gõ realtime.")]
|
||||
[SerializeField] private TextMeshProUGUI typingPreviewText;
|
||||
[SerializeField] private TMP_InputField typingPreviewText;
|
||||
[Tooltip("Rect của preview box để neo theo keyboard.")]
|
||||
[SerializeField] private RectTransform typingPreviewRect;
|
||||
[Tooltip("Khoảng cách dọc cộng thêm cho preview box.")]
|
||||
@@ -49,12 +49,12 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
if (typingPreviewRoot == null || typingPreviewText == null)
|
||||
return;
|
||||
|
||||
string trimmedBody = (body ?? string.Empty).Trim();
|
||||
string previewBody = body ?? string.Empty;
|
||||
bool keyboardVisible = IsMobileKeyboardVisible();
|
||||
bool shouldShow = keyboardVisible && isInputFocused && !string.IsNullOrEmpty(trimmedBody);
|
||||
bool shouldShow = keyboardVisible && isInputFocused;
|
||||
typingPreviewRoot.SetActive(shouldShow);
|
||||
if (shouldShow)
|
||||
typingPreviewText.text = trimmedBody;
|
||||
typingPreviewText.text = previewBody;
|
||||
}
|
||||
|
||||
bool IsMobileKeyboardVisible()
|
||||
|
||||
Reference in New Issue
Block a user