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
ea31aeef
Commit
ea31aeef
authored
Aug 25, 2017
by
Lucio Maciel
Committed by
GitHub
Aug 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into fix/composer-crashing
parents
12e64790
1aaf8924
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
RocketChatCache.java
app/src/main/java/chat/rocket/android/RocketChatCache.java
+1
-1
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.
app/src/main/java/chat/rocket/android/RocketChatCache.java
View file @
ea31aeef
...
@@ -83,7 +83,7 @@ public class RocketChatCache {
...
@@ -83,7 +83,7 @@ public class RocketChatCache {
listener
=
(
sharedPreferences
,
changedKey
)
->
{
listener
=
(
sharedPreferences
,
changedKey
)
->
{
if
(
key
.
equals
(
changedKey
)
&&
!
emitter
.
isCancelled
())
{
if
(
key
.
equals
(
changedKey
)
&&
!
emitter
.
isCancelled
())
{
String
value
=
getString
(
key
,
null
);
String
value
=
getString
(
key
,
null
);
emitter
.
onNext
(
Optional
.
of
(
value
));
emitter
.
onNext
(
Optional
.
of
Nullable
(
value
));
}
}
};
};
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageAttachmentsLayout.java
View file @
ea31aeef
...
@@ -4,8 +4,10 @@ import android.annotation.TargetApi;
...
@@ -4,8 +4,10 @@ import android.annotation.TargetApi;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.widget.TextViewCompat
;
import
android.support.v4.widget.TextViewCompat
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.util.AttributeSet
;
...
@@ -21,6 +23,8 @@ import chat.rocket.core.models.Attachment;
...
@@ -21,6 +23,8 @@ import chat.rocket.core.models.Attachment;
import
chat.rocket.core.models.AttachmentAuthor
;
import
chat.rocket.core.models.AttachmentAuthor
;
import
chat.rocket.core.models.AttachmentField
;
import
chat.rocket.core.models.AttachmentField
;
import
chat.rocket.core.models.AttachmentTitle
;
import
chat.rocket.core.models.AttachmentTitle
;
import
com.facebook.drawee.generic.GenericDraweeHierarchyBuilder
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
java.util.List
;
import
java.util.List
;
...
@@ -210,10 +214,20 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
...
@@ -210,10 +214,20 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
imageContainer
.
setVisibility
(
VISIBLE
);
imageContainer
.
setVisibility
(
VISIBLE
);
final
SimpleDraweeView
attachedImage
=
final
SimpleDraweeView
attachedImage
=
attachmentView
.
findViewById
(
R
.
id
.
image
);
(
SimpleDraweeView
)
attachmentView
.
findViewById
(
R
.
id
.
image
);
final
View
load
=
attachmentView
.
findViewById
(
R
.
id
.
image_load
);
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
);
loadImage
(
absolutize
(
attachment
.
getImageUrl
()),
attachedImage
,
load
,
autoloadImages
);
}
}
...
...
rocket-chat-android-widgets/src/main/res/layout/message_inline_attachment.xml
View file @
ea31aeef
...
@@ -106,7 +106,6 @@
...
@@ -106,7 +106,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_height=
"150dp"
android:layout_marginBottom=
"8dp"
android:layout_marginBottom=
"8dp"
fresco:placeholderImage=
"@drawable/image_dummy"
fresco:actualImageScaleType=
"fitStart"
/>
fresco:actualImageScaleType=
"fitStart"
/>
<TextView
<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