Add presets to tutorial

Resolves #68
This commit is contained in:
Trevor Slocum 2020-03-11 16:30:57 -07:00
parent 2f752277e7
commit 73b62f4e12
3 changed files with 43 additions and 19 deletions

View File

@ -1,5 +1,6 @@
1.5.9:
- Add resources menu linking to how to meditate, /r/meditation and replaying the tutorial
- Add presets to tutorial
- Resolve possible crash when waking device
- Resolve duration not being preselected when editing
- Remove usage of Google Play Services (was previously used in releases on Google Play and Amazon)

View File

@ -627,19 +627,21 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
updateEditDuration();
if (getMeditationAssistant().getTimerMode().equals("timed") || getMeditationAssistant().getTimerMode().equals("endat")) {
editDuration.requestFocus();
if (!next_tutorial.equals("presets")) {
editDuration.requestFocus();
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
}
}
}
updateMeditate(false, false);
updateVisibleViews(false);
if (wasEditing) {
if (wasEditing || next_tutorial.equals("presets")) {
showNextTutorial(false);
}
}
@ -672,7 +674,7 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
if (txtTimer == null) {
return;
}
next_tutorial = "settings";
next_tutorial = "presets";
ViewTarget target = new ViewTarget(R.id.txtTimer, this);
try {
@ -690,6 +692,21 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
e.printStackTrace();
}
}
} else if (next_tutorial.equals("presets")) {
next_tutorial = "settings";
ViewTarget target = new ViewTarget(R.id.btnPreset2, this);
try {
sv = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setContentTitle(R.string.modeandduration)
.setContentText(R.string.editTimerHelp)
.setShowcaseEventListener(this)
.setStyle(R.style.MeditationShowcaseTheme)
.build();
} catch (Exception e) {
e.printStackTrace();
}
} else if (next_tutorial.equals("settings")) {
if (!getMeditationAssistant().getEditingDuration()) {
View actionSettings = findViewById(R.id.action_settings);
@ -789,12 +806,14 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
if (getMeditationAssistant().getEditingDuration()) {
if (getMeditationAssistant().getTimerMode().equals("timed") || getMeditationAssistant().getTimerMode().equals("endat")) {
editDuration.setEnabled(true);
editDuration.requestFocus();
if (!next_tutorial.equals("presets")) {
editDuration.requestFocus();
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
}
} else {
editDuration.setEnabled(false);
}
@ -1557,11 +1576,14 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
+ String.format("%02d", Integer.valueOf(getMeditationAssistant().getPrefs()
.getString("timerMinutes", "15"))));
}
editDuration.requestFocus();
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
if (!next_tutorial.equals("presets")) {
editDuration.requestFocus();
InputMethodManager imm = (InputMethodManager) this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editDuration,
InputMethodManager.SHOW_IMPLICIT);
}
}
}
}

View File

@ -28,8 +28,9 @@
<string name="tryAgain">Try Again</string>
<!-- Main Activity -->
<string name="timer">Timer</string>
<string name="timerHelp">The timer is currently set to 15 minutes. You can change the duration, end at a specific time of the day, or deactivate the alarm entirely. Tap the timer now to see these options.</string>
<string name="settingsHelp">This application includes many features and customizations, such as automatically silencing your device and providing a daily reminder to meditate. Tap the Settings icon now to see these options.</string>
<string name="timerHelp">Welcome to a brief tutorial. This is the session timer. Tap it now to change the timer mode and duration.</string>
<string name="editTimerHelp">Your session may be a specific duration, may last until a specific time of day, or may not be timed at all.\n\nPresets may be used to store common configurations. Press and hold a preset to remember the current session duration. Sounds and other settings may also be remembered by presets by enabling them in "Preset Settings".\n\nAfter tapping OK, tap Cancel or Confirm to continue.</string>
<string name="settingsHelp">This application includes numerous features and customizations. Tap the Settings icon to see these options.</string>
<string name="medinetHelp">Sign in to MediNET to save your sessions online. You can import your sessions later if you lose your data. This feature is entirely optional, storing sessions locally will not hinder your experience.\n\nThis concludes the tutorial. I hope that Meditation Assistant will be beneficial for your practice.</string>
<string name="cancel">Cancel</string>
<string name="set">Set</string>