forked from upstream-mirrors/quik
Add title to conversation list item, update editor previews
This commit is contained in:
@@ -23,12 +23,14 @@ class ConversationAdapter(context: Context, data: OrderedRealmCollection<Convers
|
|||||||
override fun onBindViewHolder(viewHolder: ConversationViewHolder, position: Int) {
|
override fun onBindViewHolder(viewHolder: ConversationViewHolder, position: Int) {
|
||||||
val conversation = getItem(position)
|
val conversation = getItem(position)
|
||||||
|
|
||||||
viewHolder.snippet.text = conversation?.snippet
|
|
||||||
viewHolder.itemView.setOnClickListener {
|
viewHolder.itemView.setOnClickListener {
|
||||||
val intent = Intent(mContext, MessageListActivity::class.java)
|
val intent = Intent(mContext, MessageListActivity::class.java)
|
||||||
intent.putExtra("thread_id", conversation?.id)
|
intent.putExtra("thread_id", conversation?.id)
|
||||||
|
|
||||||
mContext.startActivity(intent)
|
mContext.startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewHolder.title.text = conversation?.recipientIds.toString()
|
||||||
|
viewHolder.snippet.text = conversation?.snippet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.moez.QKSMS.R
|
|||||||
|
|
||||||
class ConversationViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
class ConversationViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||||
|
|
||||||
|
val title = view.findViewById(R.id.conversation_title) as TextView
|
||||||
val snippet = view.findViewById(R.id.conversation_snippet) as TextView
|
val snippet = view.findViewById(R.id.conversation_snippet) as TextView
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/conversation_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="Moez Bhatti" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/conversation_snippet"
|
android:id="@+id/conversation_snippet"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/textSecondary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/conversation_title"
|
||||||
|
tools:text="Hey! How's it going?" />
|
||||||
|
|
||||||
</LinearLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@@ -7,6 +8,9 @@
|
|||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/conversation_list"
|
android:id="@+id/conversation_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
tools:listitem="@layout/conversation_list_item" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -3,4 +3,7 @@
|
|||||||
<color name="colorPrimary">#3F51B5</color>
|
<color name="colorPrimary">#3F51B5</color>
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
<color name="colorAccent">#FF4081</color>
|
<color name="colorAccent">#FF4081</color>
|
||||||
|
|
||||||
|
<color name="textPrimary">#212121</color>
|
||||||
|
<color name="textSecondary">#707070</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user