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
bff56d0d
Commit
bff56d0d
authored
Jul 26, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/RocketChat/Rocket.Chat.Android
into ux
parents
2bef3fd7
e33a2b19
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
170 deletions
+184
-170
Avatar.kt
app/src/main/java/chat/rocket/android/helper/Avatar.kt
+5
-1
AbstractMessageViewHolder.java
...roid/layouthelper/chatroom/AbstractMessageViewHolder.java
+3
-4
MessageRenderer.java
...in/java/chat/rocket/android/renderer/MessageRenderer.java
+5
-7
activity_main.xml
app/src/main/res/layout-w720dp/activity_main.xml
+1
-1
fragment_retry_login.xml
app/src/main/res/layout/fragment_retry_login.xml
+1
-1
fragment_room_main.xml
app/src/main/res/layout/fragment_room_main.xml
+10
-9
fragment_two_step_auth.xml
app/src/main/res/layout/fragment_two_step_auth.xml
+1
-1
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
colors.xml
app/src/main/res/values/colors.xml
+9
-9
room_styles.xml
app/src/main/res/values/room_styles.xml
+1
-1
No files found.
app/src/main/java/chat/rocket/android/helper/Avatar.kt
View file @
bff56d0d
...
...
@@ -4,13 +4,17 @@ import chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.android.widget.RocketChatAvatar
import
java.net.URLEncoder
class
Avatar
(
val
absoluteUrl
:
AbsoluteUrl
,
val
username
:
String
)
{
class
Avatar
(
val
absoluteUrl
:
AbsoluteUrl
?
,
val
username
:
String
)
{
val
imageUrl
:
String
/** REMARK
* This is often a SVG image (see Rocket.Chat:server/startup/avatar.js)
*/
get
()
{
val
avatarUrl
=
"/avatar/"
+
URLEncoder
.
encode
(
username
,
"UTF-8"
)
if
(
absoluteUrl
==
null
)
{
return
avatarUrl
}
return
absoluteUrl
.
from
(
"/avatar/"
+
URLEncoder
.
encode
(
username
,
"UTF-8"
))
}
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/AbstractMessageViewHolder.java
View file @
bff56d0d
...
...
@@ -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,10 +71,11 @@ 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
)
{
...
...
app/src/main/java/chat/rocket/android/renderer/MessageRenderer.java
View file @
bff56d0d
...
...
@@ -38,13 +38,11 @@ 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
());
}
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-w720dp/activity_main.xml
View file @
bff56d0d
...
...
@@ -28,7 +28,7 @@
android:id=
"@+id/activity_main_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:background=
"@
android:
color/white"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
...
...
app/src/main/res/layout/fragment_retry_login.xml
View file @
bff56d0d
...
...
@@ -9,7 +9,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:background=
"@
android:
color/white"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
...
...
app/src/main/res/layout/fragment_room_main.xml
View file @
bff56d0d
...
...
@@ -5,15 +5,16 @@
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/messageRecyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@+id/messageComposer"
/>
android:id=
"@+id/messageRecyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scrollbars=
"vertical"
android:layout_above=
"@+id/messageComposer"
/>
<chat.rocket.android.widget.message.MessageFormLayout
android:id=
"@+id/messageComposer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:theme=
"@style/Theme.AppCompat.Light"
/>
android:id=
"@+id/messageComposer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:theme=
"@style/Theme.AppCompat.Light"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_two_step_auth.xml
View file @
bff56d0d
...
...
@@ -9,7 +9,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:background=
"@
android:
color/white"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
...
...
app/src/main/res/layout/list_item_normal_message.xml
View file @
bff56d0d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
<include
layout=
"@layout/list_item_message_newday"
/>
<include
layout=
"@layout/list_item_message_newday"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"2dp"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"2dp"
>
<chat.rocket.android.widget.RocketChatAvatar
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<chat.rocket.android.widget.RocketChatAvatar
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
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"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"48dp"
android:orientation=
"vertical"
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"48dp"
android:orientation=
"vertical"
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<TextView
android:id=
"@+id/username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.Username"
tools:text=
"John Doe"
/>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Space
android:layout_width=
"4dp"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/
username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.
Username"
tools:text=
"
John Doe"
/>
<TextView
android:id=
"@+id/sub_
username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.Sub
Username"
tools:text=
"\@
John Doe"
/>
<Space
android:layout_width=
"4dp
"
android:layout_height=
"wrap_content"
/>
<Space
android:layout_width=
"@dimen/margin_8
"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/sub_username
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.SubUsernam
e"
tools:text=
"\@John Doe
"
/>
<TextView
android:id=
"@+id/timestamp
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"fals
e"
tools:text=
"12:34
"
/>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<TextView
android:id=
"@+id/timestamp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
</LinearLayout>
<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
android:id=
"@+id/message_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageLayout
android:id=
"@+id/message_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
android:id=
"@+id/message_urls"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
android:id=
"@+id/message_urls"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
android:id=
"@+id/message_attachments"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</FrameLayout>
<chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
android:id=
"@+id/message_attachments"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_system_message.xml
View file @
bff56d0d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
<include
layout=
"@layout/list_item_message_newday"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<chat.rocket.android.widget.RocketChatAvatar
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"48dp"
android:orientation=
"vertical"
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.Username"
tools:text=
"John Doe"
/>
<include
layout=
"@layout/list_item_message_newday"
/>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/timestamp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
<chat.rocket.android.widget.RocketChatAvatar
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<ImageView
android:id=
"@+id/errorImageView"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
android:tint=
"@color/colorAccent"
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>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"48dp"
android:orientation=
"vertical"
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.Message.Username"
tools:text=
"John Doe"
/>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/timestamp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
</LinearLayout>
<TextView
android:id=
"@+id/message_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textStyle=
"italic"
android:enabled=
"false"
/>
</LinearLayout>
</FrameLayout>
<TextView
android:id=
"@+id/message_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textStyle=
"italic"
android:enabled=
"false"
/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
bff56d0d
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"colorPrimary"
>
#044b76
</color>
<color
name=
"colorPrimaryDark"
>
#FF04436a
</color>
<color
name=
"colorAccent"
>
#FF2D91FA
</color>
<color
name=
"colorAccentLight"
>
#FF6CB1FA
</color>
<color
name=
"colorAccentDark"
>
#FF287DD7
</color>
<color
name=
"colorAccent_a40"
>
#662D91FA
</color>
<color
name=
"textColorLink"
>
#008ce3
</color>
<color
name=
"white"
>
#FFFEFEFF
</color>
</resources>
<color
name=
"colorPrimary"
>
#044b76
</color>
<color
name=
"colorPrimaryDark"
>
#FF04436a
</color>
<color
name=
"colorAccent"
>
#FF2D91FA
</color>
<color
name=
"colorAccentLight"
>
#FF6CB1FA
</color>
<color
name=
"colorAccentDark"
>
#FF287DD7
</color>
<color
name=
"colorAccent_a40"
>
#662D91FA
</color>
<color
name=
"textColorLink"
>
#008ce3
</color>
<color
name=
"colorRed400"
>
#FFEF5350
</color>
</resources>
\ No newline at end of file
app/src/main/res/values/room_styles.xml
View file @
bff56d0d
...
...
@@ -2,7 +2,7 @@
<resources>
<style
name=
"Widget.RocketChat.RoomToolbar"
parent=
"Widget.AppCompat.Toolbar"
>
<item
name=
"titleTextAppearance"
>
@style/TextAppearance.Widget.RocketChat.RoomToolbar.Title
</item>
<item
name=
"android:background"
>
@color/white
</item>
<item
name=
"android:background"
>
@
android:
color/white
</item>
</style>
<style
name=
"TextAppearance.Widget.RocketChat.RoomToolbar.Title"
...
...
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