Skip to content

Commit

Permalink
Add sync level to saved state
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Mar 2, 2016
1 parent ade4d5a commit 9968b55
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/org/billthefarmer/scope/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class MainActivity extends Activity

private static final String START = "start";
private static final String INDEX = "index";
private static final String LEVEL = "level";

private static final float values[] =
{0.1f, 0.2f, 0.5f, 1.0f,
Expand Down Expand Up @@ -226,6 +227,10 @@ protected void onRestoreInstanceState(Bundle savedInstanceState)
// Index

scope.index = bundle.getFloat(INDEX, 0);

// Level

yscale.index = bundle.getFloat(LEVEL, 0);
}

// Save state
Expand Down Expand Up @@ -267,6 +272,10 @@ protected void onSaveInstanceState(Bundle outState)

bundle.putFloat(INDEX, scope.index);

// Level

bundle.putFloat(LEVEL, yscale.index);

// Save bundle

outState.putBundle(STATE, bundle);
Expand Down

0 comments on commit 9968b55

Please sign in to comment.