Skip to content
Snippets Groups Projects
Commit cba8995a authored by Adrien Béraud's avatar Adrien Béraud
Browse files

conversation: use TextView instead of Chip

Change-Id: I8c9700227a97274066924000c67231748624a09f
parent 80717b1a
Branches
Tags
No related merge requests found
...@@ -363,7 +363,7 @@ class ConversationAdapter( ...@@ -363,7 +363,7 @@ class ConversationAdapter(
} }
// Subscribe on result. // Subscribe on result.
Observable.combineLatest(entry) { resultDictionary -> Observable.combineLatest(entry) { resultDictionary ->
resultDictionary.map { it -> resultDictionary.map {
it as Pair<ContactViewModel, List<Interaction>> it as Pair<ContactViewModel, List<Interaction>>
} }
} }
...@@ -411,7 +411,7 @@ class ConversationAdapter( ...@@ -411,7 +411,7 @@ class ConversationAdapter(
chip.isVisible = true chip.isVisible = true
chip.isClickable = true chip.isClickable = true
chip.isFocusable = true chip.isFocusable = true
chip.isChecked = false //chip.isChecked = false
} }
} }
} }
...@@ -1663,8 +1663,8 @@ class ConversationAdapter( ...@@ -1663,8 +1663,8 @@ class ConversationAdapter(
*/ */
private fun setBottomMargin(view: View, margin_in_dp: Int) { private fun setBottomMargin(view: View, margin_in_dp: Int) {
val targetSize = (margin_in_dp * view.context.resources.displayMetrics.density).toInt() val targetSize = (margin_in_dp * view.context.resources.displayMetrics.density).toInt()
val params = view.layoutParams as MarginLayoutParams val params = view.layoutParams as? MarginLayoutParams?
params.bottomMargin = targetSize params?.bottomMargin = targetSize
} }
/** /**
......
...@@ -71,7 +71,7 @@ class ConversationViewHolder(v: ViewGroup, val type: MessageType) : RecyclerView ...@@ -71,7 +71,7 @@ class ConversationViewHolder(v: ViewGroup, val type: MessageType) : RecyclerView
val mReplyTxt: TextView? = v.findViewById(R.id.msg_reply_txt) val mReplyTxt: TextView? = v.findViewById(R.id.msg_reply_txt)
val mInReplyTo: TextView? = v.findViewById(R.id.msg_in_reply_to) val mInReplyTo: TextView? = v.findViewById(R.id.msg_in_reply_to)
val mPeerDisplayName: TextView? = v.findViewById(R.id.msg_display_name) val mPeerDisplayName: TextView? = v.findViewById(R.id.msg_display_name)
val reactionChip: Chip? = v.findViewById(R.id.reaction_chip) val reactionChip: TextView? = v.findViewById(R.id.reaction_chip)
val mIcon: ImageView? = when (type) { val mIcon: ImageView? = when (type) {
MessageType.INCOMING_CALL_INFORMATION, MessageType.INCOMING_CALL_INFORMATION,
MessageType.OUTGOING_CALL_INFORMATION -> v.findViewById(R.id.call_icon) MessageType.OUTGOING_CALL_INFORMATION -> v.findViewById(R.id.call_icon)
......
...@@ -139,25 +139,23 @@ along with this program; if not, write to the Free Software ...@@ -139,25 +139,23 @@ along with this program; if not, write to the Free Software
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginEnd="5dp" /> android:layout_marginEnd="5dp" />
<com.google.android.material.chip.Chip <TextView
android:id="@+id/reaction_chip" android:id="@+id/reaction_chip"
style="@style/Widget.Material3.Chip.Suggestion"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/msg_txt" android:layout_below="@id/msg_txt"
android:layout_alignEnd="@id/msg_txt" android:layout_alignEnd="@id/msg_txt"
android:layout_marginTop="-16dp" android:layout_marginTop="-16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:background="@drawable/background_item_conv_image"
android:backgroundTint="@color/icon_background_color" android:backgroundTint="@color/icon_background_color"
android:elevation="4dp" android:elevation="4dp"
android:outlineProvider="none" android:outlineProvider="none"
android:text="👍 😍 3" android:text="👍 😍 3"
app:chipCornerRadius="5dp" android:lines="1"
app:chipEndPadding="0dp" android:singleLine="true"
app:chipStartPadding="0dp" android:maxLines="1"
app:chipStrokeColor="@color/border_color" android:padding="5dp" />
app:textEndPadding="5dp"
app:textStartPadding="5dp" />
</RelativeLayout> </RelativeLayout>
......
...@@ -127,25 +127,23 @@ along with this program; if not, write to the Free Software ...@@ -127,25 +127,23 @@ along with this program; if not, write to the Free Software
tools:visibility="visible" /> tools:visibility="visible" />
<!-- maxEms="8" to have around 16 characters displayed --> <!-- maxEms="8" to have around 16 characters displayed -->
<com.google.android.material.chip.Chip <TextView
android:id="@+id/reaction_chip" android:id="@+id/reaction_chip"
style="@style/Widget.Material3.Chip.Suggestion"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/msg_txt" android:layout_below="@id/msg_txt"
android:layout_alignStart="@id/msg_txt" android:layout_alignStart="@id/msg_txt"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="-16dp" android:layout_marginTop="-16dp"
android:background="@drawable/background_item_conv_image"
android:backgroundTint="@color/icon_background_color" android:backgroundTint="@color/icon_background_color"
android:elevation="4dp" android:elevation="4dp"
android:outlineProvider="none" android:outlineProvider="none"
android:text="👍😍 3" android:text="👍😍 3"
app:chipCornerRadius="5dp" android:lines="1"
app:chipEndPadding="0dp" android:singleLine="true"
app:chipStartPadding="0dp" android:maxLines="1"
app:chipStrokeColor="@color/border_color" android:padding="5dp" />
app:textEndPadding="5dp"
app:textStartPadding="5dp" />
<TextView <TextView
android:id="@+id/msg_in_reply_to" android:id="@+id/msg_in_reply_to"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment