Guest User

Untitled

a guest
Jul 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <android.support.constraint.ConstraintLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. xmlns:app="http://schemas.android.com/apk/res-auto"
  5. xmlns:tools="http://schemas.android.com/tools"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. tools:context=".RecordVideo">
  9.  
  10. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  11. android:layout_width="fill_parent"
  12. android:id="@+id/camview"
  13. android:layout_height="fill_parent">
  14.  
  15. <FrameLayout
  16. android:id="@+id/camera_preview"
  17. android:adjustViewBounds="true"
  18. android:layout_width="match_parent"
  19. android:layout_height="match_parent" />
  20.  
  21. <SurfaceView
  22. android:id="@+id/sview"
  23. android:layout_width="match_parent"
  24. android:layout_height="match_parent"
  25. android:layout_alignParentLeft="true"
  26. android:layout_alignParentTop="true" />
  27.  
  28. <ImageView
  29. android:id="@+id/ImgLogo1"
  30. android:layout_width="80dp"
  31. android:src="@drawable/rotating_earth"
  32. android:layout_alignParentLeft="true"
  33. android:layout_height="80dp" />
  34.  
  35. <ImageView
  36. android:id="@+id/ImgLogo2"
  37. android:layout_width="80dp"
  38. android:src="@mipmap/ic_launcher"
  39. android:layout_alignParentRight="true"
  40. android:layout_height="80dp" />
  41.  
  42. <ImageButton
  43. android:id="@+id/button_capture"
  44. android:layout_width="wrap_content"
  45. android:layout_height="wrap_content"
  46. android:layout_alignParentRight="true"
  47. android:layout_centerVertical="true"
  48. android:background="?android:attr/selectableItemBackground"
  49. android:src="@mipmap/img_record_green"
  50. android:layout_gravity="center" />
  51.  
  52. </RelativeLayout>
  53.  
  54. Display display = getWindowManager().getDefaultDisplay();
  55. Point size = new Point();
  56. display.getSize(size);
  57.  
  58. BitmapFactory.Options options = new BitmapFactory.Options();
  59. options.inSampleSize = 1;
  60. Bitmap bMap = BitmapFactory.decodeFile(tmpFile.toString(), options);
  61. Bitmap BbMap = Bitmap.createScaledBitmap(bMap, size.x, size.y,true);
  62.  
  63. preview = (FrameLayout) findViewById(R.id.camera_preview);
  64. preview.setBackground(new BitmapDrawable(BbMap));
Add Comment
Please, Sign In to add comment