mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-14 06:52:19 +00:00
Implement conversation activity toolbar
This commit is contained in:
@@ -4,12 +4,20 @@ import android.os.Bundle
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import kotlinx.android.synthetic.main.activity_conversation_v2.*
|
||||
import network.loki.messenger.R
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.thoughtcrime.securesms.mms.GlideApp
|
||||
|
||||
class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
private var threadID: Long = -1
|
||||
|
||||
private val thread by lazy {
|
||||
DatabaseFactory.getThreadDatabase(this).getRecipientForThreadId(threadID)!!
|
||||
}
|
||||
|
||||
private val glide by lazy { GlideApp.with(this) }
|
||||
|
||||
// region Settings
|
||||
companion object {
|
||||
const val THREAD_ID = "thread_id"
|
||||
@@ -22,6 +30,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
setContentView(R.layout.activity_conversation_v2)
|
||||
threadID = intent.getLongExtra(THREAD_ID, -1)
|
||||
setUpRecyclerView()
|
||||
setUpToolbar()
|
||||
}
|
||||
|
||||
private fun setUpRecyclerView() {
|
||||
@@ -31,5 +40,19 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
conversationRecyclerView.adapter = adapter
|
||||
conversationRecyclerView.layoutManager = LinearLayoutManager(this)
|
||||
}
|
||||
|
||||
private fun setUpToolbar() {
|
||||
backButton.setOnClickListener { onBackPressed() }
|
||||
conversationTitleView.text = thread.toShortString()
|
||||
conversationSettingsButton.glide = glide
|
||||
conversationSettingsButton.update(thread, threadID)
|
||||
conversationSettingsButton.setOnClickListener { showConversationSettings() }
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Interaction
|
||||
private fun showConversationSettings() {
|
||||
// TODO: Implement
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
Reference in New Issue
Block a user