diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java index b0a6231..a13ae7c 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java @@ -1,6 +1,7 @@ package com.cringe_studios.cringe_authenticator.grouplist; import android.content.res.ColorStateList; +import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; @@ -40,7 +41,10 @@ public class GroupListItem extends RecyclerView.ViewHolder { this.selected = selected; if(selected) { - binding.menuItemBackground.setBackground(new ColorDrawable(binding.getRoot().getContext().getResources().getColor(R.color.selected_highlight))); + TypedArray array = binding.getRoot().getContext().getTheme().obtainStyledAttributes(new int[] { R.attr.colorTheme1 }); + int color = array.getColor(0, 0xFFFF00FF); + color = Color.argb(0x55, Color.red(color), Color.green(color), Color.blue(color)); + binding.menuItemBackground.setBackground(new ColorDrawable(color)); }else { binding.menuItemBackground.setBackground(null); } diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/otplist/OTPListItem.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/otplist/OTPListItem.java index 739d7a8..fc40ed6 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/otplist/OTPListItem.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/otplist/OTPListItem.java @@ -1,5 +1,7 @@ package com.cringe_studios.cringe_authenticator.otplist; +import android.content.res.TypedArray; +import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import androidx.annotation.NonNull; @@ -52,7 +54,10 @@ public class OTPListItem extends RecyclerView.ViewHolder { this.selected = selected; if(selected) { - binding.otpCodeBackground.setBackground(new ColorDrawable(binding.getRoot().getContext().getResources().getColor(R.color.selected_highlight))); + TypedArray array = binding.getRoot().getContext().getTheme().obtainStyledAttributes(new int[] { R.attr.colorTheme1 }); + int color = array.getColor(0, 0xFFFF00FF); + color = Color.argb(0x55, Color.red(color), Color.green(color), Color.blue(color)); + binding.otpCodeBackground.setBackground(new ColorDrawable(color)); }else { binding.otpCodeBackground.setBackground(null); } diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f007332..a6816c1 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -16,6 +16,4 @@ #FFE500 #00FFF7 #00FF0A - - #33008BFF \ No newline at end of file