Fragments

This commit is contained in:
Sergey Solovyev
2012-09-27 00:10:33 +04:00
parent fe4ba72c7a
commit 9987670225
23 changed files with 635 additions and 480 deletions

View File

@@ -1,24 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:orientation="vertical"
a:id="@+id/ad_parent_view"
style="?fragmentLayoutStyle"
a:orientation="vertical">
a:layout_width="match_parent"
a:layout_height="match_parent">
<TextView a:id="@+id/fragmentTitle"
a:layout_height="wrap_content"
a:layout_width="match_parent"
style="?fragmentTitleStyle"/>
<include layout="@layout/ad"/>
<ListView
a:layout_width="match_parent"
a:layout_height="match_parent"
a:id="@android:id/list"
a:divider="@null"
a:dividerHeight="0dp"
a:cacheColorHint="@android:color/transparent"/>
<ListView style="?fragmentListViewStyle"/>
</LinearLayout>

View File

@@ -9,21 +9,24 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:id="@+id/ad_parent_view"
a:layout_width="fill_parent"
a:layout_height="fill_parent">
style="?fragmentLayoutStyle"
a:layout_width="match_parent"
a:layout_height="match_parent">
<ListView
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1"
a:id="@android:id/list"/>
<TextView a:id="@+id/fragmentTitle"
a:layout_height="wrap_content"
a:layout_width="match_parent"
style="?fragmentTitleStyle"/>
<Button
<ListView style="?fragmentListViewStyle"/>
<!-- todo serso: uncomment button-->
<!-- <Button
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_gravity="center_horizontal"
a:text="@string/c_add"
style="@style/add_var_button"
a:onClick="addVarButtonClickHandler"/>
style="?buttonStyle"
a:onClick="addVarButtonClickHandler"/>-->
</LinearLayout>

View File

@@ -8,5 +8,7 @@
<attr name="fragmentLayoutStyle" format="reference" />
<attr name="secondPaneStyle" format="reference" />
<attr name="fragmentTitleStyle" format="reference" />
<attr name="fragmentListViewStyle" format="reference" />
<attr name="buttonStyle" format="reference" />
</resources>

View File

@@ -25,9 +25,24 @@
<item name="android:layout_margin">5dp</item>
</style>
<style name="default_fragment_list_view_style">
<item name="android:id">@android:id/list</item>
<item name="android:divider">@null</item>
<item name="android:dividerHeight">0dp</item>
<item name="android:cacheColorHint">@android:color/transparent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_weight">1</item>
</style>
<style name="default_fragment_title_style">
<item name="android:textColor">@android:color/white</item>
<item name="android:textSize">25sp</item>
<item name="android:layout_marginLeft">6dp</item>
</style>
<style name="default_button_style" parent="button_style">
<item name="android:background">@drawable/metro_button_blue</item>
</style>
<style name="default_fragment_layout_style">
@@ -45,5 +60,7 @@
<item name="fragmentLayoutStyle">@style/default_fragment_layout_style</item>
<item name="secondPaneStyle">@style/default_second_pane_style</item>
<item name="fragmentTitleStyle">@style/default_fragment_title_style</item>
<item name="fragmentListViewStyle">@style/default_fragment_list_view_style</item>
<item name="buttonStyle">@style/default_button_style</item>
</style>
</resources>