activity_main.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <lib.homhomlib.design.SlidingLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. app:background_view="@layout/view_bg_main"
  7. app:sliding_mode="top"
  8. app:top_max="80dp">
  9. <!--注: 这里的clickable给true是因为SlidingLayout这个第三方控件的bug-->
  10. <LinearLayout
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:background="#f4f4f4"
  14. android:clickable="true"
  15. android:orientation="vertical"
  16. android:paddingBottom="5dp"
  17. android:paddingLeft="12dp"
  18. android:paddingRight="12dp"
  19. android:paddingTop="12dp">
  20. <EditText
  21. android:id="@+id/et"
  22. android:layout_width="match_parent"
  23. android:layout_height="wrap_content"
  24. android:background="@drawable/shape_bg"
  25. android:gravity="top"
  26. android:hint="请输入文字"
  27. android:lines="8"
  28. android:padding="5dp"
  29. android:textSize="20sp" />
  30. <android.support.v7.widget.CardView
  31. android:layout_width="match_parent"
  32. android:layout_height="wrap_content"
  33. android:layout_marginLeft="1dp"
  34. android:layout_marginRight="1dp"
  35. android:layout_marginTop="12dp">
  36. <LinearLayout
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:background="@drawable/selector_currspker"
  40. android:clickable="true"
  41. android:gravity="center_vertical"
  42. android:onClick="onSpkerSwitchClick"
  43. android:orientation="horizontal"
  44. android:padding="7dp">
  45. <ImageView
  46. android:id="@+id/iv_curspk_icon"
  47. android:layout_width="40dp"
  48. android:layout_height="40dp"
  49. android:src="@mipmap/xiaoyan" />
  50. <TextView
  51. android:id="@+id/tv_curspk_desc"
  52. android:layout_width="match_parent"
  53. android:layout_height="wrap_content"
  54. android:layout_marginLeft="5dp"
  55. android:text="小燕 青年女声"
  56. android:textSize="18sp" />
  57. </LinearLayout>
  58. </android.support.v7.widget.CardView>
  59. <LinearLayout
  60. android:layout_width="match_parent"
  61. android:layout_height="wrap_content"
  62. android:layout_marginTop="20dp"
  63. android:gravity="center_vertical"
  64. android:orientation="horizontal">
  65. <TextView
  66. android:layout_width="wrap_content"
  67. android:layout_height="wrap_content"
  68. android:text="语速:"
  69. android:textSize="15sp" />
  70. <SeekBar
  71. android:progress="50"
  72. android:id="@+id/seekBar"
  73. android:layout_width="match_parent"
  74. android:layout_height="wrap_content"
  75. android:thumb="@drawable/shape_seekbar_thumb" />
  76. </LinearLayout>
  77. <Button
  78. android:layout_width="match_parent"
  79. android:layout_height="wrap_content"
  80. android:layout_marginTop="20dp"
  81. android:background="@drawable/selector_btn"
  82. android:onClick="onSpeakClick"
  83. android:text="点我说话"
  84. android:textColor="#fff"
  85. android:textSize="18sp" />
  86. <FrameLayout
  87. android:layout_width="match_parent"
  88. android:layout_height="0dp"
  89. android:layout_weight="1" />
  90. <TextView
  91. android:layout_width="match_parent"
  92. android:layout_height="wrap_content"
  93. android:gravity="center"
  94. android:text="由科大讯飞提供技术支持"
  95. android:textSize="13sp" />
  96. </LinearLayout>
  97. </lib.homhomlib.design.SlidingLayout>