-
Notifications
You must be signed in to change notification settings - Fork 157
1.3 DrawCameraView
Oscar Gilberto Medina Cruz edited this page May 6, 2017
·
2 revisions
For using DrawCameraView you need to add both to your layout file (DrawView and DrawCameraView), always into a parent like FrameLayout or RelativeLayout.
<FrameLayout
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.byox.drawview.views.DrawCameraView
android:id="@+id/draw_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.byox.drawview.views.DrawView
android:id="@+id/draw_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>From your java code, get the view from your layout for using later.
public class MainActivity extends AppCompatActivity {
private DrawCameraView mDrawCameraView;
private DrawView mDrawView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
...
mDrawCameraView = (DrawCameraView) findViewById(R.id.draw_camera_view);
mDrawView = (DrawView) findViewById(R.id.draw_view);
// Initialize camera
mDrawCameraView.attachCameraView();
...
}
}DrawView functionality is the same.