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
9da4ca25
Commit
9da4ca25
authored
Aug 24, 2017
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
https://fabric.io/rocketchat3/android/apps/chat.rocket.android/issues/59982403be077a4dcc4d7dc3
parent
41e7d057
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
RocketChatMessageAttachmentsLayout.java
...id/widget/message/RocketChatMessageAttachmentsLayout.java
+16
-2
message_inline_attachment.xml
...widgets/src/main/res/layout/message_inline_attachment.xml
+0
-1
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageAttachmentsLayout.java
View file @
9da4ca25
...
...
@@ -4,8 +4,10 @@ import android.annotation.TargetApi;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.widget.TextViewCompat
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
...
...
@@ -21,6 +23,8 @@ import chat.rocket.core.models.Attachment;
import
chat.rocket.core.models.AttachmentAuthor
;
import
chat.rocket.core.models.AttachmentField
;
import
chat.rocket.core.models.AttachmentTitle
;
import
com.facebook.drawee.generic.GenericDraweeHierarchyBuilder
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
java.util.List
;
...
...
@@ -210,10 +214,20 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
imageContainer
.
setVisibility
(
VISIBLE
);
final
SimpleDraweeView
attachedImage
=
(
SimpleDraweeView
)
attachmentView
.
findViewById
(
R
.
id
.
image
);
final
SimpleDraweeView
attachedImage
=
attachmentView
.
findViewById
(
R
.
id
.
image
);
final
View
load
=
attachmentView
.
findViewById
(
R
.
id
.
image_load
);
// Fix for https://fabric.io/rocketchat3/android/apps/chat.rocket.android/issues/59982403be077a4dcc4d7dc3/sessions/599F217000CF00015C771EEF2021AA0F_f9320e3f88fd11e7935256847afe9799_0_v2?
// From: https://github.com/facebook/fresco/issues/1176#issuecomment-216830098
// android.support.v4.content.ContextCompat creates your vector drawable
Drawable
placeholderDrawable
=
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
image_dummy
);
// Set the placeholder image to the placeholder vector drawable
attachedImage
.
setHierarchy
(
GenericDraweeHierarchyBuilder
.
newInstance
(
getResources
())
.
setPlaceholderImage
(
placeholderDrawable
)
.
build
());
loadImage
(
absolutize
(
attachment
.
getImageUrl
()),
attachedImage
,
load
,
autoloadImages
);
}
...
...
rocket-chat-android-widgets/src/main/res/layout/message_inline_attachment.xml
View file @
9da4ca25
...
...
@@ -106,7 +106,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_marginBottom=
"8dp"
fresco:placeholderImage=
"@drawable/image_dummy"
fresco:actualImageScaleType=
"fitStart"
/>
<TextView
...
...
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