Регистрация кассы, авторизация, сканнер готовы к демонстрации
This commit is contained in:
@@ -72,17 +72,18 @@ public class CameraActivity extends AppCompatActivity {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
mCamera = getCameraInstance();
|
||||
mCamera.setDisplayOrientation(90);
|
||||
|
||||
holder.addCallback(new SurfaceHolder.Callback() {
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
try {
|
||||
mCamera = getCameraInstance();
|
||||
|
||||
mCamera.setPreviewDisplay(holder);
|
||||
mCamera.startPreview();
|
||||
mCamera.setPreviewCallback(previewCallback);
|
||||
mCamera.autoFocus(autoFocusCB);
|
||||
mCamera.setDisplayOrientation(90);
|
||||
initCountours();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -95,7 +96,7 @@ public class CameraActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
mCamera = null;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -116,6 +117,12 @@ public class CameraActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
mCamera = null;
|
||||
}
|
||||
|
||||
|
||||
private void initCountours() {
|
||||
|
||||
|
||||
@@ -10,38 +10,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="?attr/actionBarSize">
|
||||
|
||||
<View android:layout_height="0dp"
|
||||
android:layout_weight="0.42"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#с0000000"/>
|
||||
|
||||
<FrameLayout android:layout_height="0dp"
|
||||
android:layout_weight="0.16"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<View android:layout_height="match_parent"
|
||||
android:layout_width="24dp"
|
||||
android:layout_gravity="left"
|
||||
android:background="#с0000000"/>
|
||||
|
||||
<View android:layout_height="match_parent"
|
||||
android:layout_width="24dp"
|
||||
android:layout_gravity="right"
|
||||
android:background="#с0000000"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<View android:layout_height="0dp"
|
||||
android:layout_weight="0.42"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#с0000000"/>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user