Bug Fix #3
- Only Potrait Mode - Pop-up in break activity while on break - new Summary in the settings - New title for the diclaimer in the help activity - new strings - updated xml report
This commit is contained in:
parent
6d642f9a42
commit
e82d8d81ab
9 changed files with 77 additions and 28 deletions
Binary file not shown.
|
|
@ -5,12 +5,14 @@
|
|||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:screenOrientation="portrait"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:screenOrientation="portrait"
|
||||
android:name=".BreakReminder"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
|
|
@ -22,6 +24,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:screenOrientation="portrait"
|
||||
android:name=".SettingsActivity"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:parentActivityName=".BreakReminder">
|
||||
|
|
@ -29,13 +32,20 @@
|
|||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder.BreakReminder" />
|
||||
</activity>
|
||||
<activity android:name=".BreakDeciderActivity" />
|
||||
<activity android:name=".BreakActivity" />
|
||||
<activity android:name=".ProfileActivity" />
|
||||
<activity android:name=".ExerciseTypeActivity" />
|
||||
<activity android:name=".AboutActivity" />
|
||||
<activity android:name=".StatisticsActivity" />
|
||||
<activity android:name=".HelpActivity" />
|
||||
<activity android:name=".BreakDeciderActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".BreakActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ProfileActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ExerciseTypeActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".AboutActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".StatisticsActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".HelpActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
||||
<receiver
|
||||
android:name=".AppWidget"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
|
|||
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
|
|
@ -9,6 +10,7 @@ import android.net.Uri;
|
|||
import android.os.CountDownTimer;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
|
@ -41,6 +43,8 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
private List<Integer> sections;
|
||||
private Random random;
|
||||
private boolean exerciseSide = false;
|
||||
private AlertDialog.Builder builder;
|
||||
private AlertDialog ad;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -86,6 +90,11 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
setRandomExercises();
|
||||
}
|
||||
|
||||
// FIXME erstes erstellen vom Dialog
|
||||
builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage("10sec " + getResources().getText(R.string.exercise_break).toString());
|
||||
ad = builder.show();
|
||||
|
||||
//Keep screen on while on break
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
|
|
@ -148,6 +157,12 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
// Next Exercise
|
||||
currentExercise++;
|
||||
side_repetition.setText(R.string.exercise_break);
|
||||
|
||||
// FIXME Set additional 10 Sek Countdown
|
||||
builder = new AlertDialog.Builder(v.getContext());
|
||||
builder.setMessage("10sec " + getResources().getText(R.string.exercise_break).toString());
|
||||
ad = builder.show();
|
||||
|
||||
if (currentExercise > exerciseList.size() - 1) {
|
||||
currentExercise = 0;
|
||||
if (sections.size() == allAvailableExercises.size()) {
|
||||
|
|
@ -266,7 +281,6 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
break_exercise_type = (TextView) findViewById(R.id.break_exercise_type);
|
||||
break_exercise_type.setText(exerciseList.get(currentExercise).getSection());
|
||||
|
||||
//FIXME
|
||||
setExerciseImage();
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +309,7 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
}
|
||||
}
|
||||
|
||||
//FIXME Change to the correct picture and whether its side or repetition
|
||||
|
||||
private void update() {
|
||||
//After 10 seconds first side/repetition, then after 20 seconds break for 10 seconds, afterwards second side/repetition and after 20 seconds break and new exercise
|
||||
breakTime++;
|
||||
|
|
@ -303,9 +317,17 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
case 10:
|
||||
System.out.println("Time for Exercise: Left!");
|
||||
side_repetition.setText(sideRepetition + " 1");
|
||||
|
||||
// FIXME cancel dialog
|
||||
ad.cancel();
|
||||
|
||||
break;
|
||||
case 30:
|
||||
System.out.println("Time for Break between sides!");
|
||||
|
||||
// FIXME Set additional 10 Sek Countdown
|
||||
ad.show();
|
||||
|
||||
side_repetition.setText(R.string.exercise_break);
|
||||
//If exercise contains 2 images, set ImageView to the second image
|
||||
if (exerciseSide) {
|
||||
|
|
@ -315,6 +337,10 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
break;
|
||||
case 40:
|
||||
System.out.println("Time for Exercise: Right!");
|
||||
|
||||
// FIXME kill dialog
|
||||
ad.cancel();
|
||||
|
||||
side_repetition.setText(sideRepetition + " 2");
|
||||
break;
|
||||
case 60:
|
||||
|
|
@ -341,6 +367,10 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
}
|
||||
description.setText(exerciseList.get(currentExercise).getDescription());
|
||||
execution.setText(exerciseList.get(currentExercise).getExecution());
|
||||
|
||||
// FIXME Set additional 10 Sek Countdown
|
||||
ad.show();
|
||||
|
||||
side_repetition.setText(R.string.exercise_break);
|
||||
|
||||
setExerciseImage();
|
||||
|
|
@ -373,31 +403,25 @@ public class BreakActivity extends AppCompatActivity implements View.OnClickList
|
|||
isRunning = false;
|
||||
ct_text.setText("00:00");
|
||||
//Trigger the alarm
|
||||
String ringPref = sharedPrefs.getString("notifications_new_message_ringtone", "");
|
||||
//String ringPref = sharedPrefs.getString("notifications_new_message_ringtone", "");
|
||||
|
||||
if (!ringPref.equals("")) {
|
||||
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), Uri.parse(ringPref));
|
||||
r.play();
|
||||
}
|
||||
//if (!ringPref.equals("")) {
|
||||
//Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), Uri.parse(ringPref));
|
||||
//r.play();
|
||||
//}
|
||||
|
||||
//Vibration
|
||||
boolean vibrateChecked = sharedPrefs.getBoolean("notifications_new_message_vibrate", false);
|
||||
if (vibrateChecked) {
|
||||
//boolean vibrateChecked = sharedPrefs.getBoolean("notifications_new_message_vibrate", false);
|
||||
//if (vibrateChecked) {
|
||||
// Get instance of Vibrator from current Context
|
||||
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||
//Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||
|
||||
if (v != null) {
|
||||
//if (v != null) {
|
||||
// Vibrate for 1500 milliseconds
|
||||
v.vibrate(1500);
|
||||
}
|
||||
}
|
||||
//v.vibrate(1500);
|
||||
//}
|
||||
//}
|
||||
|
||||
//Cancel the notification
|
||||
if (timeLeft) {
|
||||
NotificationManager notificationManager =
|
||||
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
notificationManager.cancel(999);
|
||||
}
|
||||
//Remove lag to keep screen on when the break ends
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
|
|
|
|||
|
|
@ -254,6 +254,14 @@ public class BreakReminder extends AppCompatActivity
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
NotificationManager nManager = ((NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE));
|
||||
nManager.cancelAll();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class HelpActivity extends AppCompatActivity {
|
|||
description.setText(R.string.help_break_screen);
|
||||
break;
|
||||
case 6:
|
||||
title.setText(R.string.disclaimer);
|
||||
title.setText(R.string.disclaimer_title);
|
||||
img.setImageResource(R.drawable.ic_law);
|
||||
description.setText(R.string.disclaimer);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -102,4 +102,6 @@
|
|||
<string name="tutorial_help">Hilfe öffnen</string>
|
||||
<string name="dialog_positive">Okay</string>
|
||||
<string name="new_profile_success">Übungen wurden erfolgreich erstellt!</string>
|
||||
<string name="disclaimer_title">Haftungsausschluss</string>
|
||||
<string name="settings_exercise_summary">Wählen Sie die zu trainierenden Körperbereiche aus</string>
|
||||
</resources>
|
||||
|
|
@ -102,5 +102,7 @@
|
|||
<string name="tutorial_help">Voir l\'aide</string>
|
||||
<string name="dialog_positive">D\'accord</string>
|
||||
<string name="new_profile_success">Exercices créé avec succès!</string>
|
||||
<string name="disclaimer_title">Désistement</string>
|
||||
<string name="settings_exercise_summary">Sélectionnez les parties du corps pour l\'entrainement</string>
|
||||
|
||||
</resources>
|
||||
|
|
@ -60,6 +60,7 @@
|
|||
<!--settings for SettingsActivity -->
|
||||
<string name="settings_emptyName">The changes could not be applied because the name for the profile was empty!</string>
|
||||
<string name="settings_doubleName">The changes could not be applied because there is already a profile with the same name!</string>
|
||||
<string name="settings_exercise_summary">Choose the body parts, you want to exercise</string>
|
||||
|
||||
<!--settings for ProfileActivity -->
|
||||
<string name="new_profile_break">Break</string>
|
||||
|
|
@ -139,6 +140,7 @@
|
|||
|
||||
<!-- settings for Disclaimer -->
|
||||
<string name="disclaimer">DISCLAIMER PLACEHOLDER</string>
|
||||
<string name="disclaimer_title">Disclaimer</string>
|
||||
|
||||
<!-- settings for TutorialActivity -->
|
||||
<string name="tutorial_profiles">Select profiles</string>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
<orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder.ExerciseListPreference
|
||||
android:defaultValue="1"
|
||||
android:summary="@string/settings_exercise_summary"
|
||||
android:entries="@array/type_spinner"
|
||||
android:entryValues="@array/value_spinner"
|
||||
android:title="@string/pref_current_exercises"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue