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
98812bdf
Commit
98812bdf
authored
Feb 26, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add svgs for room type symbol
temp
parent
56422eca
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
17 deletions
+48
-17
ChatRoomActivity.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
+13
-10
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+4
-7
ic_room_channel.xml
app/src/main/res/drawable/ic_room_channel.xml
+9
-0
ic_room_dm.xml
app/src/main/res/drawable/ic_room_dm.xml
+9
-0
ic_room_lock.xml
app/src/main/res/drawable/ic_room_lock.xml
+9
-0
app_bar_chat_room.xml
app/src/main/res/layout/app_bar_chat_room.xml
+1
-0
item_chat.xml
app/src/main/res/layout/item_chat.xml
+1
-0
dimens.xml
app/src/main/res/values/dimens.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
View file @
98812bdf
...
@@ -3,6 +3,7 @@ package chat.rocket.android.chatroom.ui
...
@@ -3,6 +3,7 @@ package chat.rocket.android.chatroom.ui
import
DrawableHelper
import
DrawableHelper
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.graphics.drawable.Drawable
import
android.os.Bundle
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v4.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.R
...
@@ -74,24 +75,26 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
...
@@ -74,24 +75,26 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
setSupportActionBar
(
toolbar
)
setSupportActionBar
(
toolbar
)
supportActionBar
?.
setDisplayShowTitleEnabled
(
false
)
supportActionBar
?.
setDisplayShowTitleEnabled
(
false
)
text_room_name
.
textContent
=
chatRoomName
text_room_name
.
textContent
=
chatRoomName
var
drawable
:
Drawable
?
=
null
when
(
chatRoomType
)
{
when
(
chatRoomType
)
{
RoomType
.
CHANNEL
.
toString
()
->
{
RoomType
.
CHANNEL
.
toString
()
->
{
text_room_name
.
textContent
=
"#"
+
chatRoomName
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_channel
,
this
)
}
}
RoomType
.
PRIVATE_GROUP
.
toString
()
->
{
RoomType
.
PRIVATE_GROUP
.
toString
()
->
{
val
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_lock_black_24dp
,
this
)
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
this
)
DrawableHelper
.
wrapDrawable
(
drawable
)
DrawableHelper
.
tintDrawable
(
drawable
,
this
,
R
.
color
.
white
)
DrawableHelper
.
compoundDrawable
(
text_room_name
,
drawable
)
text_room_name
.
textContent
=
chatRoomName
}
}
RoomType
.
DIRECT_MESSAGE
.
toString
()
->
{
RoomType
.
DIRECT_MESSAGE
.
toString
()
->
{
text_room_name
.
textContent
=
"@"
+
chatRoomName
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_dm
,
this
)
}
else
->
{
text_room_name
.
textContent
=
chatRoomName
}
}
}
}
drawable
?.
let
{
DrawableHelper
.
wrapDrawable
(
it
)
DrawableHelper
.
tintDrawable
(
it
,
this
,
R
.
color
.
white
)
DrawableHelper
.
compoundDrawable
(
text_room_name
,
it
)
}
toolbar
.
setNavigationOnClickListener
{
toolbar
.
setNavigationOnClickListener
{
finishActivity
()
finishActivity
()
}
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
98812bdf
...
@@ -72,19 +72,16 @@ class ChatRoomsAdapter(private val context: Context,
...
@@ -72,19 +72,16 @@ class ChatRoomsAdapter(private val context: Context,
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
when
(
chatRoom
.
type
)
{
when
(
chatRoom
.
type
)
{
is
RoomType
.
Channel
->
{
is
RoomType
.
Channel
->
{
textView
.
textContent
=
"#"
+
chatRoom
.
name
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_channel
,
context
))
}
}
is
RoomType
.
PrivateGroup
->
{
is
RoomType
.
PrivateGroup
->
{
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_lock_black_24dp
,
context
))
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
context
))
textView
.
textContent
=
chatRoom
.
name
}
}
is
RoomType
.
DirectMessage
->
{
is
RoomType
.
DirectMessage
->
{
textView
.
textContent
=
"@"
+
chatRoom
.
name
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_dm
,
context
))
}
else
->
{
textView
.
textContent
=
chatRoom
.
name
}
}
}
}
textView
.
textContent
=
chatRoom
.
name
}
}
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
...
...
app/src/main/res/drawable/ic_room_channel.xml
0 → 100644
View file @
98812bdf
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"16dp"
android:height=
"16dp"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M22.548,9l0.452,-2h-5.364l1.364,-6h-2l-1.364,6h-5l1.364,-6h-2l-1.364,6h-6.184l-0.452,2h6.182l-1.364,6h-5.36l-0.458,2h5.364l-1.364,6h2l1.364,-6h5l-1.364,6h2l1.364,-6h6.185l0.451,-2h-6.182l1.364,-6h5.366zM13.818,15h-5l1.364,-6h5l-1.364,6z"
/>
</vector>
app/src/main/res/drawable/ic_room_dm.xml
0 → 100644
View file @
98812bdf
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"16dp"
android:height=
"16dp"
android:viewportHeight=
"20.0"
android:viewportWidth=
"20.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M13.6,13.47c-0.91,0.953 -2.191,1.545 -3.61,1.545 -2.756,0 -4.99,-2.234 -4.99,-4.99 0,-0.009 0,-0.018 0,-0.026v0.001c0,-2.761 2.239,-5 5,-5 1.131,0 2.175,0.376 3.013,1.009l-0.013,-0.009v-1h2v6.5c0,0.828 0.672,1.5 1.5,1.5s1.5,-0.672 1.5,-1.5v0,-1.5c-0.003,-4.416 -3.584,-7.994 -8,-7.994 -4.418,0 -8,3.582 -8,8s3.582,8 8,8c1.305,0 2.537,-0.312 3.625,-0.867l-0.045,0.021 0.9,1.79c-1.305,0.668 -2.847,1.06 -4.48,1.06 -5.523,0 -10,-4.477 -10,-10s4.477,-10 10,-10c5.519,0 9.994,4.472 10,9.99v0.001h-0.01v1.5c0,0.003 0,0.007 0,0.01 0,1.933 -1.567,3.5 -3.5,3.5 -1.202,0 -2.262,-0.606 -2.892,-1.528l-0.008,-0.012zM10,13c1.657,0 3,-1.343 3,-3s-1.343,-3 -3,-3v0c-1.657,0 -3,1.343 -3,3s1.343,3 3,3v0z"
/>
</vector>
app/src/main/res/drawable/ic_room_lock.xml
0 → 100644
View file @
98812bdf
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"16dp"
android:height=
"16dp"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M18,10v-4c0,-3.313 -2.687,-6 -6,-6s-6,2.687 -6,6v4h-3v14h18v-14h-3zM8,6c0,-2.206 1.794,-4 4,-4s4,1.794 4,4v4h-8v-4zM19,22h-14v-10h14v10z"
/>
</vector>
app/src/main/res/layout/app_bar_chat_room.xml
View file @
98812bdf
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
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"
android:drawablePadding=
"@dimen/text_view_drawable_padding"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:maxLines=
"1"
android:maxLines=
"1"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
...
...
app/src/main/res/layout/item_chat.xml
View file @
98812bdf
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
style=
"@style/ChatRoom.Name.TextView"
style=
"@style/ChatRoom.Name.TextView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawablePadding=
"@dimen/text_view_drawable_padding"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@+id/text_last_message_date_time"
app:layout_constraintRight_toLeftOf=
"@+id/text_last_message_date_time"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
app/src/main/res/values/dimens.xml
View file @
98812bdf
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
<dimen
name=
"edit_text_margin"
>
10dp
</dimen>
<dimen
name=
"edit_text_margin"
>
10dp
</dimen>
<dimen
name=
"edit_text_drawable_padding"
>
16dp
</dimen>
<dimen
name=
"edit_text_drawable_padding"
>
16dp
</dimen>
<dimen
name=
"text_view_drawable_padding"
>
4dp
</dimen>
<dimen
name=
"fab_elevation"
>
6dp
</dimen>
<dimen
name=
"fab_elevation"
>
6dp
</dimen>
<dimen
name=
"divider_item_decorator_bound_start"
>
72dp
</dimen>
<dimen
name=
"divider_item_decorator_bound_start"
>
72dp
</dimen>
...
...
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