Advertisement
Guest User

listviewtabs

a guest
Apr 24th, 2013
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.82 KB | None | 0 0
  1. ################################# main.xml #################################
  2.  
  3.     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.         xmlns:tools="http://schemas.android.com/tools"
  5.         android:layout_width="match_parent"
  6.         android:layout_height="match_parent"
  7.         tools:context=".MainActivity" >
  8.  
  9.         <ListView
  10.             android:id="@+id/mainlist"
  11.             android:layout_width="match_parent"
  12.             android:layout_height="wrap_content"
  13.             android:layout_alignParentLeft="true"
  14.             android:layout_alignParentTop="true" >
  15.         </ListView>
  16.  
  17.     </RelativeLayout>
  18.  
  19. ################################# mainlistdata.xml #################################
  20.     <?xml version="1.0" encoding="UTF-8"?>
  21.         <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  22.             android:layout_width="fill_parent"
  23.             android:layout_height="fill_parent" >
  24.  
  25.             <LinearLayout
  26.                 xmlns:android="http://schemas.android.com/apk/res/android"
  27.                 android:id="@+id/dataLayout"
  28.                 android:layout_width="fill_parent"
  29.                 android:layout_height="wrap_content"
  30.                 android:layout_alignParentLeft="true"
  31.                 android:layout_alignParentTop="true" >
  32.  
  33.                 <TextView
  34.                     android:id="@+id/dataTitle"
  35.                     android:layout_width="0dp"
  36.                     android:layout_height="wrap_content"
  37.                     android:layout_weight="2"
  38.                     android:gravity="center|left"
  39.                     android:paddingBottom="4dp"
  40.                     android:paddingLeft="4dp"
  41.                     android:paddingRight="4dp"
  42.                     android:paddingTop="4dp" />
  43.  
  44.                 <TextView
  45.                     android:id="@+id/dataValue"
  46.                     android:layout_width="0dp"
  47.                     android:layout_height="wrap_content"
  48.                     android:layout_weight="1.1"
  49.                     android:gravity="right|center"
  50.                     android:paddingBottom="4dp"
  51.                     android:paddingLeft="4dp"
  52.                     android:paddingRight="4dp"
  53.                     android:paddingTop="4dp" />
  54.  
  55.                 <TextView
  56.                     android:id="@+id/dataValueString"
  57.                     android:layout_width="0dp"
  58.                     android:layout_height="wrap_content"
  59.                     android:layout_weight="0.9"
  60.                     android:gravity="right|center"
  61.                     android:paddingBottom="4dp"
  62.                     android:paddingLeft="4dp"
  63.                     android:paddingRight="4dp"
  64.                     android:paddingTop="4dp" />
  65.             </LinearLayout>
  66.  
  67.             <View
  68.                 android:id="@+id/dSep"
  69.                 android:layout_width="fill_parent"
  70.                 android:layout_height="2dp"
  71.                 android:layout_alignParentLeft="true"
  72.                 android:layout_below="@+id/dataLayout"
  73.                 android:background="@android:color/darker_gray" />
  74.  
  75.         </RelativeLayout>
  76. ################################# tabslayout.xml#################################
  77.     <?xml version="1.0" encoding="UTF-8"?>
  78.         <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  79.             android:layout_width="fill_parent"
  80.             android:layout_height="fill_parent" >
  81.  
  82.             <LinearLayout
  83.                 xmlns:android="http://schemas.android.com/apk/res/android"
  84.                 android:id="@+id/dataLayout"
  85.                 android:layout_width="fill_parent"
  86.                 android:layout_height="wrap_content" >
  87.  
  88.                 <TextView
  89.                     android:id="@+id/dataTitle"
  90.                     android:layout_width="0dp"
  91.                     android:layout_height="wrap_content"
  92.                     android:layout_weight="2"
  93.                     android:gravity="center|left"
  94.                     android:paddingBottom="4dp"
  95.                     android:paddingLeft="4dp"
  96.                     android:paddingRight="4dp"
  97.                     android:paddingTop="4dp" />
  98.  
  99.                 <TextView
  100.                     android:id="@+id/dataValue"
  101.                     android:layout_width="0dp"
  102.                     android:layout_height="wrap_content"
  103.                     android:layout_weight="1.1"
  104.                     android:gravity="right|center"
  105.                     android:paddingBottom="4dp"
  106.                     android:paddingLeft="4dp"
  107.                     android:paddingRight="4dp"
  108.                     android:paddingTop="4dp" />
  109.  
  110.                 <TextView
  111.                     android:id="@+id/dataValueString"
  112.                     android:layout_width="0dp"
  113.                     android:layout_height="wrap_content"
  114.                     android:layout_weight="0.9"
  115.                     android:gravity="right|center"
  116.                     android:paddingBottom="4dp"
  117.                     android:paddingLeft="4dp"
  118.                     android:paddingRight="4dp"
  119.                     android:paddingTop="4dp" />
  120.             </LinearLayout>
  121.  
  122.             <TextView
  123.                 android:id="@+id/dataTabsTitle"
  124.                 android:layout_width="fill_parent"
  125.                 android:layout_height="wrap_content"
  126.                 android:layout_alignParentLeft="true"
  127.                 android:layout_alignParentTop="false"
  128.                 android:layout_below="@id/dataLayout"
  129.                 android:gravity="center_vertical|center_horizontal|center"
  130.                 android:padding="4dp"
  131.                 android:text="HERE GOES TWO TABS"
  132.                 android:textAppearance="?android:attr/textAppearanceMedium"
  133.                 android:textSize="16sp"
  134.                 android:textStyle="bold" />
  135.  
  136.             <TabHost
  137.                 android:id="@android:id/tabhost"
  138.                 android:layout_width="match_parent"
  139.                 android:layout_height="match_parent"
  140.                 android:layout_alignParentLeft="true"
  141.                 android:layout_below="@+id/dataTabsTitle" >
  142.  
  143.                 <LinearLayout
  144.                     android:layout_width="match_parent"
  145.                     android:layout_height="match_parent"
  146.                     android:orientation="vertical" >
  147.  
  148.                     <TabWidget
  149.                         android:id="@android:id/tabs"
  150.                         android:layout_width="match_parent"
  151.                         android:layout_height="wrap_content" >
  152.                     </TabWidget>
  153.  
  154.                     <FrameLayout
  155.                         android:id="@android:id/tabcontent"
  156.                         android:layout_width="match_parent"
  157.                         android:layout_height="match_parent" >
  158.  
  159.                         <LinearLayout
  160.                             android:id="@+id/tabOne"
  161.                             android:layout_width="match_parent"
  162.                             android:layout_height="match_parent" >
  163.  
  164.                             <ListView
  165.                                 android:id="@+id/listOne"
  166.                                 android:layout_width="0dip"
  167.                                 android:layout_height="match_parent"
  168.                                 android:layout_weight="1" >
  169.                             </ListView>
  170.                         </LinearLayout>
  171.  
  172.                         <LinearLayout
  173.                             android:id="@+id/tabTwo"
  174.                             android:layout_width="match_parent"
  175.                             android:layout_height="match_parent" >
  176.  
  177.                             <ListView
  178.                                 android:id="@+id/listTwo"
  179.                                 android:layout_width="0dip"
  180.                                 android:layout_height="match_parent"
  181.                                 android:layout_weight="1" >
  182.                             </ListView>
  183.                         </LinearLayout>
  184.                     </FrameLayout>
  185.                 </LinearLayout>
  186.             </TabHost>
  187.  
  188.         </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement