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
53901664
Commit
53901664
authored
Aug 02, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update classes.
parent
8471796e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
20 deletions
+13
-20
MessageRenderer.kt
...main/java/chat/rocket/android/renderer/MessageRenderer.kt
+3
-3
UserRenderer.kt
...rc/main/java/chat/rocket/android/renderer/UserRenderer.kt
+2
-2
RocketChatAvatar.java
...ain/java/chat/rocket/android/widget/RocketChatAvatar.java
+1
-1
RocketChatMessageAttachmentsLayout.java
...id/widget/message/RocketChatMessageAttachmentsLayout.java
+4
-8
RocketChatMessageUrlsLayout.java
...t/android/widget/message/RocketChatMessageUrlsLayout.java
+3
-6
No files found.
app/src/main/java/chat/rocket/android/renderer/MessageRenderer.kt
View file @
53901664
...
...
@@ -5,9 +5,9 @@ import android.widget.ImageView
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.helper.DateTime
import
chat.rocket.android.helper.RocketChatUserAvatar
import
chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.android.widget.RocketChatAvatar
import
chat.rocket.android.widget.helper.UserAvatarHelper
import
chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
import
chat.rocket.android.widget.message.RocketChatMessageLayout
import
chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
...
...
@@ -23,12 +23,12 @@ class MessageRenderer(val message: Message, val autoLoadImage: Boolean) {
val
username
:
String
?
=
message
.
user
?.
username
if
(
username
!=
null
)
{
userNotFoundAvatarImageView
.
visibility
=
View
.
GONE
val
placeholderDrawable
=
RocketChatUserAvata
r
.
getTextDrawable
(
username
,
rocketChatAvatarWidget
.
context
)
val
placeholderDrawable
=
UserAvatarHelpe
r
.
getTextDrawable
(
username
,
rocketChatAvatarWidget
.
context
)
if
(
message
.
avatar
!=
null
)
{
// Load user's avatar image from Oauth provider URI.
rocketChatAvatarWidget
.
loadImage
(
message
.
avatar
,
placeholderDrawable
)
}
else
{
rocketChatAvatarWidget
.
loadImage
(
RocketChatUserAvata
r
.
getUri
(
hostname
,
username
),
placeholderDrawable
)
rocketChatAvatarWidget
.
loadImage
(
UserAvatarHelpe
r
.
getUri
(
hostname
,
username
),
placeholderDrawable
)
}
}
else
{
rocketChatAvatarWidget
.
visibility
=
View
.
GONE
...
...
app/src/main/java/chat/rocket/android/renderer/UserRenderer.kt
View file @
53901664
...
...
@@ -4,8 +4,8 @@ import android.view.View
import
android.widget.ImageView
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.helper.RocketChatUserAvatar
import
chat.rocket.android.widget.RocketChatAvatar
import
chat.rocket.android.widget.helper.UserAvatarHelper
import
chat.rocket.core.models.User
class
UserRenderer
(
val
user
:
User
)
{
...
...
@@ -16,7 +16,7 @@ class UserRenderer(val user: User) {
fun
showAvatar
(
rocketChatAvatarWidget
:
RocketChatAvatar
,
hostname
:
String
)
{
val
username
:
String
?
=
user
.
username
if
(
username
!=
null
)
{
rocketChatAvatarWidget
.
loadImage
(
RocketChatUserAvatar
.
getUri
(
hostname
,
username
),
RocketChatUserAvata
r
.
getTextDrawable
(
username
,
rocketChatAvatarWidget
.
context
))
rocketChatAvatarWidget
.
loadImage
(
UserAvatarHelper
.
getUri
(
hostname
,
username
),
UserAvatarHelpe
r
.
getTextDrawable
(
username
,
rocketChatAvatarWidget
.
context
))
}
else
{
rocketChatAvatarWidget
.
visibility
=
View
.
GONE
}
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RocketChatAvatar.java
View file @
53901664
...
...
@@ -41,6 +41,6 @@ public class RocketChatAvatar extends FrameLayout {
}
public
void
loadImage
(
String
imageUri
,
Drawable
placeholderDrawable
)
{
FrescoHelper
.
loadImage
(
simpleDraweeViewAvatar
,
imageUri
,
placeholderDrawable
);
FrescoHelper
.
INSTANCE
.
loadImage
(
simpleDraweeViewAvatar
,
imageUri
,
placeholderDrawable
);
}
}
\ No newline at end of file
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageAttachmentsLayout.java
View file @
53901664
...
...
@@ -119,8 +119,7 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
authorBox
.
setVisibility
(
VISIBLE
);
FrescoHelper
.
loadImageWithCustomization
((
SimpleDraweeView
)
attachmentView
.
findViewById
(
R
.
id
.
author_icon
),
absolutize
(
author
.
getIconUrl
()));
FrescoHelper
.
INSTANCE
.
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
());
...
...
@@ -187,8 +186,7 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
thumbImage
.
setVisibility
(
GONE
);
}
else
{
thumbImage
.
setVisibility
(
VISIBLE
);
FrescoHelper
.
loadImageWithCustomization
(
thumbImage
,
absolutize
(
thumbUrl
));
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
thumbImage
,
absolutize
(
thumbUrl
));
}
final
TextView
refText
=
(
TextView
)
refBox
.
findViewById
(
R
.
id
.
text
);
...
...
@@ -253,8 +251,7 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
boolean
autoloadImage
)
{
if
(
autoloadImage
)
{
load
.
setVisibility
(
GONE
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
drawee
,
url
);
return
;
}
...
...
@@ -263,8 +260,7 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
public
void
onClick
(
View
v
)
{
load
.
setVisibility
(
GONE
);
load
.
setOnClickListener
(
null
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
drawee
,
url
);
}
});
}
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/RocketChatMessageUrlsLayout.java
View file @
53901664
...
...
@@ -95,8 +95,7 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
if
(
TextUtils
.
isEmpty
(
imageURL
))
{
image
.
setVisibility
(
View
.
GONE
);
}
else
{
FrescoHelper
.
loadImageWithCustomization
(
image
,
imageURL
);
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
image
,
imageURL
);
image
.
setVisibility
(
View
.
VISIBLE
);
}
...
...
@@ -144,8 +143,7 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
boolean
autoloadImage
)
{
if
(
autoloadImage
)
{
load
.
setVisibility
(
GONE
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
drawee
,
url
);
return
;
}
...
...
@@ -154,8 +152,7 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
public
void
onClick
(
View
v
)
{
load
.
setVisibility
(
GONE
);
load
.
setOnClickListener
(
null
);
FrescoHelper
.
loadImageWithCustomization
(
drawee
,
url
);
FrescoHelper
.
INSTANCE
.
loadImageWithCustomization
(
drawee
,
url
);
}
});
}
...
...
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