From 650a5265824c6b618bfed17c0278bf7b1a78990a Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Sun, 22 May 2022 18:34:25 +0200 Subject: [PATCH] UserAdaprter: remove harcoded colors --- app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt | 2 +- .../main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt b/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt index ace3f7413..dd19939d3 100644 --- a/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt +++ b/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt @@ -77,7 +77,7 @@ class UserProfileAdapter constructor( */ fun bind(user: User, position: Int) { itemView.findViewById(R.id.search_user_username).text = user.username - if(position %2 == 0) itemView.setBackgroundColor(Color.parseColor("#FFFDF0D7")) + if(position %2 == 0) itemView.setBackgroundColor(itemView.resources.getColor(R.color.darker_floral_white)) imageGetter.fetchImage("profileImg/${user.uid}", this::setImage) diff --git a/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt b/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt index b294907ca..da1f0a96b 100644 --- a/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt +++ b/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt @@ -63,7 +63,8 @@ class UserScoreboardAdapter( itemView.findViewById(R.id.tv_name).text = player.username itemView.findViewById(R.id.tv_score).text = setScore(player).toString() itemView.findViewById(R.id.iv_photo).loadImg(player.image) - if(position %2 == 0) itemView.setBackgroundColor(Color.parseColor("#FFFDF0D7")) + + if(position %2 == 0) itemView.setBackgroundColor(itemView.resources.getColor(R.color.darker_floral_white)) } init {