activity_test2.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:orientation="vertical"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent">
  7. <Button
  8. android:id="@+id/btn"
  9. android:layout_width="wrap_content"
  10. android:layout_height="wrap_content"
  11. android:text="交换" />
  12. <RelativeLayout
  13. android:id="@+id/rl_main"
  14. android:layout_width="350dp"
  15. android:layout_height="250dp"
  16. android:orientation="horizontal"
  17. android:layout_centerInParent="true">
  18. <RelativeLayout
  19. android:layout_width="match_parent"
  20. android:layout_height="120dp"
  21. android:orientation="horizontal">
  22. <LinearLayout
  23. android:id="@+id/view_1"
  24. android:layout_width="80dp"
  25. android:layout_height="120dp"
  26. android:background="@android:color/holo_green_dark"
  27. android:orientation="vertical">
  28. <LinearLayout
  29. android:layout_width="match_parent"
  30. android:layout_height="match_parent">
  31. <TextView
  32. android:text="1"
  33. android:textSize="30sp"
  34. android:gravity="center"
  35. android:layout_width="match_parent"
  36. android:layout_height="match_parent"
  37. />
  38. </LinearLayout>
  39. </LinearLayout>
  40. <LinearLayout
  41. android:id="@+id/view_2"
  42. android:layout_marginLeft="90dp"
  43. android:layout_width="80dp"
  44. android:layout_height="120dp"
  45. android:background="@android:color/holo_orange_dark"
  46. android:orientation="vertical">
  47. <LinearLayout
  48. android:layout_width="match_parent"
  49. android:layout_height="match_parent">
  50. <TextView
  51. android:text="3"
  52. android:textSize="30sp"
  53. android:gravity="center"
  54. android:layout_width="match_parent"
  55. android:layout_height="match_parent"
  56. />
  57. </LinearLayout>
  58. </LinearLayout>
  59. <LinearLayout
  60. android:id="@+id/view_3"
  61. android:layout_marginLeft="180dp"
  62. android:layout_width="80dp"
  63. android:layout_height="120dp"
  64. android:background="@android:color/holo_blue_dark"
  65. android:orientation="vertical">
  66. <LinearLayout
  67. android:layout_width="match_parent"
  68. android:layout_height="match_parent">
  69. <TextView
  70. android:text="5"
  71. android:textSize="30sp"
  72. android:gravity="center"
  73. android:layout_width="match_parent"
  74. android:layout_height="match_parent"
  75. />
  76. </LinearLayout>
  77. </LinearLayout>
  78. <LinearLayout
  79. android:id="@+id/view_4"
  80. android:layout_marginLeft="270dp"
  81. android:layout_width="80dp"
  82. android:layout_height="120dp"
  83. android:background="@android:color/holo_blue_dark"
  84. android:orientation="vertical">
  85. <LinearLayout
  86. android:layout_width="match_parent"
  87. android:layout_height="match_parent">
  88. <TextView
  89. android:text="7"
  90. android:textSize="30sp"
  91. android:gravity="center"
  92. android:layout_width="match_parent"
  93. android:layout_height="match_parent"
  94. />
  95. </LinearLayout>
  96. </LinearLayout>
  97. </RelativeLayout>
  98. <LinearLayout
  99. android:layout_width="match_parent"
  100. android:layout_height="250dp"
  101. android:layout_marginTop="120dp"
  102. android:orientation="horizontal">
  103. <com.xunao.effectdemo.view.MyLinearLayout
  104. android:visibility="gone"
  105. android:layout_width="80dp"
  106. android:layout_height="130dp"
  107. app:text_num="2"
  108. app:bg_color="@android:color/holo_red_dark"/>
  109. <LinearLayout
  110. android:id="@+id/view1_container"
  111. android:layout_width="80dp"
  112. android:layout_height="130dp"
  113. android:orientation="vertical">
  114. <LinearLayout
  115. android:id="@+id/view1"
  116. android:layout_width="match_parent"
  117. android:layout_height="match_parent"
  118. android:layout_marginTop="10dp"
  119. android:background="@android:color/holo_red_dark"
  120. android:orientation="vertical">
  121. <TextView
  122. android:text="2"
  123. android:textSize="30sp"
  124. android:gravity="center"
  125. android:layout_width="match_parent"
  126. android:layout_height="match_parent"
  127. />
  128. </LinearLayout>
  129. </LinearLayout>
  130. <com.xunao.effectdemo.view.MyLinearLayout
  131. android:visibility="gone"
  132. android:layout_width="80dp"
  133. android:layout_height="130dp"
  134. android:layout_marginLeft="10dp"
  135. app:text_num="4"
  136. app:bg_color="@android:color/holo_purple"/>
  137. <LinearLayout
  138. android:id="@+id/view2_container"
  139. android:layout_marginLeft="10dp"
  140. android:layout_width="80dp"
  141. android:layout_height="130dp"
  142. android:orientation="vertical">
  143. <LinearLayout
  144. android:id="@+id/view2"
  145. android:layout_marginTop="10dp"
  146. android:layout_width="match_parent"
  147. android:layout_height="match_parent"
  148. android:background="@android:color/holo_purple"
  149. android:orientation="vertical">
  150. <TextView
  151. android:text="4"
  152. android:textSize="30sp"
  153. android:gravity="center"
  154. android:layout_width="match_parent"
  155. android:layout_height="match_parent"
  156. />
  157. </LinearLayout>
  158. </LinearLayout>
  159. <com.xunao.effectdemo.view.MyLinearLayout
  160. android:visibility="gone"
  161. android:layout_width="80dp"
  162. android:layout_height="130dp"
  163. android:layout_marginLeft="10dp"
  164. app:text_num="6"
  165. app:bg_color="@android:color/holo_orange_light"/>
  166. <LinearLayout
  167. android:id="@+id/view3_container"
  168. android:layout_marginLeft="10dp"
  169. android:layout_width="80dp"
  170. android:layout_height="130dp">
  171. <LinearLayout
  172. android:id="@+id/view3"
  173. android:layout_marginTop="10dp"
  174. android:layout_width="match_parent"
  175. android:layout_height="match_parent"
  176. android:background="@android:color/holo_orange_light"
  177. android:orientation="vertical">
  178. <TextView
  179. android:text="6"
  180. android:textSize="30sp"
  181. android:gravity="center"
  182. android:layout_width="match_parent"
  183. android:layout_height="match_parent"
  184. />
  185. </LinearLayout>
  186. </LinearLayout>
  187. <com.xunao.effectdemo.view.MyLinearLayout
  188. android:visibility="gone"
  189. android:layout_width="80dp"
  190. android:layout_height="130dp"
  191. android:layout_marginLeft="10dp"
  192. app:text_num="8"
  193. app:bg_color="@android:color/holo_orange_light"/>
  194. <LinearLayout
  195. android:id="@+id/view4_container"
  196. android:layout_marginLeft="10dp"
  197. android:layout_width="80dp"
  198. android:layout_height="130dp">
  199. <LinearLayout
  200. android:id="@+id/view4"
  201. android:layout_marginTop="10dp"
  202. android:layout_width="match_parent"
  203. android:layout_height="match_parent"
  204. android:background="@android:color/holo_orange_light"
  205. android:orientation="vertical">
  206. <TextView
  207. android:text="8"
  208. android:textSize="30sp"
  209. android:gravity="center"
  210. android:layout_width="match_parent"
  211. android:layout_height="match_parent"
  212. />
  213. </LinearLayout>
  214. </LinearLayout>
  215. </LinearLayout>
  216. <LinearLayout
  217. android:id="@+id/ll_move"
  218. android:visibility="gone"
  219. android:layout_width="match_parent"
  220. android:layout_height="match_parent"
  221. android:orientation="horizontal">
  222. <LinearLayout
  223. android:id="@+id/ll_1"
  224. android:visibility="invisible"
  225. android:layout_width="0dp"
  226. android:layout_weight="1"
  227. android:orientation="vertical"
  228. android:layout_height="match_parent">
  229. <LinearLayout
  230. android:layout_width="80dp"
  231. android:layout_height="120dp"
  232. android:background="@android:color/holo_green_dark"
  233. android:orientation="vertical">
  234. <LinearLayout
  235. android:layout_width="match_parent"
  236. android:layout_height="match_parent">
  237. <TextView
  238. android:text="1"
  239. android:textSize="30sp"
  240. android:gravity="center"
  241. android:layout_width="match_parent"
  242. android:layout_height="match_parent"
  243. />
  244. </LinearLayout>
  245. </LinearLayout>
  246. </LinearLayout>
  247. <LinearLayout
  248. android:id="@+id/ll_2"
  249. android:visibility="invisible"
  250. android:layout_width="0dp"
  251. android:layout_weight="1"
  252. android:layout_marginLeft="10dp"
  253. android:orientation="vertical"
  254. android:layout_height="match_parent">
  255. <LinearLayout
  256. android:layout_width="80dp"
  257. android:layout_height="120dp"
  258. android:background="@android:color/holo_orange_dark"
  259. android:orientation="vertical">
  260. <LinearLayout
  261. android:layout_width="match_parent"
  262. android:layout_height="match_parent">
  263. <TextView
  264. android:text="3"
  265. android:textSize="30sp"
  266. android:gravity="center"
  267. android:layout_width="match_parent"
  268. android:layout_height="match_parent"
  269. />
  270. </LinearLayout>
  271. </LinearLayout>
  272. </LinearLayout>
  273. <LinearLayout
  274. android:id="@+id/ll_3"
  275. android:visibility="invisible"
  276. android:layout_width="0dp"
  277. android:layout_marginLeft="10dp"
  278. android:layout_weight="1"
  279. android:orientation="vertical"
  280. android:layout_height="match_parent">
  281. <LinearLayout
  282. android:layout_width="80dp"
  283. android:layout_height="120dp"
  284. android:background="@android:color/holo_blue_dark"
  285. android:orientation="vertical">
  286. <LinearLayout
  287. android:layout_width="match_parent"
  288. android:layout_height="match_parent">
  289. <TextView
  290. android:text="5"
  291. android:textSize="30sp"
  292. android:gravity="center"
  293. android:layout_width="match_parent"
  294. android:layout_height="match_parent"
  295. />
  296. </LinearLayout>
  297. </LinearLayout>
  298. </LinearLayout>
  299. <LinearLayout
  300. android:id="@+id/ll_4"
  301. android:visibility="invisible"
  302. android:layout_width="0dp"
  303. android:layout_marginLeft="10dp"
  304. android:layout_weight="1"
  305. android:orientation="vertical"
  306. android:layout_height="match_parent">
  307. <LinearLayout
  308. android:layout_width="80dp"
  309. android:layout_height="120dp"
  310. android:background="@android:color/holo_blue_dark"
  311. android:orientation="vertical">
  312. <LinearLayout
  313. android:layout_width="match_parent"
  314. android:layout_height="match_parent">
  315. <TextView
  316. android:text="7"
  317. android:textSize="30sp"
  318. android:gravity="center"
  319. android:layout_width="match_parent"
  320. android:layout_height="match_parent"
  321. />
  322. </LinearLayout>
  323. </LinearLayout>
  324. </LinearLayout>
  325. </LinearLayout>
  326. </RelativeLayout>
  327. <ImageView
  328. android:id="@+id/imv_reset2"
  329. android:layout_alignParentBottom="true"
  330. android:layout_alignParentRight="true"
  331. android:layout_marginRight="50dp"
  332. android:layout_marginBottom="50dp"
  333. android:src="@mipmap/icon_reset"
  334. android:layout_width="50dp"
  335. android:layout_height="50dp"/>
  336. </RelativeLayout>