activity_otalia_camera.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:id="@+id/activity_main"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. android:orientation="vertical"
  9. android:keepScreenOn="true"
  10. tools:ignore="MissingDefaultResource">
  11. <!--屏幕常亮-->
  12. <LinearLayout
  13. android:layout_width="match_parent"
  14. android:layout_height="wrap_content"
  15. android:background="@color/colorPrimary"
  16. android:gravity="center_vertical"
  17. android:minHeight="64dp"
  18. android:orientation="horizontal"
  19. android:paddingStart="@dimen/margin_default"
  20. android:paddingTop="@dimen/margin_ss"
  21. android:paddingEnd="@dimen/margin_default"
  22. android:paddingBottom="@dimen/margin_ss">
  23. <ImageView
  24. android:layout_width="wrap_content"
  25. android:layout_height="wrap_content"
  26. android:src="@mipmap/logo" />
  27. <TextView
  28. android:layout_width="0dp"
  29. android:layout_weight="1"
  30. android:layout_height="wrap_content"
  31. android:gravity="center"
  32. android:text="@string/app_name"
  33. android:textColor="@color/white"
  34. android:textSize="18sp"
  35. android:visibility="invisible"/>
  36. <ImageView
  37. android:id="@+id/iv_flash"
  38. android:layout_width="wrap_content"
  39. android:layout_height="wrap_content"
  40. android:src="@mipmap/flash_close"/>
  41. </LinearLayout>
  42. <FrameLayout
  43. android:layout_width="match_parent"
  44. android:layout_height="match_parent"
  45. android:id="@+id/fl_camera_size">
  46. <com.otaliastudios.cameraview.CameraView
  47. android:id="@+id/camera"
  48. android:layout_width="match_parent"
  49. android:layout_height="match_parent"
  50. android:keepScreenOn="true"
  51. app:cameraExperimental="true"
  52. app:cameraEngine="camera2"
  53. app:cameraPreview="glSurface"
  54. app:cameraPlaySounds="true"
  55. app:cameraGrid="off"
  56. app:cameraFlash="off"
  57. app:cameraAudio="off"
  58. app:cameraFacing="back"
  59. app:cameraGestureTap="none"
  60. app:cameraGestureLongTap="none"
  61. app:cameraGesturePinch="none"
  62. app:cameraGestureScrollHorizontal="filterControl1"
  63. app:cameraGestureScrollVertical="exposureCorrection"
  64. app:cameraMode="picture"
  65. app:cameraUseDeviceOrientation="false"
  66. app:cameraAutoFocusMarker="@string/cameraview_default_autofocus_marker">
  67. </com.otaliastudios.cameraview.CameraView>
  68. <LinearLayout
  69. android:layout_width="match_parent"
  70. android:layout_height="match_parent"
  71. android:orientation="vertical">
  72. <FrameLayout
  73. android:layout_width="wrap_content"
  74. android:layout_height="0dp"
  75. android:layout_weight="370">
  76. <!--灰色遮罩-->
  77. <com.miekir.ocr.widget.CropView
  78. android:id="@+id/pcv_scan"
  79. android:layout_width="match_parent"
  80. android:layout_height="match_parent"
  81. android:padding="2dp"/>
  82. <com.miekir.ocr.widget.ScalableImageView
  83. android:id="@+id/iv_animation"
  84. android:layout_width="wrap_content"
  85. android:layout_height="wrap_content"
  86. android:visibility="invisible"
  87. android:scaleType="fitXY"/>
  88. </FrameLayout>
  89. <View
  90. android:layout_width="match_parent"
  91. android:layout_height="0.8dp"
  92. android:background="@color/white"/>
  93. <LinearLayout
  94. android:layout_width="match_parent"
  95. android:layout_height="0dp"
  96. android:layout_weight="180"
  97. android:orientation="vertical"
  98. android:background="@color/black_transparent">
  99. <LinearLayout
  100. android:layout_width="match_parent"
  101. android:layout_height="wrap_content"
  102. android:gravity="center_vertical"
  103. android:orientation="horizontal">
  104. <Space
  105. android:layout_width="0dp"
  106. android:layout_height="wrap_content"
  107. android:layout_weight="1" />
  108. <com.miekir.ocr.widget.IndicatorText
  109. android:id="@+id/it_postal"
  110. android:layout_width="wrap_content"
  111. android:layout_height="wrap_content"
  112. app:text="@string/postal_code" />
  113. <Space
  114. android:layout_width="0dp"
  115. android:layout_height="wrap_content"
  116. android:layout_weight="1" />
  117. <com.miekir.ocr.widget.IndicatorText
  118. android:id="@+id/it_address"
  119. android:layout_width="wrap_content"
  120. android:layout_height="wrap_content"
  121. app:text="@string/address"/>
  122. <Space
  123. android:layout_width="0dp"
  124. android:layout_height="wrap_content"
  125. android:layout_weight="1" />
  126. <com.miekir.ocr.widget.IndicatorText
  127. android:id="@+id/it_name"
  128. android:layout_width="wrap_content"
  129. android:layout_height="wrap_content"
  130. app:text="@string/name"/>
  131. <Space
  132. android:layout_width="0dp"
  133. android:layout_height="wrap_content"
  134. android:layout_weight="1" />
  135. <com.miekir.ocr.widget.IndicatorText
  136. android:id="@+id/it_all"
  137. android:layout_width="wrap_content"
  138. android:layout_height="wrap_content"
  139. app:text="@string/full"
  140. app:focused="true"/>
  141. <Space
  142. android:layout_width="0dp"
  143. android:layout_height="wrap_content"
  144. android:layout_weight="1" />
  145. </LinearLayout>
  146. <LinearLayout
  147. android:layout_width="match_parent"
  148. android:layout_height="match_parent"
  149. android:gravity="center_vertical"
  150. android:orientation="horizontal"
  151. android:paddingBottom="@dimen/margin_default">
  152. <RelativeLayout
  153. android:layout_width="0dp"
  154. android:layout_height="wrap_content"
  155. android:layout_weight="1">
  156. <FrameLayout
  157. android:id="@+id/fl_album"
  158. android:foreground="@drawable/ripple_effect"
  159. android:layout_width="wrap_content"
  160. android:layout_height="wrap_content"
  161. android:layout_centerInParent="true"
  162. android:padding="@dimen/margin_default">
  163. <ImageView
  164. android:layout_width="wrap_content"
  165. android:layout_height="wrap_content"
  166. android:src="@mipmap/button_album"/>
  167. </FrameLayout>
  168. </RelativeLayout>
  169. <FrameLayout
  170. android:id="@+id/fl_take"
  171. android:layout_width="wrap_content"
  172. android:layout_height="wrap_content"
  173. android:foreground="@drawable/ripple_effect">
  174. <ImageView
  175. android:layout_width="wrap_content"
  176. android:layout_height="wrap_content"
  177. android:layout_gravity="center"
  178. android:src="@mipmap/button_take" />
  179. <ImageView
  180. android:layout_width="wrap_content"
  181. android:layout_height="wrap_content"
  182. android:layout_gravity="center"
  183. android:src="@mipmap/button_take_out" />
  184. </FrameLayout>
  185. <TextView
  186. android:id="@+id/tv_orientation"
  187. android:layout_width="0dp"
  188. android:layout_height="wrap_content"
  189. android:layout_marginStart="@dimen/margin_default"
  190. android:layout_marginEnd="@dimen/margin_default"
  191. android:layout_weight="1"
  192. android:gravity="center"
  193. android:text="@string/landscape"
  194. android:textColor="@color/colorPrimary"
  195. android:textSize="@dimen/size_text_title_p"/>
  196. </LinearLayout>
  197. </LinearLayout>
  198. </LinearLayout>
  199. </FrameLayout>
  200. </LinearLayout>