Forum Xamarin.Android

How to display details on the right panel of tablet in xamarin

I have this layout in xamarin:

On the left panel are the list of Orders.
Every time you click an item, it should be displayed on the right panel.
But what happens is this, the detail pop ups:

This is the code for the details:

public class InProgressFragment : Fragment, SwipeRefreshLayout.IOnRefreshListener
{
    RecyclerView mRecyclerView;
    RecyclerView.LayoutManager mLayoutManager;
    SwipeRefreshLayout mSwipeRefreshLayout;
    InProgressAdapter mAdapter;
    List<DTO.Order> mOrders;

    void OnItemClick (object sender, int position)
    {
        var InProgressDetailsActivity = new Intent (Activity, typeof(InProgressDetailsActivity));
        InProgressDetailsActivity.PutExtra ("TransactionID", mOrders [position].TransactionId);
        InProgressDetailsActivity.PutExtra ("UpdatedBy", mOrders [position].UpdateBy);
        InProgressDetailsActivity.PutExtra ("DatePaid", mOrders[position].DatePaid != null ? 
            mOrders [position].DatePaid.Value.ToString ("ddd, MMM d h:mm tt", CultureInfo.CreateSpecificCulture ("en-US")) : "n/a");
        InProgressDetailsActivity.PutExtra ("Remarks", mOrders [position].UserRemarks);
        InProgressDetailsActivity.PutExtra ("ShippingMethod", mOrders [position].ShippingMethod);
        InProgressDetailsActivity.PutExtra ("CustomerName", mOrders [position].UserName);
        InProgressDetailsActivity.PutExtra ("AddressPK", mOrders [position].AddressPartitionKey);
        InProgressDetailsActivity.PutExtra ("AddressRK", mOrders [position].AddressRowKey);
        InProgressDetailsActivity.PutExtra ("Paid", mOrders [position].Paid);

        StartActivity (InProgressDetailsActivity);  
    }

.
.
.

And here is the View under layout-large. The detail view is just a mockup:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <RelativeLayout
            android:layout_weight="1"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:background="#f2f2f2"
            android:paddingRight="2dp"
            android:id="@+id/relativeLayout1">
            <LinearLayout xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:fitsSystemWindows="true">
                <include
                    android:id="@+id/toolbar"
                    layout="@layout/GrabhutToolbar" />
                <com.refractored.PagerSlidingTabStrip
                    android:id="@+id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="?attr/colorPrimary"
                    app:pstsDividerWidth="0dp"
                    app:pstsDividerPadding="12dp"
                    app:pstsShouldExpand="true"
                    app:pstsIndicatorHeight="5dp"
                    app:pstsUnderlineColor="#000000"
                    app:pstsTabPaddingLeftRight="14dp"
                    app:pstsIndicatorColor="@android:color/holo_orange_light"
                    app:pstsDividerColor="#ffffff" />
                <android.support.v4.view.ViewPager
                    android:id="@+id/pager"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    tools:context=".MainActivity" />
            </LinearLayout>
        </RelativeLayout>
    <!--' DETAILVIEW '-->
        <RelativeLayout
            android:layout_weight="2"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:id="@+id/relativeLayout2"
            android:minWidth="25px"
            android:minHeight="25px"
            android:background="#ffffffff"
            android:padding="16dp">
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/details">
                <include
                    android:id="@+id/toolbar"
                    layout="@layout/GrabhutToolbar" />
                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:minWidth="25px"
                    android:minHeight="25px"
                    android:padding="16dp">
                    <LinearLayout
                        android:orientation="vertical"
                        android:minWidth="25px"
                        android:minHeight="25px"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">
                        <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="2dp"
                            android:paddingBottom="16dp">
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceLarge"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:id="@+id/TransactionID"
                                android:layout_marginBottom="16dp"
                                android:textColor="#ffec6206"
                                android:textStyle="bold"
                                android:text="TRANSACTION ID" />
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp">
                                <TextView
                                    android:text="Processed By : "
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:textColor="#ff505050" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:id="@+id/ProcessedBy"
                                    android:textColor="#ff797979" />
                            </LinearLayout>
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp">
                                <TextView
                                    android:text="Paid On : "
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:textColor="#ff505050" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:id="@+id/DatePaid"
                                    android:textColor="#ff797979" />
                            </LinearLayout>
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content">
                                <TextView
                                    android:text="Remarks : "
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:textColor="#ff505050" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:id="@+id/Remarks"
                                    android:textColor="#ff797979" />
                            </LinearLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:paddingTop="16dp"
                            android:paddingBottom="20dp"
                            android:layout_marginBottom="2dp">
                            <TextView
                                android:text="Shipping Details"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textColor="#ff505050"
                                android:textStyle="bold"
                                android:layout_marginBottom="16dp" />
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp">
                                <ImageView
                                    android:src="@drawable/ic_local_shipping_grey600_48dp"
                                    android:layout_width="24dp"
                                    android:layout_height="24dp"
                                    android:layout_gravity="center_vertical" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:id="@+id/ShippingMethod"
                                    android:textColor="#ff797979"
                                    android:layout_marginLeft="8dp" />
                            </LinearLayout>
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp">
                                <ImageView
                                    android:src="@drawable/ic_room_grey600_48dp"
                                    android:layout_width="24dp"
                                    android:layout_height="24dp"
                                    android:layout_gravity="center_vertical" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:id="@+id/Address"
                                    android:textColor="#ff797979"
                                    android:layout_marginLeft="8dp" />
                            </LinearLayout>
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp">
                                <ImageView
                                    android:src="@drawable/user"
                                    android:layout_width="24dp"
                                    android:layout_height="24dp"
                                    android:layout_gravity="center_vertical" />
                                <TextView
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent"
                                    android:id="@+id/CustomerName"
                                    android:textColor="#ff797979"
                                    android:layout_marginLeft="8dp" />
                            </LinearLayout>
                            <LinearLayout
                                android:orientation="horizontal"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp"
                                android:minWidth="25px"
                                android:minHeight="25px"
                                android:gravity="right">
                                <Button
                                    android:text="SCHEDULE"
                                    android:textColor="#ffffffff"
                                    android:textStyle="bold"
                                    android:background="@color/orange"
                                    android:id="@+id/Schedule"
                                    android:layout_width="wrap_content"
                                    android:layout_height="match_parent" />
                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/orderitems" />
            </LinearLayout>
        </RelativeLayout>
    </LinearLayout>

Posts

  • JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

    there is a Android forum for Android specific questions

Sign In or Register to comment.