Separate the XML view handling of the folder browser and the game list from one another.

This commit is contained in:
Lioncash
2014-06-21 19:44:45 -04:00
parent 4d39076d04
commit 8e2015b9cb
8 changed files with 81 additions and 16 deletions

View File

@ -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>

View File

@ -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"/>

View File

@ -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"

View File

@ -5,4 +5,4 @@
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:dividerHeight="1dp"
tools:listitem="@layout/gamelist_folderbrowser_list_item"/>
tools:listitem="@layout/gamelist_list_item"/>