Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pm messaging merge #2956

Open
wants to merge 3 commits into
base: pm_connectid_merge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/res/drawable/ic_connect_message_editext_bg_24_border.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/connect_message_sender_bg" />
<corners android:radius="50dp" />
<stroke
android:width="0.5dp"
android:color="@color/connect_divider_color" />
</shape>
13 changes: 13 additions & 0 deletions app/res/drawable/ic_connect_message_photo_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,17.115C13.148,17.115 14.12,16.716 14.918,15.918C15.716,15.12 16.115,14.148 16.115,13C16.115,11.852 15.716,10.88 14.918,10.082C14.12,9.284 13.148,8.885 12,8.885C10.852,8.885 9.88,9.284 9.082,10.082C8.284,10.88 7.885,11.852 7.885,13C7.885,14.148 8.284,15.12 9.082,15.918C9.88,16.716 10.852,17.115 12,17.115ZM12,15.616C11.262,15.616 10.641,15.364 10.139,14.861C9.636,14.359 9.384,13.738 9.384,13C9.384,12.262 9.636,11.641 10.139,11.139C10.641,10.636 11.262,10.384 12,10.384C12.738,10.384 13.359,10.636 13.861,11.139C14.364,11.641 14.616,12.262 14.616,13C14.616,13.738 14.364,14.359 13.861,14.861C13.359,15.364 12.738,15.616 12,15.616ZM4.308,20.5C3.803,20.5 3.375,20.325 3.025,19.975C2.675,19.625 2.5,19.197 2.5,18.692V7.308C2.5,6.803 2.675,6.375 3.025,6.025C3.375,5.675 3.803,5.5 4.308,5.5H7.361L9.212,3.5H14.788L16.639,5.5H19.692C20.197,5.5 20.625,5.675 20.975,6.025C21.325,6.375 21.5,6.803 21.5,7.308V18.692C21.5,19.197 21.325,19.625 20.975,19.975C20.625,20.325 20.197,20.5 19.692,20.5H4.308ZM4.308,19H19.692C19.782,19 19.856,18.971 19.913,18.913C19.971,18.856 20,18.782 20,18.692V7.308C20,7.218 19.971,7.144 19.913,7.087C19.856,7.029 19.782,7 19.692,7H15.969L14.134,5H9.866L8.031,7H4.308C4.218,7 4.144,7.029 4.087,7.087C4.029,7.144 4,7.218 4,7.308V18.692C4,18.782 4.029,18.856 4.087,18.913C4.144,18.971 4.218,19 4.308,19Z"
android:fillColor="#150168"/>
</group>
</vector>
10 changes: 10 additions & 0 deletions app/res/drawable/ic_connect_message_read.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="14dp"
android:viewportWidth="16"
android:viewportHeight="14">
<path
android:pathData="M8.114,10.986L15.094,2.986L13.963,2L7.506,9.401L7.054,8.958L6.003,10.029L7.023,11.029L7.591,11.585L8.114,10.986ZM4.131,10.965L10.611,2.965L9.446,2.021L3.488,9.376L1.057,6.961L0,8.025L3.02,11.025L3.609,11.61L4.131,10.965Z"
android:fillColor="#3A42C7"
android:fillType="evenOdd"/>
</vector>
9 changes: 9 additions & 0 deletions app/res/drawable/ic_connect_message_receiver_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/connect_message_receiver_bg" />
<corners
android:bottomLeftRadius="16dp"
android:bottomRightRadius="16dp"
android:topRightRadius="16dp" />
</shape>
9 changes: 9 additions & 0 deletions app/res/drawable/ic_connect_message_receiver_edge.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="8dp"
android:height="8dp"
android:viewportWidth="8"
android:viewportHeight="8">
<path
android:pathData="M8,8V0C8,0 8,0 2.3324,0C-5.2245,0 8,8 8,8Z"
android:fillColor="@color/connect_message_receiver_bg"/>
</vector>
Binary file added app/res/drawable/ic_connect_message_send.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/res/drawable/ic_connect_message_sender_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/connect_message_sender_bg" />
<corners
android:bottomLeftRadius="16dp"
android:bottomRightRadius="16dp"
android:topLeftRadius="16dp" />
</shape>
9 changes: 9 additions & 0 deletions app/res/drawable/ic_connect_message_sender_edge.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="8dp"
android:height="8dp"
android:viewportWidth="8"
android:viewportHeight="8">
<path
android:pathData="M0,8V0C0,0 0,0 5.6677,0C13.2245,0 0,8 0,8Z"
android:fillColor="@color/connect_message_sender_bg"/>
</vector>
5 changes: 5 additions & 0 deletions app/res/drawable/ic_contact_support_30.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="30dp"
android:tint="#333333" android:viewportHeight="24"
android:viewportWidth="24" android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M11.5,2C6.81,2 3,5.81 3,10.5S6.81,19 11.5,19h0.5v3c4.86,-2.34 8,-7 8,-11.5C20,5.81 16.19,2 11.5,2zM12.5,16.5h-2v-2h2v2zM12.5,13h-2c0,-3.25 3,-3 3,-5 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2h-2c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,2.5 -3,2.75 -3,5z"/>
</vector>
7 changes: 7 additions & 0 deletions app/res/drawable/rounded_blue_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp" />

