mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +01:00
Display card deck with parameters
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
56b0b80316
commit
c80050d8f5
@ -83,6 +83,7 @@ class IncomingDeckCardViewHolder(incomingView: View, payload: Any) : MessageHold
|
|||||||
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
||||||
|
|
||||||
setAvatarAndAuthorOnMessageItem(message)
|
setAvatarAndAuthorOnMessageItem(message)
|
||||||
|
showDeckCard(message)
|
||||||
|
|
||||||
colorizeMessageBubble(message)
|
colorizeMessageBubble(message)
|
||||||
|
|
||||||
@ -91,8 +92,6 @@ class IncomingDeckCardViewHolder(incomingView: View, payload: Any) : MessageHold
|
|||||||
// parent message handling
|
// parent message handling
|
||||||
setParentMessageDataOnMessageItem(message)
|
setParentMessageDataOnMessageItem(message)
|
||||||
|
|
||||||
showDeckCard(message)
|
|
||||||
|
|
||||||
binding.cardView.setOnLongClickListener { l: View? ->
|
binding.cardView.setOnLongClickListener { l: View? ->
|
||||||
commonMessageInterface.onOpenMessageActionsDialog(message)
|
commonMessageInterface.onOpenMessageActionsDialog(message)
|
||||||
true
|
true
|
||||||
@ -136,6 +135,8 @@ class IncomingDeckCardViewHolder(incomingView: View, payload: Any) : MessageHold
|
|||||||
stackName,
|
stackName,
|
||||||
boardName
|
boardName
|
||||||
)
|
)
|
||||||
|
binding.cardName.visibility = View.VISIBLE
|
||||||
|
binding.cardDescription.visibility = View.VISIBLE
|
||||||
binding.cardName.text = cardName
|
binding.cardName.text = cardName
|
||||||
binding.cardDescription.text = cardDescription
|
binding.cardDescription.text = cardDescription
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,8 @@ class OutgoingDeckCardViewHolder(
|
|||||||
|
|
||||||
itemView.isSelected = false
|
itemView.isSelected = false
|
||||||
|
|
||||||
|
showDeckCard(message)
|
||||||
|
|
||||||
// parent message handling
|
// parent message handling
|
||||||
setParentMessageDataOnMessageItem(message)
|
setParentMessageDataOnMessageItem(message)
|
||||||
|
|
||||||
@ -111,8 +113,6 @@ class OutgoingDeckCardViewHolder(
|
|||||||
|
|
||||||
binding.checkMark.contentDescription = readStatusContentDescriptionString
|
binding.checkMark.contentDescription = readStatusContentDescriptionString
|
||||||
|
|
||||||
showDeckCard(message)
|
|
||||||
|
|
||||||
binding.cardView.setOnClickListener {
|
binding.cardView.setOnClickListener {
|
||||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(cardLink))
|
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(cardLink))
|
||||||
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
@ -142,16 +142,16 @@ class OutgoingDeckCardViewHolder(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val cardDescription = String.format(
|
||||||
|
context.resources.getString(R.string.deck_card_description),
|
||||||
|
stackName,
|
||||||
|
boardName
|
||||||
|
)
|
||||||
|
|
||||||
if (cardName?.isNotEmpty() == true) {
|
binding.cardName.visibility = View.VISIBLE
|
||||||
val cardDescription = String.format(
|
binding.cardDescription.visibility = View.VISIBLE
|
||||||
context.resources.getString(R.string.deck_card_description),
|
binding.cardName.text = cardName
|
||||||
stackName,
|
binding.cardDescription.text = cardDescription
|
||||||
boardName
|
|
||||||
)
|
|
||||||
binding.cardName.text = cardName
|
|
||||||
binding.cardDescription.text = cardDescription
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun longClickOnReaction(chatMessage: ChatMessage) {
|
private fun longClickOnReaction(chatMessage: ChatMessage) {
|
||||||
|
@ -83,6 +83,7 @@ import com.nextcloud.talk.activities.TakePhotoActivity
|
|||||||
import com.nextcloud.talk.adapters.messages.CallStartedMessageInterface
|
import com.nextcloud.talk.adapters.messages.CallStartedMessageInterface
|
||||||
import com.nextcloud.talk.adapters.messages.CallStartedViewHolder
|
import com.nextcloud.talk.adapters.messages.CallStartedViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.CommonMessageInterface
|
import com.nextcloud.talk.adapters.messages.CommonMessageInterface
|
||||||
|
import com.nextcloud.talk.adapters.messages.IncomingDeckCardViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.IncomingLinkPreviewMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.IncomingLinkPreviewMessageViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.IncomingLocationMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.IncomingLocationMessageViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder
|
||||||
@ -96,6 +97,7 @@ import com.nextcloud.talk.adapters.messages.OutcomingPollMessageViewHolder
|
|||||||
import com.nextcloud.talk.adapters.messages.OutcomingPreviewMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.OutcomingPreviewMessageViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.OutcomingVoiceMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.OutcomingVoiceMessageViewHolder
|
||||||
|
import com.nextcloud.talk.adapters.messages.OutgoingDeckCardViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.PreviewMessageInterface
|
import com.nextcloud.talk.adapters.messages.PreviewMessageInterface
|
||||||
import com.nextcloud.talk.adapters.messages.PreviewMessageViewHolder
|
import com.nextcloud.talk.adapters.messages.PreviewMessageViewHolder
|
||||||
import com.nextcloud.talk.adapters.messages.SystemMessageInterface
|
import com.nextcloud.talk.adapters.messages.SystemMessageInterface
|
||||||
@ -1291,6 +1293,18 @@ class ChatActivity :
|
|||||||
R.layout.item_custom_outcoming_link_preview_message,
|
R.layout.item_custom_outcoming_link_preview_message,
|
||||||
this
|
this
|
||||||
)
|
)
|
||||||
|
|
||||||
|
messageHolders.registerContentType(
|
||||||
|
CONTENT_TYPE_DECK_CARD,
|
||||||
|
IncomingDeckCardViewHolder::class.java,
|
||||||
|
payload,
|
||||||
|
R.layout.item_custom_incoming_deck_card_message,
|
||||||
|
OutgoingDeckCardViewHolder::class.java,
|
||||||
|
payload,
|
||||||
|
R.layout.item_custom_outcoming_deck_card_message,
|
||||||
|
this
|
||||||
|
)
|
||||||
|
|
||||||
return messageHolders
|
return messageHolders
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,11 @@
|
|||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:text="Jane Doe" />
|
tools:text="Jane Doe" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -71,31 +76,26 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lineSpacingMultiplier="1.2"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:maxLines="2"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Name of Website"
|
app:layout_flexGrow="1"
|
||||||
|
tools:text="Card Name"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<androidx.emoji2.widget.EmojiTextView
|
<androidx.emoji2.widget.EmojiTextView
|
||||||
android:id="@+id/cardDescription"
|
android:id="@+id/cardDescription"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lineSpacingMultiplier="1.2"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:maxLines="2"
|
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Description of Website"
|
app:layout_flexGrow="1"
|
||||||
|
tools:text="Card Description"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -107,7 +107,6 @@
|
|||||||
android:textColor="@color/no_emphasis_text"
|
android:textColor="@color/no_emphasis_text"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
tools:text="12:38" />
|
tools:text="12:38" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
~ Nextcloud Talk - Android Client
|
~ Nextcloud Talk - Android Client
|
||||||
~
|
~
|
||||||
~ SPDX-FileCopyrightText: 2024 Sowjanya Kota<sowjanya.kch@gmail.com>
|
~ SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@gmail.com>
|
||||||
~ SPDX-License-Identifier: GPL-3.0-or-later
|
~ SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/cardView"
|
android:id ="@+id/cardView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
@ -16,93 +17,72 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginBottom="2dp">
|
android:layout_marginBottom="2dp">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@id/messageUserAvatar"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:contentDescription="@string/avatar" />
|
|
||||||
|
|
||||||
<com.google.android.flexbox.FlexboxLayout
|
<com.google.android.flexbox.FlexboxLayout
|
||||||
android:id="@id/bubble"
|
android:id="@id/bubble"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/message_incoming_bubble_margin_right"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_toEndOf="@id/messageUserAvatar"
|
android:layout_marginStart="@dimen/message_outcoming_bubble_margin_left"
|
||||||
android:orientation="vertical"
|
|
||||||
app:alignContent="stretch"
|
app:alignContent="stretch"
|
||||||
app:alignItems="stretch"
|
app:alignItems="stretch"
|
||||||
app:flexWrap="wrap">
|
app:flexWrap="wrap"
|
||||||
|
app:justifyContent="flex_end">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/message_quote"
|
android:id="@+id/message_quote"
|
||||||
layout="@layout/item_message_quote"
|
layout="@layout/item_message_quote"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.emoji2.widget.EmojiTextView
|
|
||||||
android:id="@+id/messageAuthor"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:alpha="0.6"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="@color/no_emphasis_text"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="Jane Doe" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/deckCardImage"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:src="@drawable/baseline_assignment_24" />
|
|
||||||
|
|
||||||
<androidx.emoji2.widget.EmojiTextView
|
|
||||||
android:id="@+id/cardName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:lineSpacingMultiplier="1.2"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="Name of Website"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/deckCardImage"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:src="@drawable/baseline_assignment_24" />
|
||||||
|
|
||||||
|
<androidx.emoji2.widget.EmojiTextView
|
||||||
|
android:id="@+id/cardName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lineSpacingMultiplier="1.2"
|
||||||
|
app:layout_flexGrow="1"
|
||||||
|
android:textIsSelectable="false"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Card Name"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.emoji2.widget.EmojiTextView
|
<androidx.emoji2.widget.EmojiTextView
|
||||||
android:id="@+id/cardDescription"
|
android:id="@+id/cardDescription"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lineSpacingMultiplier="1.2"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:maxLines="2"
|
app:layout_flexGrow="1"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Description of Website"
|
tools:text="Card Description"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/messageTime"
|
android:id="@id/messageTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:alpha="0.6"
|
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
|
android:alpha="0.6"
|
||||||
android:textColor="@color/no_emphasis_text"
|
android:textColor="@color/no_emphasis_text"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
tools:text="12:38" />
|
tools:text="12:38" />
|
||||||
|
@ -515,7 +515,7 @@ How to translate with transifex:
|
|||||||
<string name="typing_are_typing">are typing …</string>
|
<string name="typing_are_typing">are typing …</string>
|
||||||
<string name="typing_1_other">and 1 other is typing …</string>
|
<string name="typing_1_other">and 1 other is typing …</string>
|
||||||
<string name="typing_x_others">and %1$s others are typing …</string>
|
<string name="typing_x_others">and %1$s others are typing …</string>
|
||||||
<string name="deck_card_description">%1$s in 2$s</string>
|
<string name="deck_card_description">%1$s in %2$s</string>
|
||||||
<!-- Upload -->
|
<!-- Upload -->
|
||||||
<string name="nc_add_file">Add to conversation</string>
|
<string name="nc_add_file">Add to conversation</string>
|
||||||
<string name="nc_upload_picture_from_cam">Take photo</string>
|
<string name="nc_upload_picture_from_cam">Take photo</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user