Commit 094c88d4 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add user drawables for chat list and nav. drawer

parent c1d1ad89
......@@ -108,18 +108,46 @@ object DrawableHelper {
* @see [UserStatus]
* @return The user status drawable.
*/
fun getUserStatusDrawable(userStatus: UserStatus, context: Context): Drawable {
fun getUserStatusDrawable(userStatus: UserStatus, context: Context, getSmallDrawable: Boolean = false): Drawable {
return when (userStatus) {
is UserStatus.Online -> {
getDrawableFromId(R.drawable.ic_status_online_24dp, context)
getDrawableFromId(
if (getSmallDrawable) {
R.drawable.ic_status_online_12dp
} else {
R.drawable.ic_status_online_24dp
},
context
)
}
is UserStatus.Away -> {
getDrawableFromId(R.drawable.ic_status_away_24dp, context)
getDrawableFromId(
if (getSmallDrawable) {
R.drawable.ic_status_away_12dp
} else {
R.drawable.ic_status_away_24dp
},
context
)
}
is UserStatus.Busy -> {
getDrawableFromId(R.drawable.ic_status_busy_24dp, context)
getDrawableFromId(
if (getSmallDrawable) {
R.drawable.ic_status_busy_12dp
} else {
R.drawable.ic_status_busy_24dp
},
context
)
}
else -> getDrawableFromId(R.drawable.ic_status_invisible_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
......@@ -94,9 +94,9 @@ class ChatRoomsAdapter(private val context: Context,
is RoomType.DirectMessage -> {
val status = chatRoom.status
if (status == null) {
DrawableHelper.getUserStatusDrawable(UserStatus.Offline(), context)
DrawableHelper.getUserStatusDrawable(UserStatus.Offline(), context, true)
} else {
DrawableHelper.getUserStatusDrawable(status, context)
DrawableHelper.getUserStatusDrawable(status, context, true)
}
}
else -> null
......
......@@ -86,7 +86,8 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
image_user_status.setImageDrawable(
DrawableHelper.getUserStatusDrawable(
userStatus,
this.context
this.context,
true
)
)
}
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportHeight="12"
android:viewportWidth="12">
<path
android:fillColor="#FFFFD100"
android:fillType="evenOdd"
android:pathData="M6,6m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:strokeColor="#00000000"
android:strokeWidth="1" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
android:strokeColor="#FFFFFF"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportHeight="12"
android:viewportWidth="12">
<path
android:fillColor="#FFFF2A57"
android:fillType="evenOdd"
android:pathData="M6,6m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:strokeColor="#00000000"
android:strokeWidth="1" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
android:strokeColor="#FFFFFF"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportHeight="12"
android:viewportWidth="12">
<path
android:fillColor="#FFCBCED1"
android:fillType="evenOdd"
android:pathData="M6,6m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:strokeColor="#00000000"
android:strokeWidth="1" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
android:strokeColor="#FFFFFF"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportHeight="12"
android:viewportWidth="12">
<path
android:fillColor="#FF2DE0A5"
android:fillType="evenOdd"
android:pathData="M6,6m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:strokeColor="#00000000"
android:strokeWidth="1" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
android:strokeColor="#FFFFFF"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
......@@ -43,8 +43,8 @@
<ImageView
android:id="@+id/image_user_status"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_width="12dp"
android:layout_height="12dp"
app:layout_constraintStart_toStartOf="parent" />
<TextView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment