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
import kotlinx.android.synthetic.main.activity_new_conversation.*
import network.loki.messenger.R
class NewConversationFragment() : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.activity_new_conversation, container, false)
}
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
activity.supportActionBar!!.setTitle(R.string.activity_new_conversation_title)
}
}