session-android/src/org/thoughtcrime/securesms/loki/NewConversationFragment.kt

35 lines
1.3 KiB
Kotlin
Raw Normal View History

2019-08-23 11:46:28 +10:00
package org.thoughtcrime.securesms.loki
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
2019-08-23 13:22:52 +10:00
import kotlinx.android.synthetic.main.fragment_new_conversation.*
2019-08-23 11:46:28 +10:00
import network.loki.messenger.R
class NewConversationFragment() : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
2019-08-23 13:22:52 +10:00
return inflater.inflate(R.layout.fragment_new_conversation, container, false)
2019-08-23 11:46:28 +10:00
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
qrCodeButton.setOnClickListener {
val activity = activity as NewConversationActivity
activity.scanQRCode()
}
nextButton.setOnClickListener {
val activity = activity as NewConversationActivity
val hexEncodedPublicKey = publicKeyEditText.text.toString().trim()
activity.startNewConversationIfPossible(hexEncodedPublicKey)
}
}
override fun onResume() {
super.onResume()
val activity = activity as NewConversationActivity
2019-08-23 13:22:52 +10:00
activity.supportActionBar!!.setTitle(R.string.fragment_new_conversation_title)
2019-08-23 11:46:28 +10:00
}
}