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
95ad502f
Commit
95ad502f
authored
Apr 18, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates getUserStatusDrawable function.
parent
d40ad994
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
52 deletions
+14
-52
DrawableHelper.kt
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
+5
-39
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+1
-2
MainActivity.kt
...src/main/java/chat/rocket/android/main/ui/MainActivity.kt
+1
-5
item_change_status.xml
app/src/main/res/layout/item_change_status.xml
+4
-4
item_chat.xml
app/src/main/res/layout/item_chat.xml
+3
-2
No files found.
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
View file @
95ad502f
...
@@ -108,46 +108,12 @@ object DrawableHelper {
...
@@ -108,46 +108,12 @@ object DrawableHelper {
* @see [UserStatus]
* @see [UserStatus]
* @return The user status drawable.
* @return The user status drawable.
*/
*/
fun
getUserStatusDrawable
(
userStatus
:
UserStatus
?,
context
:
Context
,
getSmallDrawable
:
Boolean
=
false
):
Drawable
{
fun
getUserStatusDrawable
(
userStatus
:
UserStatus
?,
context
:
Context
):
Drawable
{
return
when
(
userStatus
)
{
return
when
(
userStatus
)
{
is
UserStatus
.
Online
->
{
is
UserStatus
.
Online
->
getDrawableFromId
(
R
.
drawable
.
ic_status_online_12dp
,
context
)
getDrawableFromId
(
is
UserStatus
.
Away
->
getDrawableFromId
(
R
.
drawable
.
ic_status_away_12dp
,
context
)
if
(
getSmallDrawable
)
{
is
UserStatus
.
Busy
->
getDrawableFromId
(
R
.
drawable
.
ic_status_busy_12dp
,
context
)
R
.
drawable
.
ic_status_online_12dp
else
->
getDrawableFromId
(
R
.
drawable
.
ic_status_invisible_12dp
,
context
)
}
else
{
R
.
drawable
.
ic_status_online_24dp
},
context
)
}
is
UserStatus
.
Away
->
{
getDrawableFromId
(
if
(
getSmallDrawable
)
{
R
.
drawable
.
ic_status_away_12dp
}
else
{
R
.
drawable
.
ic_status_away_24dp
},
context
)
}
is
UserStatus
.
Busy
->
{
getDrawableFromId
(
if
(
getSmallDrawable
)
{
R
.
drawable
.
ic_status_busy_12dp
}
else
{
R
.
drawable
.
ic_status_busy_24dp
},
context
)
}
else
->
getDrawableFromId
(
if
(
getSmallDrawable
){
R
.
drawable
.
ic_status_invisible_12dp
}
else
{
R
.
drawable
.
ic_status_invisible_24dp
},
context
)
}
}
}
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
95ad502f
...
@@ -94,8 +94,7 @@ class ChatRoomsAdapter(private val context: Context,
...
@@ -94,8 +94,7 @@ class ChatRoomsAdapter(private val context: Context,
)
)
is
RoomType
.
DirectMessage
->
DrawableHelper
.
getUserStatusDrawable
(
is
RoomType
.
DirectMessage
->
DrawableHelper
.
getUserStatusDrawable
(
chatRoom
.
status
,
chatRoom
.
status
,
context
,
context
true
)
)
else
->
null
else
->
null
}
}
...
...
app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt
View file @
95ad502f
...
@@ -84,11 +84,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
...
@@ -84,11 +84,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
override
fun
showUserStatus
(
userStatus
:
UserStatus
)
{
override
fun
showUserStatus
(
userStatus
:
UserStatus
)
{
headerLayout
.
apply
{
headerLayout
.
apply
{
image_user_status
.
setImageDrawable
(
image_user_status
.
setImageDrawable
(
DrawableHelper
.
getUserStatusDrawable
(
DrawableHelper
.
getUserStatusDrawable
(
userStatus
,
this
.
context
)
userStatus
,
this
.
context
,
true
)
)
)
}
}
}
}
...
...
app/src/main/res/layout/item_change_status.xml
View file @
95ad502f
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
android:paddingStart=
"16dp"
android:paddingStart=
"16dp"
android:paddingTop=
"8dp"
android:paddingTop=
"8dp"
android:drawablePadding=
"10dp"
android:drawablePadding=
"10dp"
android:drawableStart=
"@drawable/ic_status_online_
24
dp"
android:drawableStart=
"@drawable/ic_status_online_
12
dp"
android:text=
"@string/action_online"
android:text=
"@string/action_online"
android:background=
"?selectableItemBackground"
/>
android:background=
"?selectableItemBackground"
/>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
android:paddingStart=
"16dp"
android:paddingStart=
"16dp"
android:paddingTop=
"8dp"
android:paddingTop=
"8dp"
android:drawablePadding=
"10dp"
android:drawablePadding=
"10dp"
android:drawableStart=
"@drawable/ic_status_away_
24
dp"
android:drawableStart=
"@drawable/ic_status_away_
12
dp"
android:text=
"@string/action_away"
android:text=
"@string/action_away"
android:background=
"?selectableItemBackground"
/>
android:background=
"?selectableItemBackground"
/>
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
android:paddingStart=
"16dp"
android:paddingStart=
"16dp"
android:paddingTop=
"8dp"
android:paddingTop=
"8dp"
android:drawablePadding=
"10dp"
android:drawablePadding=
"10dp"
android:drawableStart=
"@drawable/ic_status_busy_
24
dp"
android:drawableStart=
"@drawable/ic_status_busy_
12
dp"
android:text=
"@string/action_busy"
android:text=
"@string/action_busy"
android:background=
"?selectableItemBackground"
/>
android:background=
"?selectableItemBackground"
/>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
android:paddingStart=
"16dp"
android:paddingStart=
"16dp"
android:paddingTop=
"8dp"
android:paddingTop=
"8dp"
android:drawablePadding=
"10dp"
android:drawablePadding=
"10dp"
android:drawableStart=
"@drawable/ic_status_invisible_
24
dp"
android:drawableStart=
"@drawable/ic_status_invisible_
12
dp"
android:text=
"@string/action_invisible"
android:text=
"@string/action_invisible"
android:background=
"?selectableItemBackground"
/>
android:background=
"?selectableItemBackground"
/>
...
...
app/src/main/res/layout/item_chat.xml
View file @
95ad502f
...
@@ -49,8 +49,9 @@
...
@@ -49,8 +49,9 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"5dp"
android:layout_marginEnd=
"5dp"
android:layout_marginStart=
"5dp"
android:layout_marginStart=
"5dp"
app:layout_constraintB
aseline_toBaselineOf=
"@+id/text_chat_name
"
app:layout_constraintB
ottom_toBottomOf=
"@+id/image_chat_icon
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/image_chat_icon"
tools:text=
"11:45 AM"
/>
tools:text=
"11:45 AM"
/>
<TextView
<TextView
...
@@ -65,7 +66,7 @@
...
@@ -65,7 +66,7 @@
app:layout_constraintEnd_toStartOf=
"@id/layout_unread_messages_badge"
app:layout_constraintEnd_toStartOf=
"@id/layout_unread_messages_badge"
app:layout_constraintStart_toStartOf=
"@id/image_chat_icon"
app:layout_constraintStart_toStartOf=
"@id/image_chat_icon"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_name"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_name"
tools:text=
"
You
: Type something that is very big and need at least to lines, or maybe even more"
/>
tools:text=
"
Filipe de Lima Brito
: Type something that is very big and need at least to lines, or maybe even more"
/>
<include
<include
android:id=
"@+id/layout_unread_messages_badge"
android:id=
"@+id/layout_unread_messages_badge"
...
...
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