Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Simplify the AboutFragment view inflating. Considering the …
…backing layout is a direct ListView, the original rootView can just be casted to a ListView, no need for an intermediate.
  • Loading branch information
lioncash committed Nov 16, 2013
1 parent 94f8c68 commit c8ddc70
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -29,8 +29,7 @@ public final class AboutFragment extends ListFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
ListView mMainList = (ListView) rootView.findViewById(R.id.gamelist);
ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);

final String yes = getString(R.string.yes);
final String no = getString(R.string.no);
Expand All @@ -41,10 +40,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
Input.add(new AboutFragmentItem(getString(R.string.supports_neon), NativeLibrary.SupportsNEON() ? yes : no));

AboutFragmentAdapter adapter = new AboutFragmentAdapter(getActivity(), R.layout.about_layout, Input);
mMainList.setAdapter(adapter);
mMainList.setEnabled(false); // Makes the list view non-clickable.
rootView.setAdapter(adapter);
rootView.setEnabled(false); // Makes the list view non-clickable.

return mMainList;
return rootView;
}

// Represents an item in the AboutFragment.
Expand Down

0 comments on commit c8ddc70

Please sign in to comment.