Close TypedArray
This commit is contained in:
parent
7be7e0e11e
commit
9d822b2725
@ -42,9 +42,13 @@ public class GroupListItem extends RecyclerView.ViewHolder {
|
||||
|
||||
if(selected) {
|
||||
TypedArray array = binding.getRoot().getContext().getTheme().obtainStyledAttributes(new int[] { R.attr.colorTheme1 });
|
||||
try {
|
||||
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));
|
||||
} finally {
|
||||
array.close();
|
||||
}
|
||||
}else {
|
||||
binding.menuItemBackground.setBackground(null);
|
||||
}
|
||||
|
@ -55,9 +55,13 @@ public class OTPListItem extends RecyclerView.ViewHolder {
|
||||
|
||||
if(selected) {
|
||||
TypedArray array = binding.getRoot().getContext().getTheme().obtainStyledAttributes(new int[] { R.attr.colorTheme1 });
|
||||
try {
|
||||
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));
|
||||
} finally {
|
||||
array.close();
|
||||
}
|
||||
}else {
|
||||
binding.otpCodeBackground.setBackground(null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user