1

I'm actually developing a tablet application for Android 4.0, and I need to use a layout displaying 2 or 3 panes (just like the default Contacts app). It will display a catalog of products:

  1. The first pane is a list of items
  2. The second pane is the detailled view of the currently selected item in the list
  3. The last pane is optional, showing a wish list (it can be showed or hidden)

The approach

So, I'm currently using a ListFragment for the list pane, and a simple Fragment for the details pane. The last one isn't actually integrated.

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

    <fragment
        android:id="@+id/listFragment"
        android:layout_width="0dip"
        android:layout_weight=".3"
        android:layout_height="match_parent"
        class="com.###.###.ui.fragments.ListFragment" />

    <fragment
        android:id="@+id/detailsFragment"
        android:layout_width="0dip"
        android:layout_weight=".7"
        android:layout_height="match_parent"
        class="com.###.###.ui.fragments.DetailsFragment" />

</LinearLayout>
  • Is there a better approach for this design ?

The style

I also want to follow the Android 4.0 Design Guidelines and apply to my app the same design as the default Contacts App. I searched for a tutorial on how to apply this style, and I can't find anything about that.

Here's an exact picture of what I need. (Sorry, I'm not yet allowed to post images...)

  • How can I implement the default Android 4.0 detailled-list style ?

I've seen this resource picture on the Guidelines webpage. I'm sure there is a simple way to implement this style on any application... So, if anyone can help me doing this...

2
  • Looks good. You might need to change the weights to "7" and "10" but I could be wrong.
    – SeanPONeil
    May 31, 2012 at 14:50
  • That's the same method, i'm just using 0.3 (could be 3 or 30) and 0.7 (could be 7 or 70). Using "7" and "10" makes the list view look larger.
    – etienne51
    May 31, 2012 at 14:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.