<solid android:color="@color/connect_blue_color" />
</shape>
22 changes: 22 additions & 0 deletions app/res/layout/activity_connect_messaging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.commcare.activities.connect.ConnectMessagingActivity">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_connect_messaging"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/nav_graph_connect_messaging" />

</androidx.constraintlayout.widget.ConstraintLayout>
86 changes: 86 additions & 0 deletions app/res/layout/fragment_channel_consent_bottom_sheet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<layout 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">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/transparent"
tools:context="org.commcare.fragments.connectMessaging.ConnectMessageChannelConsentBottomSheet">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:orientation="horizontal">

<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_primary_portrait" />

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="@font/roboto_medium"
android:text="@string/connect_messaging_channel_consent_title"
android:textColor="@color/connect_warning_color"
android:textSize="16sp" />
</LinearLayout>

<TextView
android:id="@+id/channel_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="@font/roboto_regular"
android:text="(channel name)"
android:textColor="@color/connect_subtext"
android:textSize="20sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:fontFamily="@font/roboto_regular"
android:text="@string/connect_messaging_channel_consent_description"
android:textColor="@color/connect_subtext_80"
android:textSize="16sp" />

<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.google.android.material.button.MaterialButton
style="@style/NegativeButtonStyle"
android:id="@+id/decline_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_margin="16dp"
android:gravity="start|center"
android:text="@string/connect_messaging_channel_consent_decline" />

<com.google.android.material.button.MaterialButton
android:id="@+id/accept_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_margin="16dp"
android:gravity="start|center"
android:text="@string/connect_messaging_channel_consent_accept"
android:drawableRight="@drawable/connect_right_arrow"
/>
</RelativeLayout>
</LinearLayout>
</FrameLayout>
</layout>
18 changes: 18 additions & 0 deletions app/res/layout/fragment_channel_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/white"
tools:context="org.commcare.fragments.connectMessaging.ConnectMessageChannelListFragment">

<androidx.recyclerview.widget.RecyclerView
android:clipToPadding="false"
android:id="@+id/rvChannel"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_marginTop="0dp"/>



</androidx.constraintlayout.widget.ConstraintLayout>
72 changes: 72 additions & 0 deletions app/res/layout/fragment_connect_message.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<androidx.constraintlayout.widget.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_height="match_parent"
android:background="@color/white"
tools:context="org.commcare.fragments.connectMessaging.ConnectMessageFragment">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvChat"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="4dp"
android:orientation="vertical"
android:overScrollMode="never"
android:paddingBottom="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@+id/cardMessage"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<RelativeLayout
android:id="@+id/cardMessage"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginBottom="15dp"
android:layout_marginHorizontal="10dp"
android:background="@drawable/ic_connect_message_editext_bg_24_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imgSendMessage"
app:layout_constraintStart_toStartOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<!-- android:drawableEnd="@drawable/ic_connect_message_photo_camera"-->
<androidx.appcompat.widget.AppCompatEditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/etMessage"
android:background="@null"
android:hint="Type message"
android:textColorHint="@color/black"
android:inputType="textMultiLine"
android:gravity="center_vertical"
android:fontFamily="@font/roboto_medium"
android:paddingVertical="10dp"
android:textColor="@color/black"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:scrollbars="vertical"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

<ImageView
android:id="@+id/imgSendMessage"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="10dp"
android:visibility="gone"
android:src="@drawable/ic_connect_message_send"
app:layout_constraintBottom_toBottomOf="@+id/cardMessage"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/cardMessage" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading