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

Fixed advanced settings bugs.

parent 7670ea11
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@
</activity>
<activity android:name=".NotificationClicked">
</activity>
<activity android:name=".AdvancedSettings">
</activity>
<service android:name="com.example.notification.SedentaryNotification">
</service>
<service android:name="com.example.stimulusStrategy.Accelerometer">
......
......@@ -33,7 +33,6 @@ public class SedentaryNotification extends Notification {
protected NotificationCompat.Builder setParameters(NotificationCompat.Builder builder) {
//Get parameters from settings? or set strings?
builder.setSmallIcon(android.R.drawable.btn_star);
builder.setContentTitle(this.getClass().getSimpleName());
builder.setContentText(preferences.getString(getString(R.string.daily_goal_text), getString(R.string.notf_text)));
......@@ -50,9 +49,9 @@ public class SedentaryNotification extends Notification {
}
if(preferences.getBoolean(getString(R.string.led), false)){
builder.mNotification.flags |= android.app.Notification.FLAG_SHOW_LIGHTS;
builder.mNotification.ledARGB = Color.RED;
builder.mNotification.ledOnMS = 1000;
builder.mNotification.ledOffMS = 100;
builder.mNotification.ledARGB = Color.parseColor(preferences.getString(getString(R.string.led_colour), "RED"));
builder.mNotification.ledOnMS = (preferences.getInt(getString(R.string.led_period), 1))*1000;
builder.mNotification.ledOffMS = (preferences.getInt(getString(R.string.led_period), 1))*1000;
}
return builder;
......
......@@ -52,7 +52,7 @@ public class AdvancedSettings extends AppCompatActivity {
//Saved in shared preferences, add integer resource for default values to be used when obtaining from shared preferences.
saveSharedPreferenceData();
Intent intent = new Intent(view.getContext(), MainActivity.class);
Intent intent = new Intent(view.getContext(), Settings.class);
displaySavedToast(view);
startActivity(intent);
}
......@@ -62,6 +62,7 @@ public class AdvancedSettings extends AppCompatActivity {
@Override
public void onClick(View view) {
//DO UPLOAD THINGS HERE
}
});
populateSpinners();
......
......@@ -66,6 +66,15 @@ public class Settings extends AppCompatActivity{
startActivity(intent);
}
});
Button adv = findViewById(R.id.button);
adv.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
Intent intent = new Intent(view.getContext(), AdvancedSettings.class);
startActivity(intent);
}
});
setUpSeekBar();
populateSpinner();
}
......
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