Add cap sentences for chat

Can be disabled in per keyboard setting in system configuration
This commit is contained in:
Benau 2019-05-28 00:43:08 +08:00
parent e3ce7d0a19
commit 1d5e80c131
4 changed files with 13 additions and 6 deletions

View File

@ -189,12 +189,16 @@ public class STKEditText extends EditText
setInputType(InputType.TYPE_CLASS_TEXT);
break;
case 1:
setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
break;
case 2:
setInputType(InputType.TYPE_CLASS_NUMBER);
setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
break;
case 3:
setInputType(InputType.TYPE_CLASS_NUMBER);
break;
case 4:
setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
break;
default:

View File

@ -31,10 +31,11 @@ namespace GUIEngine
// This enum can allow showing different soft keyboard in android
enum TextBoxType: int
{
TBT_TEXT = 0,
TBT_PASSWORD = 1,
TBT_NUMBER = 2,
TBT_EMAIL = 3,
TBT_TEXT = 0, /* Normal text input (default) */
TBT_CAP_SENTENCES = 1, /* Capitalize the first character of each sentence */
TBT_PASSWORD = 2, /* Password input */
TBT_NUMBER = 3, /* Number only input */
TBT_EMAIL = 4, /* Email input */
};
class ITextBoxWidgetListener

View File

@ -74,6 +74,7 @@ RacePausedDialog::RacePausedDialog(const float percentWidth,
music_manager->pauseMusic();
SFXManager::get()->pauseAll();
m_text_box->clearListeners();
m_text_box->setTextBoxType(TBT_CAP_SENTENCES);
if (UserConfigParams::m_lobby_chat)
{
m_text_box->setActive(true);

View File

@ -188,6 +188,7 @@ void NetworkingLobby::init()
m_state = LS_CONNECTING;
m_chat_box->setVisible(false);
m_chat_box->setActive(false);
m_chat_box->setTextBoxType(TBT_CAP_SENTENCES);
m_send_button->setVisible(false);
m_send_button->setActive(false);