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
f661b3aa
Commit
f661b3aa
authored
Dec 06, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates chat list widgets styles.
parent
d1e0e9e1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
59 deletions
+79
-59
RoomViewHolder.kt
...a/chat/rocket/android/chatrooms/adapter/RoomViewHolder.kt
+21
-7
item_chat.xml
app/src/main/res/layout/item_chat.xml
+5
-5
item_message.xml
app/src/main/res/layout/item_message.xml
+1
-1
item_message_attachment.xml
app/src/main/res/layout/item_message_attachment.xml
+1
-1
item_message_attachment_old.xml
app/src/main/res/layout/item_message_attachment_old.xml
+1
-1
unread_messages_badge.xml
app/src/main/res/layout/unread_messages_badge.xml
+1
-1
colors.xml
app/src/main/res/values/colors.xml
+2
-1
styles.xml
app/src/main/res/values/styles.xml
+47
-42
No files found.
app/src/main/java/chat/rocket/android/chatrooms/adapter/RoomViewHolder.kt
View file @
f661b3aa
...
@@ -10,6 +10,7 @@ import chat.rocket.android.R
...
@@ -10,6 +10,7 @@ import chat.rocket.android.R
import
chat.rocket.android.chatrooms.adapter.model.RoomUiModel
import
chat.rocket.android.chatrooms.adapter.model.RoomUiModel
import
chat.rocket.common.model.RoomType
import
chat.rocket.common.model.RoomType
import
chat.rocket.common.model.UserStatus
import
chat.rocket.common.model.UserStatus
import
chat.rocket.common.util.ifNull
import
kotlinx.android.synthetic.main.item_chat.view.*
import
kotlinx.android.synthetic.main.item_chat.view.*
import
kotlinx.android.synthetic.main.unread_messages_badge.view.*
import
kotlinx.android.synthetic.main.unread_messages_badge.view.*
...
@@ -29,6 +30,12 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
...
@@ -29,6 +30,12 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
image_avatar
.
setImageURI
(
room
.
avatar
)
image_avatar
.
setImageURI
(
room
.
avatar
)
text_chat_name
.
text
=
room
.
name
text_chat_name
.
text
=
room
.
name
if
(
room
.
status
!=
null
&&
room
.
type
is
RoomType
.
DirectMessage
)
{
image_chat_icon
.
setImageDrawable
(
getStatusDrawable
(
room
.
status
))
}
else
{
image_chat_icon
.
setImageDrawable
(
getRoomDrawable
(
room
.
type
))
}
if
(
room
.
lastMessage
!=
null
)
{
if
(
room
.
lastMessage
!=
null
)
{
text_last_message
.
text
=
room
.
lastMessage
text_last_message
.
text
=
room
.
lastMessage
text_last_message
.
isVisible
=
true
text_last_message
.
isVisible
=
true
...
@@ -37,10 +44,10 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
...
@@ -37,10 +44,10 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
}
}
if
(
room
.
date
!=
null
)
{
if
(
room
.
date
!=
null
)
{
text_
last_message_date_time
.
text
=
room
.
date
text_
timestamp
.
text
=
room
.
date
text_
last_message_date_time
.
isVisible
=
true
text_
timestamp
.
isVisible
=
true
}
else
{
}
else
{
text_
last_message_date_time
.
isInvisible
=
true
text_
timestamp
.
isInvisible
=
true
}
}
if
(
room
.
unread
!=
null
)
{
if
(
room
.
unread
!=
null
)
{
...
@@ -50,10 +57,17 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
...
@@ -50,10 +57,17 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
text_total_unread_messages
.
isInvisible
=
true
text_total_unread_messages
.
isInvisible
=
true
}
}
if
(
room
.
status
!=
null
&&
room
.
type
is
RoomType
.
DirectMessage
)
{
if
(
room
.
alert
||
room
.
unread
!=
null
)
{
image_chat_icon
.
setImageDrawable
(
getStatusDrawable
(
room
.
status
))
text_timestamp
.
setTextAppearance
(
}
else
{
context
,
image_chat_icon
.
setImageDrawable
(
getRoomDrawable
(
room
.
type
))
R
.
style
.
ChatList_Timestamp_Unread_TextView
)
text_last_message
.
setTextAppearance
(
context
,
R
.
style
.
ChatList_LastMessage_Unread_TextView
)
text_total_unread_messages
.
text
=
"!"
text_total_unread_messages
.
isVisible
=
true
}
}
setOnClickListener
{
listener
(
room
)
}
setOnClickListener
{
listener
(
room
)
}
...
...
app/src/main/res/layout/item_chat.xml
View file @
f661b3aa
...
@@ -31,19 +31,19 @@
...
@@ -31,19 +31,19 @@
<TextView
<TextView
android:id=
"@+id/text_chat_name"
android:id=
"@+id/text_chat_name"
style=
"@style/Chat
Room.
Name.TextView"
style=
"@style/Chat
List.Chat
Name.TextView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/text_view_drawable_padding"
android:layout_marginStart=
"@dimen/text_view_drawable_padding"
android:textDirection=
"locale"
android:textDirection=
"locale"
app:layout_constraintEnd_toStartOf=
"@+id/text_
last_message_date_time
"
app:layout_constraintEnd_toStartOf=
"@+id/text_
timestamp
"
app:layout_constraintStart_toEndOf=
"@+id/image_chat_icon"
app:layout_constraintStart_toEndOf=
"@+id/image_chat_icon"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"Margaret Hanson"
/>
tools:text=
"Margaret Hanson"
/>
<TextView
<TextView
android:id=
"@+id/text_
last_message_date_time
"
android:id=
"@+id/text_
timestamp
"
style=
"@style/Timestamp.TextView"
style=
"@style/
ChatList.
Timestamp.TextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:textDirection=
"locale"
android:textDirection=
"locale"
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<TextView
<TextView
android:id=
"@+id/text_last_message"
android:id=
"@+id/text_last_message"
style=
"@style/Chat
Room
.LastMessage.TextView"
style=
"@style/Chat
List
.LastMessage.TextView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginTop=
"2dp"
...
...
app/src/main/res/layout/item_message.xml
View file @
f661b3aa
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
<TextView
<TextView
android:id=
"@+id/text_message_time"
android:id=
"@+id/text_message_time"
style=
"@style/Timestamp.TextView"
style=
"@style/
ChatList.
Timestamp.TextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"4dp"
android:layout_marginStart=
"4dp"
...
...
app/src/main/res/layout/item_message_attachment.xml
View file @
f661b3aa
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
<TextView
<TextView
android:id=
"@+id/text_message_time"
android:id=
"@+id/text_message_time"
style=
"@style/Timestamp.TextView"
style=
"@style/
ChatList.
Timestamp.TextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
...
...
app/src/main/res/layout/item_message_attachment_old.xml
View file @
f661b3aa
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<TextView
<TextView
android:id=
"@+id/text_message_time"
android:id=
"@+id/text_message_time"
style=
"@style/Timestamp.TextView"
style=
"@style/
ChatList.
Timestamp.TextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
...
...
app/src/main/res/layout/unread_messages_badge.xml
View file @
f661b3aa
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<TextView
<TextView
android:id=
"@+id/text_total_unread_messages"
android:id=
"@+id/text_total_unread_messages"
style=
"@style/Badge.TextView"
style=
"@style/
ChatList.
Badge.TextView"
android:layout_width=
"21dp"
android:layout_width=
"21dp"
android:layout_height=
"21dp"
android:layout_height=
"21dp"
android:background=
"@drawable/style_total_unread_messages"
android:background=
"@drawable/style_total_unread_messages"
...
...
app/src/main/res/values/colors.xml
View file @
f661b3aa
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
<color
name=
"colorPrimaryText"
>
#DE000000
</color>
<color
name=
"colorPrimaryText"
>
#DE000000
</color>
<color
name=
"colorSecondaryText"
>
#FF787878
</color>
<color
name=
"colorSecondaryText"
>
#FF787878
</color>
<color
name=
"colorSecondaryTextLight"
>
#FFC1C1C1
</color>
<color
name=
"colorSecondaryTextLight"
>
#FFC1C1C1
</color>
<color
name=
"colorTimestampText"
>
#FF5699FF
</color>
<color
name=
"colorTimestampText"
>
#FF9DA2A9
</color>
<color
name=
"colorTimestampTextUnread"
>
#FF5699FF
</color>
<color
name=
"colorLastMessageText"
>
#99000000
</color>
<color
name=
"colorLastMessageText"
>
#99000000
</color>
<!-- User status colors -->
<!-- User status colors -->
...
...
app/src/main/res/values/styles.xml
View file @
f661b3aa
...
@@ -96,12 +96,59 @@
...
@@ -96,12 +96,59 @@
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
</style>
</style>
// REMARK: To be removed as soon as we have our loading view.
<style
name=
"Authentication.AVLoadingIndicatorView"
parent=
"AVLoadingIndicatorView"
>
<style
name=
"Authentication.AVLoadingIndicatorView"
parent=
"AVLoadingIndicatorView"
>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"indicatorColor"
>
@color/colorPrimary
</item>
<item
name=
"indicatorColor"
>
@color/colorPrimary
</item>
<item
name=
"indicatorName"
>
BallPulseIndicator
</item>
<item
name=
"indicatorName"
>
BallPulseIndicator
</item>
</style>
</style>
<!-- End Authentication -->
<!-- Chat list -->
<style
name=
"ChatList.ChatName.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"android:textColor"
>
@color/colorPrimary
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
1
</item>
</style>
<style
name=
"ChatList.LastMessage.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
14sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorLastMessageText
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
2
</item>
</style>
<style
name=
"ChatList.LastMessage.Unread.TextView"
parent=
"ChatList.LastMessage.TextView"
>
<item
name=
"android:fontFamily"
>
sans-serif-medium
</item>
</style>
<style
name=
"ChatList.Timestamp.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
12sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorTimestampText
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
1
</item>
</style>
<style
name=
"ChatList.Timestamp.Unread.TextView"
parent=
"ChatList.Timestamp.TextView"
>
<item
name=
"android:textColor"
>
@color/colorTimestampTextUnread
</item>
</style>
<style
name=
"ChatList.Badge.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
14sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif-medium
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorWhite
</item>
<item
name=
"android:gravity"
>
center
</item>
</style>
<!-- End chat list -->
<style
name=
"EditText.Password"
parent=
"TextAppearance.AppCompat"
>
<style
name=
"EditText.Password"
parent=
"TextAppearance.AppCompat"
>
<!-- Hint color and label color in FALSE state -->
<!-- Hint color and label color in FALSE state -->
...
@@ -111,13 +158,6 @@
...
@@ -111,13 +158,6 @@
<item
name=
"colorControlActivated"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorControlActivated"
>
@color/colorPrimaryDark
</item>
</style>
</style>
<style
name=
"AuthenticationLabel"
parent=
"TextAppearance.AppCompat.Medium"
>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_height"
>
50dp
</item>
<item
name=
"android:layout_marginStart"
>
@dimen/screen_edge_left_and_right_margins
</item>
<item
name=
"android:paddingStart"
>
@dimen/edit_text_margin
</item>
</style>
<style
name=
"ChatRoom.SearchView"
parent=
"Widget.AppCompat.SearchView"
>
<style
name=
"ChatRoom.SearchView"
parent=
"Widget.AppCompat.SearchView"
>
<item
name=
"queryHint"
>
@string/title_search_message
</item>
<item
name=
"queryHint"
>
@string/title_search_message
</item>
<item
name=
"searchIcon"
>
@drawable/ic_search_white_24dp
</item>
<item
name=
"searchIcon"
>
@drawable/ic_search_white_24dp
</item>
...
@@ -129,24 +169,6 @@
...
@@ -129,24 +169,6 @@
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:textSize"
>
16sp
</item>
</style>
</style>
<style
name=
"ChatRoom.Name.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"android:textColor"
>
@color/colorPrimary
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
1
</item>
</style>
<style
name=
"ChatRoom.LastMessage.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
14sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif-medium
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorLastMessageText
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
2
</item>
</style>
<style
name=
"Sender.Name.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<style
name=
"Sender.Name.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
1
</item>
<item
name=
"android:maxLines"
>
1
</item>
...
@@ -168,23 +190,6 @@
...
@@ -168,23 +190,6 @@
<item
name=
"android:textColor"
>
@color/colorPrimaryText
</item>
<item
name=
"android:textColor"
>
@color/colorPrimaryText
</item>
</style>
</style>
<style
name=
"Timestamp.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
12sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorTimestampText
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:maxLines"
>
1
</item>
</style>
<style
name=
"Badge.TextView"
parent=
"TextAppearance.AppCompat.Title"
>
<item
name=
"android:textSize"
>
14sp
</item>
<item
name=
"android:fontFamily"
>
sans-serif-medium
</item>
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorWhite
</item>
<item
name=
"android:gravity"
>
center
</item>
</style>
// REMARK: To be removed.
// REMARK: To be removed.
<style
name=
"Profile.EditText"
parent=
"Authentication.EditText.Border"
>
<style
name=
"Profile.EditText"
parent=
"Authentication.EditText.Border"
>
<item
name=
"android:background"
>
@drawable/style_edit_text_profile
</item>
<item
name=
"android:background"
>
@drawable/style_edit_text_profile
</item>
...
...
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