mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-13 08:13:40 +00:00
Make new private chat screen edit text done button work
This commit is contained in:
parent
2375c524f8
commit
66d7f0aeaa
@ -18,8 +18,10 @@
|
|||||||
android:layout_marginRight="@dimen/large_spacing"
|
android:layout_marginRight="@dimen/large_spacing"
|
||||||
android:paddingTop="0dp"
|
android:paddingTop="0dp"
|
||||||
android:paddingBottom="0dp"
|
android:paddingBottom="0dp"
|
||||||
android:maxLines="2"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
android:hint="@string/fragment_enter_public_key_edit_text_hint" />
|
android:hint="@string/fragment_enter_public_key_edit_text_hint" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
android:layout_marginRight="@dimen/large_spacing"
|
android:layout_marginRight="@dimen/large_spacing"
|
||||||
android:paddingTop="0dp"
|
android:paddingTop="0dp"
|
||||||
android:paddingBottom="0dp"
|
android:paddingBottom="0dp"
|
||||||
android:maxLines="2"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
android:hint="@string/fragment_enter_public_key_edit_text_hint" />
|
android:hint="@string/fragment_enter_public_key_edit_text_hint" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -7,9 +7,12 @@ import android.content.Intent
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v4.app.Fragment
|
import android.support.v4.app.Fragment
|
||||||
import android.support.v4.app.FragmentPagerAdapter
|
import android.support.v4.app.FragmentPagerAdapter
|
||||||
|
import android.text.InputType
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import kotlinx.android.synthetic.main.activity_create_private_chat.*
|
import kotlinx.android.synthetic.main.activity_create_private_chat.*
|
||||||
import kotlinx.android.synthetic.main.fragment_enter_public_key.*
|
import kotlinx.android.synthetic.main.fragment_enter_public_key.*
|
||||||
@ -25,6 +28,7 @@ import org.thoughtcrime.securesms.recipients.Recipient
|
|||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||||
import org.whispersystems.signalservice.loki.utilities.PublicKeyValidation
|
import org.whispersystems.signalservice.loki.utilities.PublicKeyValidation
|
||||||
|
|
||||||
|
|
||||||
class CreatePrivateChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperFragmentDelegate {
|
class CreatePrivateChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperFragmentDelegate {
|
||||||
private val adapter = CreatePrivateChatActivityAdapter(this)
|
private val adapter = CreatePrivateChatActivityAdapter(this)
|
||||||
|
|
||||||
@ -111,7 +115,18 @@ class EnterPublicKeyFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
publicKeyTextView.imeOptions = publicKeyTextView.imeOptions or 16777216 // Always use incognito keyboard
|
publicKeyEditText.imeOptions = EditorInfo.IME_ACTION_DONE or 16777216 // Always use incognito keyboard
|
||||||
|
publicKeyEditText.setRawInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
publicKeyEditText.setOnEditorActionListener { v, actionID, _ ->
|
||||||
|
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
|
publicKeyTextView.text = hexEncodedPublicKey
|
||||||
copyButton.setOnClickListener { copyPublicKey() }
|
copyButton.setOnClickListener { copyPublicKey() }
|
||||||
shareButton.setOnClickListener { sharePublicKey() }
|
shareButton.setOnClickListener { sharePublicKey() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user