Skip to content

Commit

Permalink
for #162, implement pause/resume handling of camera preview
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Jan 17, 2018
1 parent a58f7ed commit ded33f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/havenapp/main/ui/CameraFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public void onPause() {
super.onPause();
preview.setVisibility(View.GONE);
}

@Override
public void onResume() {
super.onResume();

initCamera ();

}

public void resetCamera ()
Expand Down Expand Up @@ -101,6 +103,10 @@ public void onProcess(Bitmap oldBitmap, Bitmap newBitmap, Bitmap rawBitmap,
});
}
}
else
{
preview.setVisibility(View.VISIBLE);
}
}
public void onSensorChanged(SensorEvent event) {

Expand Down

0 comments on commit ded33f2

Please sign in to comment.