[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.
This commit is contained in:
parent
94f8c68a35
commit
c8ddc70c97
|
@ -29,8 +29,7 @@ public final class AboutFragment extends ListFragment
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
|
ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||||
ListView mMainList = (ListView) rootView.findViewById(R.id.gamelist);
|
|
||||||
|
|
||||||
final String yes = getString(R.string.yes);
|
final String yes = getString(R.string.yes);
|
||||||
final String no = getString(R.string.no);
|
final String no = getString(R.string.no);
|
||||||
|
@ -41,10 +40,10 @@ public final class AboutFragment extends ListFragment
|
||||||
Input.add(new AboutFragmentItem(getString(R.string.supports_neon), NativeLibrary.SupportsNEON() ? yes : no));
|
Input.add(new AboutFragmentItem(getString(R.string.supports_neon), NativeLibrary.SupportsNEON() ? yes : no));
|
||||||
|
|
||||||
AboutFragmentAdapter adapter = new AboutFragmentAdapter(getActivity(), R.layout.about_layout, Input);
|
AboutFragmentAdapter adapter = new AboutFragmentAdapter(getActivity(), R.layout.about_layout, Input);
|
||||||
mMainList.setAdapter(adapter);
|
rootView.setAdapter(adapter);
|
||||||
mMainList.setEnabled(false); // Makes the list view non-clickable.
|
rootView.setEnabled(false); // Makes the list view non-clickable.
|
||||||
|
|
||||||
return mMainList;
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents an item in the AboutFragment.
|
// Represents an item in the AboutFragment.
|
||||||
|
|
Loading…
Reference in New Issue