Skip to content
Snippets Groups Projects
Commit 934781ad authored by Peter Joseph De Jonckheere CESM2014's avatar Peter Joseph De Jonckheere CESM2014
Browse files

Fixed further problems with settings page

parent 1cb496be
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ public class Settings extends AppCompatActivity{ ...@@ -34,7 +34,7 @@ public class Settings extends AppCompatActivity{
((CheckBox)findViewById(R.id.Audio)).setChecked(shared.getBoolean(getString(R.string.audio), false)); ((CheckBox)findViewById(R.id.Audio)).setChecked(shared.getBoolean(getString(R.string.audio), false));
((CheckBox)findViewById(R.id.Vibration)).setChecked(shared.getBoolean(getString(R.string.vibration), false)); ((CheckBox)findViewById(R.id.Vibration)).setChecked(shared.getBoolean(getString(R.string.vibration), false));
((CheckBox)findViewById(R.id.LEDFlash)).setChecked(shared.getBoolean(getString(R.string.led), false)); ((CheckBox)findViewById(R.id.LEDFlash)).setChecked(shared.getBoolean(getString(R.string.led), false));
findViewById(R.id.spinner).setTop(shared.getInt(getString(R.string.daily_goal), R.integer.notify_period_minutes)); ((Spinner)findViewById(R.id.spinner)).setSelection(shared.getInt(getString(R.string.daily_goal), R.integer.notify_period_minutes));
((EditText)findViewById(R.id.notificationMessage)).setText(shared.getString(getString(R.string.daily_goal_text), getString(R.string.notf_text))); ((EditText)findViewById(R.id.notificationMessage)).setText(shared.getString(getString(R.string.daily_goal_text), getString(R.string.notf_text)));
} }
...@@ -62,8 +62,8 @@ public class Settings extends AppCompatActivity{ ...@@ -62,8 +62,8 @@ public class Settings extends AppCompatActivity{
boolean audio = ((CheckBox)findViewById(R.id.Audio)).isChecked(); boolean audio = ((CheckBox)findViewById(R.id.Audio)).isChecked();
boolean vibration = ((CheckBox)findViewById(R.id.Vibration)).isChecked(); boolean vibration = ((CheckBox)findViewById(R.id.Vibration)).isChecked();
boolean led = ((CheckBox)findViewById(R.id.LEDFlash)).isChecked(); boolean led = ((CheckBox)findViewById(R.id.LEDFlash)).isChecked();
int notifyGap = findViewById(R.id.spinner).getTop();//??? int notifyGap = ((Spinner)findViewById(R.id.spinner)).getSelectedItemPosition();//???
String message = (findViewById(R.id.notificationMessage)).toString(); String message = ((EditText)findViewById(R.id.notificationMessage)).getText().toString();
SharedPreferences sharedPref = view.getContext().getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE); SharedPreferences sharedPref = view.getContext().getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit(); SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean(getString(R.string.audio), audio); editor.putBoolean(getString(R.string.audio), audio);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment