Skip to content

Commit

Permalink
readded display off setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasjuffinger committed Jun 3, 2020
1 parent 97a068c commit c785732
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ This locks the exposure to the exposure of the first shot.
## BRC3 ##
The app supports exposure bracketing. Set the mode to three-image exposure bracketing outside of the app and check BRC3 checkbox in the app. The app will always take three pictures. Keep in mind that the interval time must be large enough to take all three pictures.

## DOFF (Display Off) ##
Turn the display off between each shot. This doesn't change the battery consumption but it can be healthy for the display when taking very long time lapses.

## Burst mode ##
When selecting the lowest interval the camera is in burst mode. In this mode it takes pictures as fast as it can write to the SD card for the duration set by the second slider.

Expand Down
Binary file modified app/release/TimeLapse-release-1.4.0.apk
Binary file not shown.
2 changes: 2 additions & 0 deletions app/src/main/java/com/jonasjuffinger/timelapse/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void save(Context context)
editor.putInt("fps", fps);
editor.putBoolean("brs", brs);
editor.putBoolean("mf", mf);
editor.putBoolean("displayOff", displayOff);
editor.apply();
}

Expand All @@ -109,5 +110,6 @@ void load(Context context)
fps = sharedPref.getInt("fps", fps);
brs = sharedPref.getBoolean("brs", brs);
mf = sharedPref.getBoolean("mf", mf);
displayOff = sharedPref.getBoolean("displayOff", displayOff);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SettingsActivity extends BaseActivity
private CheckBox cbAEL;
private CheckBox cbBRS;
private CheckBox cbMF;
private CheckBox cbDOFF;

@Override
protected void onCreate(Bundle savedInstanceState)
Expand Down Expand Up @@ -87,9 +88,10 @@ protected void onCreate(Bundle savedInstanceState)
tvDelayUnit = (TextView) findViewById(R.id.tvDelayUnit);

cbSilentShutter = (CheckBox) findViewById(R.id.cbSilentShutter);
cbAEL = (CheckBox) findViewById(R.id.cbAEL);
cbBRS = (CheckBox) findViewById(R.id.cbBRC);
cbMF = (CheckBox) findViewById(R.id.cbMF);
cbAEL = (CheckBox) findViewById(R.id.cbAEL);
cbBRS = (CheckBox) findViewById(R.id.cbBRC);
cbMF = (CheckBox) findViewById(R.id.cbMF);
cbDOFF = (CheckBox) findViewById(R.id.cbDOFF);

sbInterval.setMax(119);
sbInterval.setOnSeekBarChangeListener(sbIntervalOnSeekBarChangeListener);
Expand Down Expand Up @@ -122,6 +124,9 @@ protected void onCreate(Bundle savedInstanceState)
cbMF.setChecked(settings.mf);
cbMF.setOnCheckedChangeListener(cbMFOnCheckListener);

cbDOFF.setChecked(settings.displayOff);
cbDOFF.setOnCheckedChangeListener(cbDOFFOnCheckListener);

//try {
//CameraEx cameraEx = CameraEx.open(0, null);
//final CameraEx.ParametersModifier modifier = cameraEx.createParametersModifier(cameraEx.getNormalCamera().getParameters());
Expand Down Expand Up @@ -325,6 +330,13 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
}
};

CheckBox.OnCheckedChangeListener cbDOFFOnCheckListener = new CheckBox.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
settings.displayOff = b;
}
};

void updateTimes() {
if(settings.shotCount == Integer.MAX_VALUE)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void run()
stopPicturePreview = false;
camera.stopPreview();
reviewSurfaceView.setVisibility(View.GONE);
//display.off();
if(settings.displayOff)
display.off();
}

if(burstShooting) {
Expand All @@ -81,10 +82,7 @@ else if(shotCount < settings.shotCount * getcnt()) {
if (remainingTime <= 150) { // 300ms is vaguely the time this postDelayed is to slow
brck.getAndDecrement();
shoot();
if(!settings.displayOff) {
log(Boolean.toString(settings.displayOff));
display.on();
}
display.on();
} else {
shootRunnableHandler.postDelayed(this, remainingTime-150);
}
Expand Down Expand Up @@ -214,8 +212,8 @@ protected void onResume() {

cameraEx.getNormalCamera().setParameters(params);

pictureReviewTime = autoReviewControl.getPictureReviewTime();
log(Integer.toString(pictureReviewTime));
pictureReviewTime = 2; //autoReviewControl.getPictureReviewTime();
//log(Integer.toString(pictureReviewTime));


shotCount = 0;
Expand Down Expand Up @@ -365,7 +363,7 @@ public void run() {
else {
this.cameraEx.cancelTakePicture();

camera.startPreview();
//camera.startPreview();

if (shotCount < settings.shotCount * getcnt()) {

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@
android:layout_toRightOf="@id/cbAEL"
android:checked="false"
android:text="BRC3" />

<CheckBox
android:id="@+id/cbDOFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/cbBRC"
android:checked="false"
android:text="DOFF" />
</RelativeLayout>

<RelativeLayout
Expand Down

0 comments on commit c785732

Please sign in to comment.