Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
ab0c5329
Commit
ab0c5329
authored
Oct 03, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RocketChatMessageAttachmentsLayout.java
parent
077b203d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
RocketChatMessageAttachmentsLayout.java
...id/widget/message/RocketChatMessageAttachmentsLayout.java
+19
-16
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageAttachmentsLayout.java
View file @
ab0c5329
...
...
@@ -71,21 +71,21 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
return
;
}
this
.
attachments
=
attachments
;
removeAllViews
();
for
(
int
i
=
0
,
size
=
attachments
.
size
();
i
<
size
;
i
++)
{
appendAttachmentView
(
attachments
.
get
(
i
),
autoloadImages
);
appendAttachmentView
(
attachments
.
get
(
i
),
autoloadImages
,
true
);
}
}
public
void
appendAttachmentView
(
Attachment
attachment
,
boolean
autoloadImages
)
{
public
void
appendAttachmentView
(
Attachment
attachment
,
boolean
autoloadImages
,
boolean
showAttachmentStrip
)
{
if
(
attachment
==
null
)
{
return
;
}
removeAllViews
();
View
attachmentView
=
inflater
.
inflate
(
R
.
layout
.
message_inline_attachment
,
this
,
false
);
colorizeAttachmentBar
(
attachment
,
attachmentView
);
colorizeAttachmentBar
(
attachment
,
attachmentView
,
showAttachmentStrip
);
showAuthorAttachment
(
attachment
,
attachmentView
);
showTitleAttachment
(
attachment
,
attachmentView
);
showReferenceAttachment
(
attachment
,
attachmentView
);
...
...
@@ -97,19 +97,23 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
addView
(
attachmentView
);
}
private
void
colorizeAttachmentBar
(
Attachment
attachment
,
View
attachmentView
)
{
private
void
colorizeAttachmentBar
(
Attachment
attachment
,
View
attachmentView
,
boolean
showAttachmentStrip
)
{
final
View
attachmentStrip
=
attachmentView
.
findViewById
(
R
.
id
.
attachment_strip
);
final
String
colorString
=
attachment
.
getColor
();
if
(
TextUtils
.
isEmpty
(
colorString
))
{
attachmentStrip
.
setBackgroundResource
(
R
.
color
.
inline_attachment_quote_line
);
return
;
}
if
(
showAttachmentStrip
)
{
final
String
colorString
=
attachment
.
getColor
();
if
(
TextUtils
.
isEmpty
(
colorString
))
{
attachmentStrip
.
setBackgroundResource
(
R
.
color
.
inline_attachment_quote_line
);
return
;
}
try
{
attachmentStrip
.
setBackgroundColor
(
Color
.
parseColor
(
colorString
));
}
catch
(
Exception
e
)
{
attachmentStrip
.
setBackgroundResource
(
R
.
color
.
inline_attachment_quote_line
);
try
{
attachmentStrip
.
setBackgroundColor
(
Color
.
parseColor
(
colorString
));
}
catch
(
Exception
e
)
{
attachmentStrip
.
setBackgroundResource
(
R
.
color
.
inline_attachment_quote_line
);
}
}
else
{
attachmentStrip
.
setVisibility
(
GONE
);
}
}
...
...
@@ -204,8 +208,7 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
}
}
private
void
showImageAttachment
(
Attachment
attachment
,
View
attachmentView
,
boolean
autoloadImages
)
{
private
void
showImageAttachment
(
Attachment
attachment
,
View
attachmentView
,
boolean
autoloadImages
)
{
final
View
imageContainer
=
attachmentView
.
findViewById
(
R
.
id
.
image_container
);
if
(
attachment
.
getImageUrl
()
==
null
)
{
imageContainer
.
setVisibility
(
GONE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment