mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 15:40:28 +00:00
[Android] Readability cleanup in IconAdapter.java.
This commit is contained in:
parent
97c1745909
commit
e11b678ddd
@ -37,27 +37,27 @@ public final class IconAdapter<T extends IconAdapterItem> extends ArrayAdapter<T
|
|||||||
IconAdapterItem item = getItem(position);
|
IconAdapterItem item = getItem(position);
|
||||||
final boolean enabled = item.isEnabled();
|
final boolean enabled = item.isEnabled();
|
||||||
|
|
||||||
TextView textView = (TextView) convertView.findViewById(R.id.name);
|
TextView title = (TextView) convertView.findViewById(R.id.name);
|
||||||
if (null != textView) {
|
if (title != null) {
|
||||||
textView.setText(item.getText());
|
title.setText(item.getText());
|
||||||
textView.setEnabled(enabled);
|
title.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
textView = (TextView) convertView.findViewById(R.id.sub_name);
|
TextView subtitle = (TextView) convertView.findViewById(R.id.sub_name);
|
||||||
if (null != textView) {
|
if (subtitle != null) {
|
||||||
String subText = item.getSubText();
|
String subText = item.getSubText();
|
||||||
if (null != subText) {
|
if (subText != null) {
|
||||||
textView.setVisibility(View.VISIBLE);
|
subtitle.setVisibility(View.VISIBLE);
|
||||||
textView.setEnabled(item.isEnabled());
|
subtitle.setEnabled(item.isEnabled());
|
||||||
textView.setText(subText);
|
subtitle.setText(subText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageView imageView = (ImageView) convertView.findViewById(R.id.icon);
|
ImageView imageView = (ImageView) convertView.findViewById(R.id.icon);
|
||||||
if (null != imageView) {
|
if (imageView != null) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
final int id = item.getIconResourceId();
|
final int id = item.getIconResourceId();
|
||||||
if (0 != id) {
|
if (id != 0) {
|
||||||
imageView.setImageResource(id);
|
imageView.setImageResource(id);
|
||||||
} else {
|
} else {
|
||||||
imageView.setImageDrawable(item.getIconDrawable());
|
imageView.setImageDrawable(item.getIconDrawable());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user