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