open a new ThreadActivity on clicking on a message
This commit is contained in:
parent
10bda77c50
commit
067c1d3876
|
@ -31,6 +31,8 @@
|
|||
|
||||
<activity android:name=".activities.MainActivity" />
|
||||
|
||||
<activity android:name=".activities.ThreadActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:label="@string/settings"
|
||||
|
|
|
@ -17,6 +17,7 @@ import com.simplemobiletools.smsmessenger.BuildConfig
|
|||
import com.simplemobiletools.smsmessenger.R
|
||||
import com.simplemobiletools.smsmessenger.adapters.MessagesAdapter
|
||||
import com.simplemobiletools.smsmessenger.extensions.config
|
||||
import com.simplemobiletools.smsmessenger.helpers.THREAD_ID
|
||||
import com.simplemobiletools.smsmessenger.models.Message
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
|
@ -78,7 +79,10 @@ class MainActivity : SimpleActivity() {
|
|||
storeStateVariables()
|
||||
val messages = getMessages()
|
||||
MessagesAdapter(this, messages, messages_list, messages_fastscroller) {
|
||||
|
||||
Intent(this, ThreadActivity::class.java).apply {
|
||||
putExtra(THREAD_ID, (it as Message).thread)
|
||||
startActivity(this)
|
||||
}
|
||||
}.apply {
|
||||
messages_list.adapter = this
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.simplemobiletools.smsmessenger.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import com.simplemobiletools.smsmessenger.R
|
||||
import com.simplemobiletools.smsmessenger.helpers.THREAD_ID
|
||||
|
||||
class ThreadActivity : SimpleActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_thread)
|
||||
val threadID = intent.getIntExtra(THREAD_ID, 0)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package com.simplemobiletools.smsmessenger.helpers
|
||||
|
||||
const val THREAD_ID = "thread_id"
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/thread_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue