mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 23:34:01 +00:00
Hook up message body
This commit is contained in:
parent
b346a85d57
commit
502d485235
@ -232,6 +232,11 @@
|
|||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.thoughtcrime.securesms.loki.activities.HomeActivity" />
|
android:value="org.thoughtcrime.securesms.loki.activities.HomeActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name="org.thoughtcrime.securesms.conversation.v2.ConversationActivityV2"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Theme.TextSecure.DayNight.NoActionBar">
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.loki.activities.OpenGroupGuidelinesActivity"
|
android:name="org.thoughtcrime.securesms.loki.activities.OpenGroupGuidelinesActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.conversation.v2
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import kotlinx.android.synthetic.main.activity_home.*
|
import kotlinx.android.synthetic.main.activity_conversation_v2.*
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
@ -28,8 +28,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
|||||||
val cursor = DatabaseFactory.getMmsSmsDatabase(this).getConversation(threadID)
|
val cursor = DatabaseFactory.getMmsSmsDatabase(this).getConversation(threadID)
|
||||||
val adapter = ConversationAdapter(this, cursor)
|
val adapter = ConversationAdapter(this, cursor)
|
||||||
adapter.setHasStableIds(true)
|
adapter.setHasStableIds(true)
|
||||||
recyclerView.adapter = adapter
|
conversationRecyclerView.adapter = adapter
|
||||||
recyclerView.layoutManager = LinearLayoutManager(this)
|
conversationRecyclerView.layoutManager = LinearLayoutManager(this)
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
@ -2,7 +2,10 @@ package org.thoughtcrime.securesms.conversation.v2.messages
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
|
import kotlinx.android.synthetic.main.view_message.view.*
|
||||||
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||||
|
|
||||||
class MessageView : LinearLayout {
|
class MessageView : LinearLayout {
|
||||||
@ -21,13 +24,13 @@ class MessageView : LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setUpViewHierarchy() {
|
private fun setUpViewHierarchy() {
|
||||||
// TODO: Implement
|
LayoutInflater.from(context).inflate(R.layout.view_message, this)
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Updating
|
// region Updating
|
||||||
fun bind(message: MessageRecord) {
|
fun bind(message: MessageRecord) {
|
||||||
|
testTextView.text = message.body
|
||||||
}
|
}
|
||||||
|
|
||||||
fun recycle() {
|
fun recycle() {
|
||||||
|
@ -38,6 +38,7 @@ import org.session.libsignal.utilities.ThreadUtils
|
|||||||
import org.thoughtcrime.securesms.ApplicationContext
|
import org.thoughtcrime.securesms.ApplicationContext
|
||||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||||
import org.thoughtcrime.securesms.conversation.ConversationActivity
|
import org.thoughtcrime.securesms.conversation.ConversationActivity
|
||||||
|
import org.thoughtcrime.securesms.conversation.v2.ConversationActivityV2
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
||||||
import org.thoughtcrime.securesms.loki.api.OpenGroupManager
|
import org.thoughtcrime.securesms.loki.api.OpenGroupManager
|
||||||
@ -345,13 +346,8 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), ConversationClickLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun openConversation(thread: ThreadRecord) {
|
private fun openConversation(thread: ThreadRecord) {
|
||||||
val intent = Intent(this, ConversationActivity::class.java)
|
val intent = Intent(this, ConversationActivityV2::class.java)
|
||||||
intent.putExtra(ConversationActivity.ADDRESS_EXTRA, thread.recipient.address)
|
intent.putExtra(ConversationActivityV2.THREAD_ID, thread.threadId)
|
||||||
intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, thread.threadId)
|
|
||||||
intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, thread.distributionType)
|
|
||||||
intent.putExtra(ConversationActivity.TIMING_EXTRA, System.currentTimeMillis())
|
|
||||||
intent.putExtra(ConversationActivity.LAST_SEEN_EXTRA, thread.lastSeen)
|
|
||||||
intent.putExtra(ConversationActivity.STARTING_POSITION_EXTRA, -1)
|
|
||||||
push(intent)
|
push(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
app/src/main/res/layout/view_message.xml
Normal file
17
app/src/main/res/layout/view_message.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/testTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textColor="@color/text" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user