From e3e55a26ed9f2eb53771a07b1b1dcb7a10eb2196 Mon Sep 17 00:00:00 2001
From: Pierre Nicolas <pierre.nicolas@savoirfairelinux.com>
Date: Fri, 21 Apr 2023 14:39:19 -0400
Subject: [PATCH] conversation: creating new item reaction chip

GitLab: #1204

Change-Id: I772925a9468b6a3b8e12881cf15c9f1f0a8fad4b
---
 .../color/selector_checked_state_color.xml    |  5 +++
 .../main/res/layout/item_reaction_chip_18.xml | 32 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 jami-android/app/src/main/res/color/selector_checked_state_color.xml
 create mode 100644 jami-android/app/src/main/res/layout/item_reaction_chip_18.xml

diff --git a/jami-android/app/src/main/res/color/selector_checked_state_color.xml b/jami-android/app/src/main/res/color/selector_checked_state_color.xml
new file mode 100644
index 000000000..87b9d978d
--- /dev/null
+++ b/jami-android/app/src/main/res/color/selector_checked_state_color.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/transparent" android:state_checked="false"/>
+    <item android:color="@color/grey_200" android:state_checked="true"/>
+</selector>
diff --git a/jami-android/app/src/main/res/layout/item_reaction_chip_18.xml b/jami-android/app/src/main/res/layout/item_reaction_chip_18.xml
new file mode 100644
index 000000000..b6944b43e
--- /dev/null
+++ b/jami-android/app/src/main/res/layout/item_reaction_chip_18.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Wrapping item into linear layout is not the cleanest way to create padding between items. -->
+<LinearLayout 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="wrap_content"
+    android:layout_height="wrap_content"
+
+    android:padding="2dp">
+
+
+    <com.google.android.material.chip.Chip
+        android:id="@+id/chip"
+        style="@style/Widget.Material3.Chip.Filter.Elevated"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:elevation="0dp"
+        android:includeFontPadding="false"
+        android:textSize="18sp"
+        app:checkedIconEnabled="false"
+        app:chipBackgroundColor="@color/selector_checked_state_color"
+        app:chipEndPadding="0dp"
+        app:chipMinTouchTargetSize="0dp"
+        app:chipStartPadding="0dp"
+        app:chipSurfaceColor="@color/transparent"
+        app:textEndPadding="4dp"
+        app:textStartPadding="4dp"
+        tools:checked="true"
+        tools:text="🥰" />
+
+</LinearLayout>
\ No newline at end of file
-- 
GitLab