Skip to content
Snippets Groups Projects
Commit 6621512e authored by Pierre Nicolas's avatar Pierre Nicolas :joy: Committed by Emma Falkiewitz
Browse files

chatview: implement contact event new design

Change-Id: I2aa6886bf78014f9e703710da146ff25d92d4cc9
parent c194c46e
No related branches found
No related tags found
No related merge requests found
......@@ -580,7 +580,8 @@ class ConversationAdapter(
)
Interaction.InteractionType.CONTACT -> configureForContactEvent(
conversationViewHolder,
interaction
interaction,
position
)
Interaction.InteractionType.DATA_TRANSFER -> configureForFileInfo(
conversationViewHolder,
......@@ -1529,7 +1530,8 @@ class ConversationAdapter(
private fun configureForContactEvent(
viewHolder: ConversationViewHolder,
interaction: Interaction
interaction: Interaction,
position: Int
) {
val context = viewHolder.itemView.context
val event = interaction as ContactEvent
......@@ -1537,6 +1539,16 @@ class ConversationAdapter(
TAG,
"configureForContactEvent ${event.account} ${event.event} ${event.contact} ${event.author} "
)
// Manage the date of the event.
val isDateShown = hasPermanentDateString(event, position)
viewHolder.mMsgDetailTxt?.apply {
if (isDateShown || getPreviousInteractionFromPosition(position) == null) {
visibility = View.VISIBLE
text = TextUtils.timestampToDate(context, formatter, event.timestamp)
} else {
visibility = View.GONE
}
}
val timestamp = TextUtils.timestampToTime(context, formatter, event.timestamp)
if (interaction.isSwarm) {
......
......@@ -15,32 +15,40 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:descendantFocusability="blocksDescendants"
android:focusable="false"
app:layout_anchorGravity="center_horizontal">
android:orientation="vertical">
<TextView
android:id="@+id/contact_event_details_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingVertical="@dimen/conversation_date_padding"
android:textColor="@color/textColorSecondary"
android:textSize="@dimen/conversation_text_size_small"
tools:text="Aug 12" />
<TextView
android:id="@+id/contact_event_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ellipsize="end"
android:ellipsize="middle"
android:marqueeRepeatLimit="marquee_forever"
android:maxLines="2"
android:maxLines="1"
android:paddingHorizontal="@dimen/padding_large"
android:paddingVertical="@dimen/conversation_date_padding"
android:scrollHorizontally="true"
android:singleLine="false"
android:textAlignment="center"
android:singleLine="true"
android:textColor="@color/textColorSecondary"
android:textSize="12sp"
tools:text="Bob was invited, MAY 15, 15:28" />
android:textSize="@dimen/conversation_text_size_small"
tools:text="Bob was invited, 15:28 PM" />
</FrameLayout>
</LinearLayout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment