From c8ddc70c973a86053c663efb3b63092ea3aeb8b0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 16 Nov 2013 04:09:30 -0500 Subject: [PATCH] [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. --- .../src/org/dolphinemu/dolphinemu/AboutFragment.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java index c2adb2a702..defefcc0d4 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java @@ -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); @@ -41,10 +40,10 @@ public final class AboutFragment extends ListFragment 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.