Improving notices with messages attached in conversation view
BIN
briar-android/res/drawable-hdpi/msg_in_top.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-hdpi/msg_out_top.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-hdpi/notice_in_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-hdpi/notice_out_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-mdpi/msg_in_top.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-mdpi/msg_out_top.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-mdpi/notice_in_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-mdpi/notice_out_bottom.9.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
briar-android/res/drawable-xhdpi/msg_in_top.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-xhdpi/msg_out_top.9.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
briar-android/res/drawable-xhdpi/notice_in_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-xhdpi/notice_out_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-xxhdpi/msg_in_top.9.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
briar-android/res/drawable-xxhdpi/msg_out_top.9.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
briar-android/res/drawable-xxhdpi/notice_in_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
briar-android/res/drawable-xxhdpi/notice_out_bottom.9.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
@@ -6,21 +6,29 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include
|
<TextView
|
||||||
android:id="@+id/messageLayout"
|
android:id="@+id/msgBody"
|
||||||
layout="@layout/list_item_msg_in"/>
|
android:layout_width="match_parent"
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="left|start"
|
|
||||||
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
||||||
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
|
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
|
||||||
android:background="@drawable/notice_in">
|
android:background="@drawable/msg_in_top"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="Short message"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/noticeLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
||||||
|
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
|
||||||
|
android:background="@drawable/notice_in_bottom">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionText"
|
android:id="@+id/introductionText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minWidth="80dp"
|
android:minWidth="80dp"
|
||||||
android:textColor="@color/briar_text_secondary"
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
|||||||
@@ -6,36 +6,44 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include
|
<TextView
|
||||||
android:id="@+id/messageLayout"
|
android:id="@+id/msgBody"
|
||||||
layout="@layout/list_item_msg_out"/>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/message_bubble_margin_non_tail"
|
||||||
|
android:layout_marginRight="@dimen/message_bubble_margin_tail"
|
||||||
|
android:background="@drawable/msg_out_top"
|
||||||
|
android:textColor="@color/briar_text_primary_inverse"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="This is a long long long message that spans over several lines.\n\nIt ends here."/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/noticeLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="right|end"
|
|
||||||
android:background="@drawable/notice_out"
|
|
||||||
android:layout_marginLeft="@dimen/message_bubble_margin_non_tail"
|
android:layout_marginLeft="@dimen/message_bubble_margin_non_tail"
|
||||||
android:layout_marginRight="@dimen/message_bubble_margin_tail">
|
android:layout_marginRight="@dimen/message_bubble_margin_tail"
|
||||||
|
android:background="@drawable/notice_out_bottom">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionText"
|
android:id="@+id/introductionText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
android:textColor="@color/briar_text_secondary"
|
|
||||||
tools:text="@string/introduction_request_received"/>
|
tools:text="@string/introduction_request_received"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionTime"
|
android:id="@+id/introductionTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_below="@+id/introductionText"
|
android:layout_below="@+id/introductionText"
|
||||||
|
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
||||||
android:textColor="@color/private_message_date"
|
android:textColor="@color/private_message_date"
|
||||||
android:textSize="@dimen/text_size_tiny"
|
android:textSize="@dimen/text_size_tiny"
|
||||||
tools:text="Dec 24, 13:37"/>
|
tools:text="Dec 24, 13:37"/>
|
||||||
@@ -44,10 +52,10 @@
|
|||||||
android:id="@+id/introductionStatus"
|
android:id="@+id/introductionStatus"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@+id/introductionTime"
|
|
||||||
android:layout_toRightOf="@+id/introductionTime"
|
|
||||||
android:layout_alignBottom="@+id/introductionTime"
|
android:layout_alignBottom="@+id/introductionTime"
|
||||||
android:layout_marginLeft="@dimen/margin_medium"
|
android:layout_marginLeft="@dimen/margin_medium"
|
||||||
|
android:layout_toEndOf="@+id/introductionTime"
|
||||||
|
android:layout_toRightOf="@+id/introductionTime"
|
||||||
tools:ignore="ContentDescription"
|
tools:ignore="ContentDescription"
|
||||||
tools:src="@drawable/message_delivered"/>
|
tools:src="@drawable/message_delivered"/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,37 +6,46 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include
|
<TextView
|
||||||
android:id="@+id/messageLayout"
|
android:id="@+id/msgBody"
|
||||||
layout="@layout/list_item_msg_in"/>
|
android:layout_width="match_parent"
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="left|start"
|
android:layout_gravity="left|start"
|
||||||
android:background="@drawable/notice_in"
|
|
||||||
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
||||||
android:layout_marginRight="@dimen/message_bubble_margin_non_tail">
|
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
|
||||||
|
android:background="@drawable/msg_in_top"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="Short message"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/noticeLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
||||||
|
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
|
||||||
|
android:background="@drawable/notice_in_bottom">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionText"
|
android:id="@+id/introductionText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minWidth="80dp"
|
android:minWidth="80dp"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
android:textColor="@color/briar_text_secondary"
|
|
||||||
tools:text="@string/forum_invitation_received"/>
|
tools:text="@string/forum_invitation_received"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionTime"
|
android:id="@+id/introductionTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
|
||||||
android:layout_alignEnd="@+id/introductionText"
|
android:layout_alignEnd="@+id/introductionText"
|
||||||
android:layout_alignRight="@+id/introductionText"
|
android:layout_alignRight="@+id/introductionText"
|
||||||
android:layout_below="@+id/showInvitationsButton"
|
android:layout_below="@+id/showInvitationsButton"
|
||||||
|
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
||||||
android:textColor="@color/private_message_date"
|
android:textColor="@color/private_message_date"
|
||||||
android:textSize="@dimen/text_size_tiny"
|
android:textSize="@dimen/text_size_tiny"
|
||||||
tools:text="Dec 24, 13:37"/>
|
tools:text="Dec 24, 13:37"/>
|
||||||
@@ -46,10 +55,10 @@
|
|||||||
style="@style/BriarButtonFlat.Positive"
|
style="@style/BriarButtonFlat.Positive"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="-15dp"
|
|
||||||
android:layout_alignEnd="@+id/introductionText"
|
android:layout_alignEnd="@+id/introductionText"
|
||||||
android:layout_alignRight="@+id/introductionText"
|
android:layout_alignRight="@+id/introductionText"
|
||||||
android:layout_below="@+id/introductionText"
|
android:layout_below="@+id/introductionText"
|
||||||
|
android:layout_marginBottom="-15dp"
|
||||||
tools:text="@string/forum_show_invitations"/>
|
tools:text="@string/forum_show_invitations"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import static org.briarproject.android.contact.ConversationItem.FORUM_INVITATION
|
|||||||
import static org.briarproject.android.contact.ConversationItem.INTRODUCTION_IN;
|
import static org.briarproject.android.contact.ConversationItem.INTRODUCTION_IN;
|
||||||
import static org.briarproject.android.contact.ConversationItem.INTRODUCTION_OUT;
|
import static org.briarproject.android.contact.ConversationItem.INTRODUCTION_OUT;
|
||||||
import static org.briarproject.android.contact.ConversationItem.IncomingItem;
|
import static org.briarproject.android.contact.ConversationItem.IncomingItem;
|
||||||
import static org.briarproject.android.contact.ConversationItem.MSG_IN;
|
|
||||||
import static org.briarproject.android.contact.ConversationItem.MSG_IN_UNREAD;
|
import static org.briarproject.android.contact.ConversationItem.MSG_IN_UNREAD;
|
||||||
import static org.briarproject.android.contact.ConversationItem.MSG_OUT;
|
import static org.briarproject.android.contact.ConversationItem.MSG_OUT;
|
||||||
import static org.briarproject.android.contact.ConversationItem.NOTICE_IN;
|
import static org.briarproject.android.contact.ConversationItem.NOTICE_IN;
|
||||||
@@ -140,7 +139,6 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bindMessage(MessageHolder ui, ConversationMessageItem item) {
|
private void bindMessage(MessageHolder ui, ConversationMessageItem item) {
|
||||||
|
|
||||||
PrivateMessageHeader header = item.getHeader();
|
PrivateMessageHeader header = item.getHeader();
|
||||||
|
|
||||||
if (item instanceof ConversationItem.OutgoingItem) {
|
if (item instanceof ConversationItem.OutgoingItem) {
|
||||||
@@ -186,15 +184,24 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
final ConversationIntroductionItem item, final int position) {
|
final ConversationIntroductionItem item, final int position) {
|
||||||
|
|
||||||
final IntroductionRequest ir = item.getIntroductionRequest();
|
final IntroductionRequest ir = item.getIntroductionRequest();
|
||||||
|
int backgroundRes;
|
||||||
|
|
||||||
String message = ir.getMessage();
|
String message = ir.getMessage();
|
||||||
if (StringUtils.isNullOrEmpty(message)) {
|
if (StringUtils.isNullOrEmpty(message)) {
|
||||||
ui.messageLayout.setVisibility(GONE);
|
ui.message.setVisibility(GONE);
|
||||||
|
if (item instanceof ConversationIntroductionOutItem) {
|
||||||
|
backgroundRes = R.drawable.notice_out;
|
||||||
|
} else {
|
||||||
|
backgroundRes = R.drawable.notice_in;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ui.messageLayout.setVisibility(VISIBLE);
|
ui.message.setText(StringUtils.trim(message));
|
||||||
ui.message.body.setText(StringUtils.trim(message));
|
ui.message.setVisibility(VISIBLE);
|
||||||
ui.message.date
|
if (item instanceof ConversationIntroductionOutItem) {
|
||||||
.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
backgroundRes = R.drawable.notice_out_bottom;
|
||||||
|
} else {
|
||||||
|
backgroundRes = R.drawable.notice_in_bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outgoing Introduction Request
|
// Outgoing Introduction Request
|
||||||
@@ -204,17 +211,14 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
ConversationIntroductionOutItem i =
|
ConversationIntroductionOutItem i =
|
||||||
(ConversationIntroductionOutItem) item;
|
(ConversationIntroductionOutItem) item;
|
||||||
if (i.isSeen()) {
|
if (i.isSeen()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_delivered);
|
ui.status.setImageResource(R.drawable.message_delivered);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_delivered_white);
|
|
||||||
} else if (i.isSent()) {
|
} else if (i.isSent()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_sent);
|
ui.status.setImageResource(R.drawable.message_sent);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_sent_white);
|
|
||||||
} else {
|
} else {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_stored);
|
ui.status.setImageResource(R.drawable.message_stored);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_stored_white);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Incoming Introduction Request (Answered)
|
// Incoming Introduction Request (Answered)
|
||||||
@@ -265,20 +269,23 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
||||||
|
ui.notice.setBackgroundResource(backgroundRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindNotice(NoticeHolder ui, ConversationNoticeItem item) {
|
private void bindNotice(NoticeHolder ui, ConversationNoticeItem item) {
|
||||||
|
|
||||||
ui.text.setText(item.getText());
|
ui.text.setText(item.getText());
|
||||||
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
||||||
|
|
||||||
if (item instanceof ConversationNoticeOutItem) {
|
if (item instanceof ConversationNoticeOutItem) {
|
||||||
ConversationNoticeOutItem n = (ConversationNoticeOutItem) item;
|
ConversationNoticeOutItem n = (ConversationNoticeOutItem) item;
|
||||||
if (n.isSeen()) {
|
if (n.isSeen()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_delivered);
|
ui.status.setImageResource(R.drawable.message_delivered);
|
||||||
} else if (n.isSent()) {
|
} else if (n.isSent()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_sent);
|
ui.status.setImageResource(R.drawable.message_sent);
|
||||||
} else {
|
} else {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_stored);
|
ui.status.setImageResource(R.drawable.message_stored);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,7 +296,7 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
final InvitationRequest ir = item.getInvitationRequest();
|
final InvitationRequest ir = item.getInvitationRequest();
|
||||||
String name = "";
|
String name = "";
|
||||||
int receivedRes = 0, sentRes = 0, buttonRes = 0;
|
int receivedRes = 0, sentRes = 0, buttonRes = 0, backgroundRes;
|
||||||
if (ir instanceof ForumInvitationRequest) {
|
if (ir instanceof ForumInvitationRequest) {
|
||||||
name = ((ForumInvitationRequest) ir).getForumName();
|
name = ((ForumInvitationRequest) ir).getForumName();
|
||||||
receivedRes = R.string.forum_invitation_received;
|
receivedRes = R.string.forum_invitation_received;
|
||||||
@@ -304,12 +311,20 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
String message = ir.getMessage();
|
String message = ir.getMessage();
|
||||||
if (StringUtils.isNullOrEmpty(message)) {
|
if (StringUtils.isNullOrEmpty(message)) {
|
||||||
ui.messageLayout.setVisibility(GONE);
|
ui.message.setVisibility(GONE);
|
||||||
|
if (item instanceof ConversationShareableInvitationOutItem) {
|
||||||
|
backgroundRes = R.drawable.notice_out;
|
||||||
|
} else {
|
||||||
|
backgroundRes = R.drawable.notice_in;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ui.messageLayout.setVisibility(VISIBLE);
|
ui.message.setVisibility(VISIBLE);
|
||||||
ui.message.body.setText(StringUtils.trim(message));
|
ui.message.setText(StringUtils.trim(message));
|
||||||
ui.message.date
|
if (item instanceof ConversationShareableInvitationOutItem) {
|
||||||
.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
backgroundRes = R.drawable.notice_out_bottom;
|
||||||
|
} else {
|
||||||
|
backgroundRes = R.drawable.notice_in_bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outgoing Invitation
|
// Outgoing Invitation
|
||||||
@@ -318,17 +333,14 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
ConversationShareableInvitationOutItem i =
|
ConversationShareableInvitationOutItem i =
|
||||||
(ConversationShareableInvitationOutItem) item;
|
(ConversationShareableInvitationOutItem) item;
|
||||||
if (i.isSeen()) {
|
if (i.isSeen()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_delivered);
|
ui.status.setImageResource(R.drawable.message_delivered);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_delivered_white);
|
|
||||||
} else if (i.isSent()) {
|
} else if (i.isSent()) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_sent);
|
ui.status.setImageResource(R.drawable.message_sent);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_sent_white);
|
|
||||||
} else {
|
} else {
|
||||||
|
//noinspection ConstantConditions
|
||||||
ui.status.setImageResource(R.drawable.message_stored);
|
ui.status.setImageResource(R.drawable.message_stored);
|
||||||
ui.message.status.setImageResource(
|
|
||||||
R.drawable.message_stored_white);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Incoming Invitation
|
// Incoming Invitation
|
||||||
@@ -354,6 +366,7 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
ui.date.setText(AndroidUtils.formatDate(ctx, item.getTime()));
|
||||||
|
ui.notice.setBackgroundResource(backgroundRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -431,7 +444,7 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
public TextView date;
|
public TextView date;
|
||||||
public ImageView status;
|
public ImageView status;
|
||||||
|
|
||||||
MessageHolder(View v, int type) {
|
private MessageHolder(View v, int type) {
|
||||||
super(v);
|
super(v);
|
||||||
|
|
||||||
layout = (ViewGroup) v.findViewById(R.id.msgLayout);
|
layout = (ViewGroup) v.findViewById(R.id.msgLayout);
|
||||||
@@ -447,20 +460,19 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
private static class IntroductionHolder extends RecyclerView.ViewHolder {
|
private static class IntroductionHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
private final View messageLayout;
|
private final TextView message;
|
||||||
private final MessageHolder message;
|
private final ViewGroup notice;
|
||||||
private final TextView text;
|
private final TextView text;
|
||||||
private final Button acceptButton;
|
private final Button acceptButton;
|
||||||
private final Button declineButton;
|
private final Button declineButton;
|
||||||
private final TextView date;
|
private final TextView date;
|
||||||
private final ImageView status;
|
private final ImageView status;
|
||||||
|
|
||||||
IntroductionHolder(View v, int type) {
|
private IntroductionHolder(View v, int type) {
|
||||||
super(v);
|
super(v);
|
||||||
|
|
||||||
messageLayout = v.findViewById(R.id.messageLayout);
|
message = (TextView) v.findViewById(R.id.msgBody);
|
||||||
message = new MessageHolder(messageLayout,
|
notice = (ViewGroup) v.findViewById(R.id.noticeLayout);
|
||||||
type == INTRODUCTION_IN ? MSG_IN : MSG_OUT);
|
|
||||||
text = (TextView) v.findViewById(R.id.introductionText);
|
text = (TextView) v.findViewById(R.id.introductionText);
|
||||||
acceptButton = (Button) v.findViewById(R.id.acceptButton);
|
acceptButton = (Button) v.findViewById(R.id.acceptButton);
|
||||||
declineButton = (Button) v.findViewById(R.id.declineButton);
|
declineButton = (Button) v.findViewById(R.id.declineButton);
|
||||||
@@ -480,7 +492,7 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
private final TextView date;
|
private final TextView date;
|
||||||
private final ImageView status;
|
private final ImageView status;
|
||||||
|
|
||||||
NoticeHolder(View v, int type) {
|
private NoticeHolder(View v, int type) {
|
||||||
super(v);
|
super(v);
|
||||||
|
|
||||||
text = (TextView) v.findViewById(R.id.noticeText);
|
text = (TextView) v.findViewById(R.id.noticeText);
|
||||||
@@ -496,20 +508,19 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
private static class InvitationHolder extends RecyclerView.ViewHolder {
|
private static class InvitationHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
private final View messageLayout;
|
private final TextView message;
|
||||||
private final MessageHolder message;
|
private final View notice;
|
||||||
private final TextView text;
|
private final TextView text;
|
||||||
private final Button showInvitationsButton;
|
private final Button showInvitationsButton;
|
||||||
private final TextView date;
|
private final TextView date;
|
||||||
private final ImageView status;
|
private final ImageView status;
|
||||||
|
|
||||||
InvitationHolder(View v, int type) {
|
private InvitationHolder(View v, int type) {
|
||||||
super(v);
|
super(v);
|
||||||
|
|
||||||
messageLayout = v.findViewById(R.id.messageLayout);
|
message = (TextView) v.findViewById(R.id.msgBody);
|
||||||
message = new MessageHolder(messageLayout,
|
|
||||||
type == FORUM_INVITATION_IN ? MSG_IN : MSG_OUT);
|
|
||||||
text = (TextView) v.findViewById(R.id.introductionText);
|
text = (TextView) v.findViewById(R.id.introductionText);
|
||||||
|
notice = v.findViewById(R.id.noticeLayout);
|
||||||
showInvitationsButton = (Button) v.findViewById(R.id.showInvitationsButton);
|
showInvitationsButton = (Button) v.findViewById(R.id.showInvitationsButton);
|
||||||
date = (TextView) v.findViewById(R.id.introductionTime);
|
date = (TextView) v.findViewById(R.id.introductionTime);
|
||||||
|
|
||||||
|
|||||||