mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-16 17:51:26 +00:00
35 lines
1.5 KiB
Kotlin
35 lines
1.5 KiB
Kotlin
![]() |
package org.thoughtcrime.securesms.loki.redesign.activities
|
||
|
|
||
|
import android.os.Bundle
|
||
|
import android.support.v7.widget.LinearLayoutManager
|
||
|
import kotlinx.android.synthetic.main.activity_home.*
|
||
|
import network.loki.messenger.R
|
||
|
import org.thoughtcrime.securesms.ApplicationContext
|
||
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||
|
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||
|
|
||
|
class HomeActivity : PassphraseRequiredActionBarActivity {
|
||
|
|
||
|
constructor() : super()
|
||
|
|
||
|
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
|
||
|
super.onCreate(savedInstanceState, isReady)
|
||
|
// Set content view
|
||
|
setContentView(R.layout.activity_home)
|
||
|
// Set title
|
||
|
supportActionBar!!.title = "Messages"
|
||
|
// Set up recycler view
|
||
|
val cursor = DatabaseFactory.getThreadDatabase(this).conversationList
|
||
|
recyclerView.adapter = ConversationAdapter(this, cursor)
|
||
|
recyclerView.layoutManager = LinearLayoutManager(this)
|
||
|
// Set up public chats and RSS feeds if needed
|
||
|
if (TextSecurePreferences.getLocalNumber(this) != null) {
|
||
|
val application = ApplicationContext.getInstance(this)
|
||
|
application.createDefaultPublicChatsIfNeeded()
|
||
|
application.createRSSFeedsIfNeeded()
|
||
|
application.lokiPublicChatManager.startPollersIfNeeded()
|
||
|
application.startRSSFeedPollersIfNeeded()
|
||
|
}
|
||
|
}
|
||
|
}
|