mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +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);
|
||||
final boolean enabled = item.isEnabled();
|
||||
|
||||
TextView textView = (TextView) convertView.findViewById(R.id.name);
|
||||
if (null != textView) {
|
||||
textView.setText(item.getText());
|
||||
textView.setEnabled(enabled);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.name);
|
||||
if (title != null) {
|
||||
title.setText(item.getText());
|
||||
title.setEnabled(enabled);
|
||||
}
|
||||
|
||||
textView = (TextView) convertView.findViewById(R.id.sub_name);
|
||||
if (null != textView) {
|
||||
TextView subtitle = (TextView) convertView.findViewById(R.id.sub_name);
|
||||
if (subtitle != null) {
|
||||
String subText = item.getSubText();
|
||||
if (null != subText) {
|
||||
textView.setVisibility(View.VISIBLE);
|
||||
textView.setEnabled(item.isEnabled());
|
||||
textView.setText(subText);
|
||||
if (subText != null) {
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
subtitle.setEnabled(item.isEnabled());
|
||||
subtitle.setText(subText);
|
||||
}
|
||||
}
|
||||
|
||||
ImageView imageView = (ImageView) convertView.findViewById(R.id.icon);
|
||||
if (null != imageView) {
|
||||
if (imageView != null) {
|
||||
if (enabled) {
|
||||
final int id = item.getIconResourceId();
|
||||
if (0 != id) {
|
||||
if (id != 0) {
|
||||
imageView.setImageResource(id);
|
||||
} else {
|
||||
imageView.setImageDrawable(item.getIconDrawable());
|
||||
|
Loading…
x
Reference in New Issue
Block a user