Added Generic and Specific Fragments
Generic Fragment Layout was defined Specific Laout Object wer integrated including all object specific handling FragmentObjects can now be added to ListViews. Possible clean solution would be to have a PagingAdapter for each object type.
This commit is contained in:
63
app/src/main/res/layout/generic_list_item.xml
Normal file
63
app/src/main/res/layout/generic_list_item.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" android:layout_centerHorizontal="true">
|
||||
|
||||
<!-- CheckBox indicating the current availability status -->
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/availability_checkbox"/>
|
||||
|
||||
<!-- LinearLayout container which holds multiple TextViews for multiple information
|
||||
(e.g. name and weight) -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/multiple_information_container">
|
||||
|
||||
<!-- The TextView containing the objects name -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/multi_view_name" />
|
||||
|
||||
<!-- LinearLayout which aligns the additional information properly -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- TextView holding the first value (e.g. weight) -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/additional_info_first" />
|
||||
|
||||
<!-- TextView which has a function as a separator between the first and the second
|
||||
value -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/additional_information_separator"
|
||||
android:layout_marginLeft="@dimen/separator_margin"
|
||||
android:layout_marginRight="@dimen/separator_margin"
|
||||
android:text="@string/separator"/>
|
||||
|
||||
<!-- TextView holding the second value (e.g. dedicated driver) -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/additional_info_second"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- TextView which simply holds a name without additional information -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/single_info_name"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
6
app/src/main/res/values/dimens.xml
Normal file
6
app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="separator_margin">10dp</dimen>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,3 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">MarioKartCircuitSelector</string>
|
||||
|
||||
<string name="separator">-</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user