From 66d7f0aeaafedbae6cb25296da55cb89b28dc912 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 5 Aug 2020 10:01:25 +1000 Subject: [PATCH] Make new private chat screen edit text done button work --- .../fragment_enter_public_key.xml | 4 +++- res/layout/fragment_enter_public_key.xml | 4 +++- .../activities/CreatePrivateChatActivity.kt | 17 ++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/res/layout-sw400dp/fragment_enter_public_key.xml b/res/layout-sw400dp/fragment_enter_public_key.xml index 49efbd40ae..cf74f40d22 100644 --- a/res/layout-sw400dp/fragment_enter_public_key.xml +++ b/res/layout-sw400dp/fragment_enter_public_key.xml @@ -18,8 +18,10 @@ android:layout_marginRight="@dimen/large_spacing" android:paddingTop="0dp" android:paddingBottom="0dp" - android:maxLines="2" android:gravity="center_vertical" + android:inputType="textMultiLine" + android:maxLines="2" + android:imeOptions="actionDone" android:hint="@string/fragment_enter_public_key_edit_text_hint" /> + if (actionID == EditorInfo.IME_ACTION_DONE) { + val imm = v.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager + imm.hideSoftInputFromWindow(v.windowToken, 0) + createPrivateChatIfPossible() + true + } else { + false + } + } publicKeyTextView.text = hexEncodedPublicKey copyButton.setOnClickListener { copyPublicKey() } shareButton.setOnClickListener { sharePublicKey() }