I'm building a honeycomb specific app and wanted to know if there is
an easy way to create visible borders between fragments?

I know I could just set different backgrounds for each fragment layout
so they are distinct, but that's not what I'm going for. I want it to
look like one background across all fragments, with thin borders
between them. I'm using the Theme.Holo theme, defined in the
manifest.

It doesn't look like there are any attributes on the fragments
themselves to do this, unless I'm missing something. Should I instead
set the background image of each fragment layout? Maybe use a 9patch
with a transparent background and solid edges?  I'm thinking this may
not be good because the borders will be twice as thick where two
fragments meet.

Here are my layouts.  Note that only two of the three are ever visible
at the same time:

---- My main layout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/frags">

    <fragment class="com.greggreno.whattowatch.QueryFragment"
            android:id="@+id/frag_query"
            android:visibility="gone"
            android:layout_width="@dimen/titles_size"
            android:layout_height="match_parent" />

    <fragment class="com.greggreno.whattowatch.GalleryFragment"
            android:id="@+id/frag_gallery"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            />

    <fragment class="com.greggreno.whattowatch.ContentFragment"
            android:id="@+id/frag_content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
</LinearLayout>


---- My query fragment:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
        android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android";>


        <ExpandableListView
        android:id="@+id/listView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"

        android:drawSelectorOnTop="false"
        android:cacheColorHint="#FFFFFFFF"
        />

</LinearLayout>


---- My Gallery fragment:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<GridView
    android:id="@+id/gallery"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:numColumns="auto_fit"
    android:verticalSpacing="10dp"
    android:horizontalSpacing="10dp"
    android:columnWidth="220dp"
    android:stretchMode="columnWidth"
    android:gravity="center"
/>
</LinearLayout>


---- My content fragment (abreviated...)

<?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:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="20dp"
        android:paddingBottom="20dp"
        >

        <ImageView
                        android:id="@+id/artwork"
                        android:layout_width="wrap_content"

                        android:paddingRight="20dp"

                        android:paddingBottom="20dp"
                        android:layout_height="wrap_content"
                        android:src="@drawable/blank_large_cover"
                        android:layout_gravity="center_vertical"
                        />


          <ScrollView
                        android:id="@+id/pollscroll"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_alignParentTop="true"
                        android:layout_alignParentRight="true"
                        >

             <LinearLayout
                android:id="@+id/scrollDetails"
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"

                >

                <TextView
                        android:id="@+id/lbSynopsis"
                        android:paddingTop="5dp"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:scrollHorizontally= "false"
                        android:singleLine="false"
                        android:text="Synopsis:"
                        android:textStyle="bold" android:textSize="20dip"
android:textColor="#ffCCCC22"
                        />

                <TextView
                        android:id="@+id/tvSynopsis"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/styleDetailOtherText"
                        />
                        ...

                    </LinearLayout>
                  </ScrollView>

    </LinearLayout>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to