From 8e2015b9cb4ae16320913a8d289fc290f3ab4af4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 21 Jun 2014 19:44:45 -0400 Subject: [PATCH] Separate the XML view handling of the folder browser and the game list from one another. --- .../res/layout/folderbrowser_list_item.xml | 57 +++++++++++++++++++ .../res/layout/folderbrowser_listview.xml | 8 +++ ...r_list_item.xml => gamelist_list_item.xml} | 12 ++-- .../Android/res/layout/gamelist_listview.xml | 2 +- .../folderbrowser/FolderBrowser.java | 4 +- .../folderbrowser/FolderBrowserAdapter.java | 6 +- .../dolphinemu/gamelist/GameListAdapter.java | 6 +- .../dolphinemu/gamelist/GameListFragment.java | 2 +- 8 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 Source/Android/res/layout/folderbrowser_list_item.xml create mode 100644 Source/Android/res/layout/folderbrowser_listview.xml rename Source/Android/res/layout/{gamelist_folderbrowser_list_item.xml => gamelist_list_item.xml} (84%) diff --git a/Source/Android/res/layout/folderbrowser_list_item.xml b/Source/Android/res/layout/folderbrowser_list_item.xml new file mode 100644 index 0000000000..15877bb64a --- /dev/null +++ b/Source/Android/res/layout/folderbrowser_list_item.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/Source/Android/res/layout/folderbrowser_listview.xml b/Source/Android/res/layout/folderbrowser_listview.xml new file mode 100644 index 0000000000..3e213ed72f --- /dev/null +++ b/Source/Android/res/layout/folderbrowser_listview.xml @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/Source/Android/res/layout/gamelist_folderbrowser_list_item.xml b/Source/Android/res/layout/gamelist_list_item.xml similarity index 84% rename from Source/Android/res/layout/gamelist_folderbrowser_list_item.xml rename to Source/Android/res/layout/gamelist_list_item.xml index 2d34825690..2d7c204d4d 100644 --- a/Source/Android/res/layout/gamelist_folderbrowser_list_item.xml +++ b/Source/Android/res/layout/gamelist_list_item.xml @@ -6,7 +6,7 @@ android:padding="3dp"> \ No newline at end of file + tools:listitem="@layout/gamelist_list_item"/> \ No newline at end of file diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java index 8aa561376a..1985249718 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java @@ -123,8 +123,8 @@ public final class FolderBrowser extends ListFragment if(currentDir == null) currentDir = new File(Environment.getExternalStorageDirectory().getPath()); - ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false); - adapter = new FolderBrowserAdapter(getActivity(), R.layout.gamelist_folderbrowser_list_item); + ListView rootView = (ListView) inflater.inflate(R.layout.folderbrowser_listview, container, false); + adapter = new FolderBrowserAdapter(getActivity(), R.layout.folderbrowser_list_item); rootView.setAdapter(adapter); Fill(currentDir); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java index f97799e6e4..d248554919 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java @@ -63,9 +63,9 @@ public final class FolderBrowserAdapter extends ArrayAdapter // Initialize the ViewHolder and store it. viewHolder = new ViewHolder(); - viewHolder.title = (TextView) convertView.findViewById(R.id.ListItemTitle); - viewHolder.subtitle = (TextView) convertView.findViewById(R.id.ListItemSubTitle); - viewHolder.icon = (ImageView) convertView.findViewById(R.id.ListItemIcon); + viewHolder.title = (TextView) convertView.findViewById(R.id.BrowserItemTitle); + viewHolder.subtitle = (TextView) convertView.findViewById(R.id.BrowserItemSubTitle); + viewHolder.icon = (ImageView) convertView.findViewById(R.id.BrowserItemIcon); convertView.setTag(viewHolder); } else // Can recover the holder. diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java index fc715455a8..8ce1afd216 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java @@ -52,9 +52,9 @@ public final class GameListAdapter extends ArrayAdapter final GameListItem item = getItem(position); if (item != null) { - TextView title = (TextView) convertView.findViewById(R.id.ListItemTitle); - TextView subtitle = (TextView) convertView.findViewById(R.id.ListItemSubTitle); - ImageView icon = (ImageView) convertView.findViewById(R.id.ListItemIcon); + TextView title = (TextView) convertView.findViewById(R.id.GameListItemTitle); + TextView subtitle = (TextView) convertView.findViewById(R.id.GameListItemSubTitle); + ImageView icon = (ImageView) convertView.findViewById(R.id.GameListItemIcon); if (title != null) title.setText(item.getName()); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java index 9dedf914dc..244902af67 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java @@ -107,7 +107,7 @@ public final class GameListFragment extends ListFragment public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false); - mGameAdapter = new GameListAdapter(getActivity(), R.layout.gamelist_folderbrowser_list_item); + mGameAdapter = new GameListAdapter(getActivity(), R.layout.gamelist_list_item); rootView.setAdapter(mGameAdapter); Fill();