activity_scanner.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:orientation="vertical">
  7. <FrameLayout
  8. android:layout_width="match_parent"
  9. android:layout_height="match_parent">
  10. <SurfaceView
  11. android:id="@+id/scanner_view"
  12. android:layout_width="match_parent"
  13. android:layout_height="match_parent"
  14. android:layout_gravity="center" />
  15. <com.qingdaofushan.home.zxing.view.ViewfinderView
  16. android:id="@+id/viewfinder_content"
  17. android:layout_width="wrap_content"
  18. android:layout_height="match_parent"
  19. app:corner_color="@color/corner_color"
  20. app:frame_color="@color/viewfinder_frame"
  21. app:label_text="将二维码放入框中,即可自动扫描"
  22. app:label_text_color="#FFb2b2b2"
  23. app:laser_color="@color/laser_color"
  24. app:mask_color="@color/viewfinder_mask"
  25. app:result_color="@color/result_view"
  26. app:result_point_color="@color/result_point_color" />
  27. <ImageButton
  28. android:id="@+id/btn_flash"
  29. android:layout_width="40dip"
  30. android:layout_height="40dip"
  31. android:layout_gravity="bottom|center_horizontal"
  32. android:layout_marginBottom="30dip"
  33. android:background="?attr/selectableItemBackground"
  34. android:padding="6dip"
  35. android:scaleType="centerInside"
  36. android:src="@drawable/flash_off" />
  37. </FrameLayout>
  38. </RelativeLayout>