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
2884d2dc
Commit
2884d2dc
authored
Jul 20, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better SyncState.FAILED handling.
parent
9b8ae5be
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
147 deletions
+156
-147
AbstractMessageViewHolder.java
...roid/layouthelper/chatroom/AbstractMessageViewHolder.java
+3
-4
MessageRenderer.java
...in/java/chat/rocket/android/renderer/MessageRenderer.java
+5
-7
list_item_normal_message.xml
app/src/main/res/layout/list_item_normal_message.xml
+82
-76
list_item_system_message.xml
app/src/main/res/layout/list_item_system_message.xml
+66
-60
No files found.
app/src/main/java/chat/rocket/android/layouthelper/chatroom/AbstractMessageViewHolder.java
View file @
2884d2dc
...
...
@@ -43,11 +43,9 @@ public abstract class AbstractMessageViewHolder extends ModelViewHolder<PairedMe
*/
public
final
void
bind
(
PairedMessage
pairedMessage
,
boolean
autoloadImages
)
{
if
(
pairedMessage
.
target
.
getSyncState
()
==
SyncState
.
FAILED
)
{
avatar
.
setVisibility
(
View
.
GONE
);
errorImageView
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
errorImageView
.
setVisibility
(
View
.
GONE
);
avatar
.
setVisibility
(
View
.
VISIBLE
);
}
bindMessage
(
pairedMessage
,
autoloadImages
);
...
...
@@ -73,11 +71,12 @@ public abstract class AbstractMessageViewHolder extends ModelViewHolder<PairedMe
private
void
setSequential
(
boolean
sequential
)
{
if
(
avatar
!=
null
)
{
if
(
sequential
)
if
(
sequential
)
{
avatar
.
setVisibility
(
View
.
GONE
);
else
}
else
{
avatar
.
setVisibility
(
View
.
VISIBLE
);
}
}
if
(
userAndTimeContainer
!=
null
)
{
if
(
sequential
)
...
...
app/src/main/java/chat/rocket/android/renderer/MessageRenderer.java
View file @
2884d2dc
...
...
@@ -38,14 +38,12 @@ public class MessageRenderer extends AbstractRenderer<Message> {
return
this
;
}
if
(
object
.
getSyncState
()
!=
SyncState
.
FAILED
)
{
if
(
TextUtils
.
isEmpty
(
object
.
getAvatar
()))
{
userRenderer
.
avatarInto
(
rocketChatAvatar
,
absoluteUrl
);
// Avatar from oauth providers
}
else
{
rocketChatAvatar
.
loadImage
(
object
.
getAvatar
());
}
}
return
this
;
}
...
...
app/src/main/res/layout/list_item_normal_message.xml
View file @
2884d2dc
...
...
@@ -20,15 +20,6 @@
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<ImageView
android:id=
"@+id/errorImageView"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
android:tint=
"@color/colorAccent"
app:srcCompat=
"@drawable/ic_error_black_24dp"
android:visibility=
"gone"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -72,6 +63,21 @@
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<ImageView
android:id=
"@+id/errorImageView"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:layout_gravity=
"end"
android:gravity=
"end"
android:tint=
"@color/colorRed400"
app:srcCompat=
"@drawable/ic_error_black_24dp"
android:visibility=
"gone"
/>
</LinearLayout>
<chat.rocket.android.widget.message.RocketChatMessageLayout
...
...
app/src/main/res/layout/list_item_system_message.xml
View file @
2884d2dc
...
...
@@ -19,15 +19,6 @@
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<ImageView
android:id=
"@+id/errorImageView"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
android:tint=
"@color/colorAccent"
app:srcCompat=
"@drawable/ic_error_black_24dp"
android:visibility=
"gone"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -60,6 +51,21 @@
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<ImageView
android:id=
"@+id/errorImageView"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:layout_gravity=
"end"
android:gravity=
"end"
android:tint=
"@color/colorRed400"
app:srcCompat=
"@drawable/ic_error_black_24dp"
android:visibility=
"gone"
/>
</LinearLayout>
<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