summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-06-21 19:44:45 -0400
committerLioncash <mathew1800@gmail.com>2014-06-21 19:47:11 -0400
commit8e2015b9cb4ae16320913a8d289fc290f3ab4af4 (patch)
treefdd471115b84294dd5c22f93dfd4513ce509c98c /Source/Android
parent4d39076d045ecabe23eab9106d25151214d6d0ef (diff)
Separate the XML view handling of the folder browser and the game list from one another.
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/res/layout/folderbrowser_list_item.xml57
-rw-r--r--Source/Android/res/layout/folderbrowser_listview.xml8
-rw-r--r--Source/Android/res/layout/gamelist_list_item.xml (renamed from Source/Android/res/layout/gamelist_folderbrowser_list_item.xml)12
-rw-r--r--Source/Android/res/layout/gamelist_listview.xml2
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java4
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java6
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java6
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java2
8 files changed, 81 insertions, 16 deletions
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="fill_parent"
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:padding="3dp">
+
+ <ImageView
+ android:id="@+id/BrowserItemIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+
+ tools:src="@drawable/ic_launcher"
+
+ android:layout_alignParentTop="true"
+ android:layout_alignParentBottom="true"
+ android:layout_marginRight="6dip"/>
+
+ <!-- Properties in the 'tools' namespace are only visible in the UI editor, not at runtime. -->
+ <TextView tools:text="@string/file_size"
+ android:id="@+id/BrowserItemSubTitle"
+ android:layout_width="fill_parent"
+ android:layout_height="26dip"
+
+ android:textColor="#bbbbbb"
+
+ android:layout_toRightOf="@id/BrowserItemIcon"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ />
+
+ <!-- Properties in the 'tools' namespace are only visible in the UI editor, not at runtime. -->
+ <TextView tools:text="Name of Game"
+ android:id="@+id/BrowserItemTitle"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+
+ android:fontFamily="sans-serif-light"
+ android:textSize="22sp"
+ android:textColor="#555555"
+
+ android:singleLine="true"
+ android:ellipsize="end"
+
+ android:layout_toRightOf="@id/BrowserItemIcon"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:layout_above="@id/BrowserItemSubTitle"
+ android:layout_alignWithParentIfMissing="true"
+
+ android:gravity="center_vertical"
+ />
+
+</RelativeLayout>
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 @@
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/gamelist"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:choiceMode="singleChoice"
+ android:dividerHeight="1dp"
+ tools:listitem="@layout/folderbrowser_list_item"/> \ 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
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">
<ImageView
- android:id="@+id/ListItemIcon"
+ android:id="@+id/GameListItemIcon"
android:layout_width="100dp"
android:layout_height="wrap_content"
@@ -18,13 +18,13 @@
<!-- Properties in the 'tools' namespace are only visible in the UI editor, not at runtime. -->
<TextView tools:text="@string/file_size"
- android:id="@+id/ListItemSubTitle"
+ android:id="@+id/GameListItemSubTitle"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:textColor="#bbbbbb"
- android:layout_toRightOf="@id/ListItemIcon"
+ android:layout_toRightOf="@id/GameListItemIcon"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
@@ -34,7 +34,7 @@
<!-- Properties in the 'tools' namespace are only visible in the UI editor, not at runtime. -->
<TextView tools:text="Name of Game"
- android:id="@+id/ListItemTitle"
+ android:id="@+id/GameListItemTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -45,10 +45,10 @@
android:singleLine="true"
android:ellipsize="end"
- android:layout_toRightOf="@id/ListItemIcon"
+ android:layout_toRightOf="@id/GameListItemIcon"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
- android:layout_above="@id/ListItemSubTitle"
+ android:layout_above="@id/GameListItemSubTitle"
android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical"
diff --git a/Source/Android/res/layout/gamelist_listview.xml b/Source/Android/res/layout/gamelist_listview.xml
index 4850de4912..d52b319df6 100644
--- a/Source/Android/res/layout/gamelist_listview.xml
+++ b/Source/Android/res/layout/gamelist_listview.xml
@@ -5,4 +5,4 @@
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:dividerHeight="1dp"
- tools:listitem="@layout/gamelist_folderbrowser_list_item"/> \ 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<FolderBrowserItem>
// 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<GameListItem>
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();