Skip to content

Commit

Permalink
Fixed database merge conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeurlv committed Nov 7, 2018
1 parent 644b3d7 commit 390e664
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.easyfitness"
android:versionCode="22"
android:versionCode="23"
android:versionName="0.16">

<uses-sdk
Expand Down
23 changes: 15 additions & 8 deletions app/src/main/java/com/easyfitness/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,28 @@ public void onCreate(Bundle savedInstanceState) {
mpMachineFrag = (MachineFragment) getSupportFragmentManager().getFragment(savedInstanceState, MACHINES);
mpBodyPartListFrag = (BodyPartListFragment) getSupportFragmentManager().getFragment(savedInstanceState, BODYTRACKING);
}
/*else {
mpFontesPagerFrag = (FontesPagerFragment) getSupportFragmentManager().findFragmentByTag(FONTESPAGER);
mpCardioFrag = (CardioFragment) getSupportFragmentManager().findFragmentByTag(CARDIO);
mpProfilFrag = (ProfilFragment) getSupportFragmentManager().findFragmentByTag(WEIGHT);
mpAboutFrag = (AboutFragment) getSupportFragmentManager().findFragmentByTag(ABOUT);
mpMachineFrag = (MachineFragment) getSupportFragmentManager().findFragmentByTag(MACHINES);
}*/

loadPreferences();

DatabaseHelper.renameOldDatabase(this);

if (DatabaseHelper.DATABASE_VERSION >= 15) {
DAOOldCardio mDbOldCardio = new DAOOldCardio(this);
DAOMachine lDAOMachine = new DAOMachine(this);
if (mDbOldCardio.tableExists()) {
DAOCardio mDbCardio = new DAOCardio(this);
List<OldCardio> mList = mDbOldCardio.getAllRecords();
for (OldCardio record : mList) {
mDbCardio.addCardioRecord(record.getDate(), "00:00", record.getExercice(), record.getDistance(), record.getDuration(), record.getProfil());
String exerciseName="";
Machine m = lDAOMachine.getMachine(record.getExercice());
exerciseName = record.getExercice();
if (m != null) { // if a machine exists
if (m.getType()==DAOMachine.TYPE_FONTE) { // if it is not a Cardio type
exerciseName = exerciseName + "-Cardio"; // add a suffix to
}
}

mDbCardio.addCardioRecord(record.getDate(), "00:00", exerciseName, record.getDistance(), record.getDuration(), record.getProfil());
}
mDbOldCardio.dropTable();

Expand All @@ -168,6 +171,10 @@ public void onCreate(Bundle savedInstanceState) {
mDbFonte.updateRecord(record); // Automatically update record Type
}
}
ArrayList<Machine> machineList = lDAOMachine.getAllMachinesArray();
for (Machine record : machineList) {
lDAOMachine.updateMachine(record); // Reset all the fields on machines.
}
}

/* creation de l'arborescence de l'application */
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/dialog_rest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
android:layout_gravity="center"
android:background="#3E80B4"
android:gravity="center"

android:orientation="horizontal"
android:weightSum="1">

Expand All @@ -176,9 +175,9 @@
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_margin="10dp"

android:background="@android:color/white"
android:clickable="true"
android:gravity="center"
android:text="@string/exit"
android:textColor="#5DBCD2"
android:textSize="18sp"
Expand Down

0 comments on commit 390e664

Please sign in to comment.