activity_main.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <!-- 程序的主界面 -->
  2. <RelativeLayout xmlns:tools="http://schemas.android.com/tools"
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. tools:context=".MainActivity" >
  7. <RelativeLayout
  8. android:id="@+id/title"
  9. android:layout_width="fill_parent"
  10. android:layout_height="44dp" >
  11. <TextView
  12. android:id="@+id/text_pop"
  13. android:layout_width="wrap_content"
  14. android:layout_height="wrap_content"
  15. android:layout_alignParentLeft="false"
  16. android:layout_centerHorizontal="true"
  17. android:layout_centerVertical="true"
  18. android:layout_marginLeft="60dp"
  19. android:text="@string/title"
  20. android:textAppearance="?android:attr/textAppearanceLarge" />
  21. <ToggleButton
  22. android:id="@+id/toggleButton1"
  23. android:layout_width="70dp"
  24. android:layout_height="fill_parent"
  25. android:layout_alignBottom="@+id/text_pop"
  26. android:layout_marginLeft="12dp"
  27. android:layout_toRightOf="@+id/text_pop"
  28. android:background="@color/contents_text"
  29. android:gravity="left|center|bottom"
  30. android:text="//"
  31. android:textColor="@color/white"
  32. android:textOff="筛选"
  33. android:textOn="附近"
  34. android:textSize="18dp" />
  35. <TextView
  36. android:id="@+id/toggle_text1"
  37. android:layout_width="wrap_content"
  38. android:layout_height="wrap_content"
  39. android:text="/附近"
  40. android:layout_toRightOf="@+id/text_pop"
  41. android:layout_alignBottom="@+id/text_pop"
  42. android:layout_marginLeft="48dp"
  43. android:textAppearance="?android:attr/textAppearanceSmall" />
  44. <TextView
  45. android:id="@+id/toggle_text2"
  46. android:layout_width="wrap_content"
  47. android:layout_height="wrap_content"
  48. android:layout_alignBottom="@+id/text_pop"
  49. android:layout_marginLeft="48dp"
  50. android:layout_toRightOf="@+id/text_pop"
  51. android:text="/筛选"
  52. android:textAppearance="?android:attr/textAppearanceSmall"
  53. android:visibility="invisible" />
  54. </RelativeLayout>
  55. <RelativeLayout
  56. android:id="@+id/filter"
  57. android:layout_width="wrap_content"
  58. android:layout_height="40dp"
  59. android:layout_below="@+id/title" >
  60. <HorizontalScrollView
  61. android:id="@+id/filter1"
  62. android:layout_width="wrap_content"
  63. android:layout_height="wrap_content" >
  64. <LinearLayout
  65. android:layout_width="match_parent"
  66. android:layout_height="wrap_content"
  67. android:orientation="horizontal" >
  68. <Spinner
  69. android:id="@+id/spinner1"
  70. android:layout_width="wrap_content"
  71. android:layout_height="40dp" />
  72. <Spinner
  73. android:id="@+id/spinner2"
  74. android:layout_width="wrap_content"
  75. android:layout_height="40dp" />
  76. <Spinner
  77. android:id="@+id/spinner3"
  78. android:layout_width="wrap_content"
  79. android:layout_height="40dp" />
  80. </LinearLayout>
  81. </HorizontalScrollView>
  82. <RadioGroup
  83. android:id="@+id/filter2"
  84. android:layout_width="wrap_content"
  85. android:layout_height="wrap_content"
  86. android:orientation="horizontal"
  87. android:visibility="invisible" >
  88. <RadioButton
  89. android:id="@+id/radio0"
  90. android:layout_width="wrap_content"
  91. android:layout_height="wrap_content"
  92. android:checked="true"
  93. android:text="@string/nearby_1000" />
  94. <RadioButton
  95. android:id="@+id/radio1"
  96. android:layout_width="wrap_content"
  97. android:layout_height="wrap_content"
  98. android:text="@string/nearby_3000" />
  99. <RadioButton
  100. android:id="@+id/radio2"
  101. android:layout_width="wrap_content"
  102. android:layout_height="wrap_content"
  103. android:checked="true"
  104. android:text="@string/nearby_5000" />
  105. </RadioGroup>
  106. </RelativeLayout>
  107. <RelativeLayout
  108. android:id="@+id/content"
  109. android:layout_width="fill_parent"
  110. android:layout_height="fill_parent"
  111. android:layout_alignParentBottom="true"
  112. android:layout_below="@+id/filter" >
  113. <TabHost
  114. android:id="@android:id/tabhost"
  115. android:layout_width="fill_parent"
  116. android:layout_height="fill_parent"
  117. android:layout_alignParentBottom="true"
  118. android:layout_alignParentLeft="true" >
  119. <RelativeLayout
  120. android:layout_width="fill_parent"
  121. android:layout_height="fill_parent"
  122. android:orientation="vertical" >
  123. <FrameLayout
  124. android:id="@android:id/tabcontent"
  125. android:layout_width="fill_parent"
  126. android:layout_height="fill_parent"
  127. android:layout_above="@android:id/tabs" >
  128. <ListView
  129. android:id="@+id/listView1"
  130. android:layout_width="match_parent"
  131. android:layout_height="match_parent" >
  132. </ListView>
  133. </FrameLayout>
  134. <TabWidget
  135. android:id="@android:id/tabs"
  136. android:layout_width="fill_parent"
  137. android:layout_height="wrap_content"
  138. android:layout_alignParentBottom="true"
  139. android:layout_centerInParent="true" >
  140. </TabWidget>
  141. </RelativeLayout>
  142. </TabHost>
  143. </RelativeLayout>
  144. <RelativeLayout
  145. android:id="@+id/progress"
  146. android:layout_width="match_parent"
  147. android:layout_height="match_parent"
  148. android:background="@color/transparent"
  149. android:clickable="false"
  150. android:visibility="invisible" >
  151. <ProgressBar
  152. android:id="@+id/progressBar1"
  153. style="?android:attr/progressBarStyleLarge"
  154. android:layout_width="wrap_content"
  155. android:layout_height="wrap_content"
  156. android:layout_centerInParent="true" />
  157. </RelativeLayout>
  158. </RelativeLayout>