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
e814e74d
Commit
e814e74d
authored
Jul 19, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update classes using the FrescoHelper and add placeholder to inline attachment/image.
parent
f7c75a2f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
23 deletions
+23
-23
RocketChatAvatar.java
...ain/java/chat/rocket/android/widget/RocketChatAvatar.java
+4
-9
RocketChatMessageAttachmentsLayout.java
...id/widget/message/RocketChatMessageAttachmentsLayout.java
+10
-9
RocketChatMessageUrlsLayout.java
...t/android/widget/message/RocketChatMessageUrlsLayout.java
+7
-5
message_inline_attachment.xml
...widgets/src/main/res/layout/message_inline_attachment.xml
+1
-0
message_inline_image.xml
...roid-widgets/src/main/res/layout/message_inline_image.xml
+1
-0
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RocketChatAvatar.java
View file @
e814e74d
...
...
@@ -6,7 +6,7 @@ import android.os.Build;
import
android.util.AttributeSet
;
import
android.view.LayoutInflater
;
import
android.widget.FrameLayout
;
import
chat.rocket.android.widget.helper.Fresco
Avatar
Helper
;
import
chat.rocket.android.widget.helper.FrescoHelper
;
import
com.facebook.drawee.view.SimpleDraweeView
;
public
class
RocketChatAvatar
extends
FrameLayout
{
...
...
@@ -41,13 +41,8 @@ public class RocketChatAvatar extends FrameLayout {
draweeView
=
findViewById
(
R
.
id
.
drawee_avatar
);
}
public
void
loadImage
(
String
imageUrl
)
{
FrescoAvatarHelper
.
loadImage
(
draweeView
,
imageUrl
);
}
public
void
showFailureImage
()
{
FrescoAvatarHelper
.
showFailureImage
(
draweeView
);
public
void
loadImage
(
String
imageUri
)
{
FrescoHelper
.
loadImage
(
draweeView
,
imageUri
);
}
}
\ No newline at end of file
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageAttachmentsLayout.java
View file @
e814e74d
...
...
@@ -14,9 +14,6 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
java.util.List
;
import
chat.rocket.android.widget.AbsoluteUrl
;
import
chat.rocket.android.widget.R
;
import
chat.rocket.android.widget.helper.FrescoHelper
;
...
...
@@ -24,6 +21,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.view.SimpleDraweeView
;
import
java.util.List
;
/**
*/
...
...
@@ -120,8 +119,8 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
authorBox
.
setVisibility
(
VISIBLE
);
FrescoHelper
.
setupDraweeAndLoadImage
(
absolutize
(
author
.
getIconUrl
()),
(
SimpleDraweeView
)
attachmentView
.
findViewById
(
R
.
id
.
author_icon
));
FrescoHelper
.
loadImageWithCustomization
((
SimpleDraweeView
)
attachmentView
.
findViewById
(
R
.
id
.
author_icon
),
absolutize
(
author
.
getIconUrl
()
));
final
TextView
authorName
=
(
TextView
)
attachmentView
.
findViewById
(
R
.
id
.
author_name
);
authorName
.
setText
(
author
.
getName
());
...
...
@@ -188,7 +187,8 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
thumbImage
.
setVisibility
(
GONE
);
}
else
{
thumbImage
.
setVisibility
(
VISIBLE
);
FrescoHelper
.
setupDraweeAndLoadImage
(
absolutize
(
thumbUrl
),
thumbImage
);
FrescoHelper
.
loadImageWithCustomization
(
thumbImage
,
absolutize
(
thumbUrl
));
}
final
TextView
refText
=
(
TextView
)
refBox
.
findViewById
(
R
.
id
.
text
);
...
...
@@ -253,17 +253,18 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
boolean
autoloadImage
)
{
if
(
autoloadImage
)
{
load
.
setVisibility
(
GONE
);
FrescoHelper
.
setupDraweeAndLoadImage
(
url
,
drawee
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
return
;
}
FrescoHelper
.
setupDrawee
(
drawee
);
load
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
load
.
setVisibility
(
GONE
);
load
.
setOnClickListener
(
null
);
FrescoHelper
.
loadImage
(
url
,
drawee
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
}
});
}
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageUrlsLayout.java
View file @
e814e74d
...
...
@@ -11,12 +11,12 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
chat.rocket.android.widget.helper.FrescoHelper
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
java.util.List
;
import
java.util.Map
;
import
chat.rocket.android.widget.R
;
import
chat.rocket.android.widget.helper.FrescoHelper
;
import
chat.rocket.android.widget.helper.ImageFormat
;
import
chat.rocket.core.models.WebContent
;
import
chat.rocket.core.models.WebContentHeaders
;
...
...
@@ -95,7 +95,8 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
if
(
TextUtils
.
isEmpty
(
imageURL
))
{
image
.
setVisibility
(
View
.
GONE
);
}
else
{
FrescoHelper
.
setupDraweeAndLoadImage
(
imageURL
,
image
);
FrescoHelper
.
loadImageWithCustomization
(
image
,
imageURL
);
image
.
setVisibility
(
View
.
VISIBLE
);
}
...
...
@@ -143,17 +144,18 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
boolean
autoloadImage
)
{
if
(
autoloadImage
)
{
load
.
setVisibility
(
GONE
);
FrescoHelper
.
setupDraweeAndLoadImage
(
url
,
drawee
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
return
;
}
FrescoHelper
.
setupDrawee
(
drawee
);
load
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
load
.
setVisibility
(
GONE
);
load
.
setOnClickListener
(
null
);
FrescoHelper
.
loadImage
(
url
,
drawee
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
}
});
}
...
...
rocket-chat-android-widgets/src/main/res/layout/message_inline_attachment.xml
View file @
e814e74d
...
...
@@ -106,6 +106,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_marginBottom=
"8dp"
fresco:placeholderImage=
"@drawable/image_dummy"
fresco:actualImageScaleType=
"fitStart"
/>
<TextView
...
...
rocket-chat-android-widgets/src/main/res/layout/message_inline_image.xml
View file @
e814e74d
...
...
@@ -10,6 +10,7 @@
android:id=
"@+id/message_inline_image"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
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