Skip to content

Commit

Permalink
Preparing release v0.7.5, Bugfix for 2 dialogs
Browse files Browse the repository at this point in the history
Due to the update of the compab. library the dialog options were much
wider, not all were visible :(
  • Loading branch information
chaosbastler committed Feb 24, 2015
1 parent 088340c commit 9aea4e4
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 49 deletions.
4 changes: 2 additions & 2 deletions app/res/values-de/strings_activity_create_workout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@


<!-- DialogWorkoutOverviewFragment -->
<string name="save_workout">Workout speichern</string>
<string name="save_workout">Speichern</string>
<string name="add_more_exercises">Mehr Übungen hinzufügen</string>
<string name="discard">Workout verwerfen</string>
<string name="discard">Verwerfen</string>
<string name="title_exercise_detail">Übungsdetails</string>
<string name="title_exercise_list">Übungen</string>
<string name="override">Überschreiben</string>
Expand Down
4 changes: 2 additions & 2 deletions app/res/values/strings_activity_create_workout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@


<!-- DialogWorkoutOverviewFragment -->
<string name="save_workout">Save workout</string>
<string name="save_workout">Save</string>
<string name="add_more_exercises">Add more exercises</string>
<string name="discard">"Discard workout</string>
<string name="discard">"Discard</string>
<string name="title_exercise_detail">Exercise Detail</string>
<string name="title_exercise_list">Exercise</string>
<string name="override">Override</string>
Expand Down
3 changes: 3 additions & 0 deletions app/res/xml-de/changelog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog>
<release version="0.7.5" versioncode="31" summary="Dialog Bugfix" date="02/24/2015">
<change>Behebt einen Fehler bei 2 Dialogen (es waren nicht alle Optionen sichtbar)</change>
</release>
<release version="0.7.4" versioncode="30" summary="Charts" date="02/23/2015">
<change>Statt mit einer Tabelle wird der Trainingsverlauf nun mit einem Diagramm dargestellt</change>
<change>Keine Unterstützung mehr für Android 2.x und 3.x (aufgrund der verwendeten Bibliothek für Diagramme)</change>
Expand Down
3 changes: 3 additions & 0 deletions app/res/xml/changelog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog>
<release version="0.7.5" versioncode="31" summary="Dialog Bugfix" date="02/24/2015">
<change>Fixes a bug concerning two dialogs (not all options were visible)</change>
</release>
<release version="0.7.4" versioncode="30" summary="Charts" date="02/23/2015">
<change>The training history is now visualized by a chart (instead of a table)</change>
<change>No support anymore for Android 2.x and 3.x (due to the used chart library)</change>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,6 @@ public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setNeutralButton(getString(R.string.cancel), new OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setPositiveButton(getString(R.string.save), new OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
Expand Down Expand Up @@ -123,40 +124,36 @@ public void onClick(DialogInterface dialog, int which) {
}).create().show();
}
});




return new AlertDialog.Builder(getActivity()).setTitle(mWorkout.getName()).setView(v).setCancelable(true)
.setPositiveButton(getString(R.string.save_workout), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// check if name is empty
final String workoutName = mEditTextWorkoutName.getText().toString();
if (workoutName.equals("") || workoutName.replaceAll(" ", "").equals("")){
Toast.makeText(getActivity(), getString(R.string.workout_name_cannot_be_empty), Toast.LENGTH_LONG).show();
return;
}

// check if file already exists
if (fileAlreadyExists(workoutName)) {
showOverrideDialog();
return;
}


saveWorkout(getActivity());
}
}).setNeutralButton(getString(R.string.add_more_exercises), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
continueAddingExercises();
}
}).setNegativeButton(getString(R.string.discard), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finishActivities(getActivity());
}
}).create();
}
.setPositiveButton(getString(R.string.save_workout), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// check if name is empty
final String workoutName = mEditTextWorkoutName.getText().toString();
if (workoutName.equals("") || workoutName.replaceAll(" ", "").equals("")){
Toast.makeText(getActivity(), getString(R.string.workout_name_cannot_be_empty), Toast.LENGTH_LONG).show();
return;
}

// check if file already exists
if (fileAlreadyExists(workoutName)) {
showOverrideDialog();
return;
}


saveWorkout(getActivity());
}
}).setNegativeButton(getString(R.string.discard), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finishActivities(getActivity());
}
}).create();
}



Expand All @@ -173,11 +170,7 @@ private void removeExerciseFromWorkout(FitnessExercise fEx) {



/**
* Saves the Workout with the given name.
*
* @param workoutName The name of the Workout.
*/

private void saveWorkout(Activity activity){
if(mWorkout.getFitnessExercises().isEmpty()){
Log.w(TAG, "User tried to save an empty Workout. Will skip saving.");
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 30
versionName "0.7.4"
versionCode 31
versionName "0.7.5"
}

sourceSets {
Expand Down

0 comments on commit 9aea4e4

Please sign in to comment.