Skip to content

Commit

Permalink
Fixed spelling and copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeurlv committed Apr 16, 2021
1 parent 563a436 commit b2a1ef9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Now you can track your progress easily and quickly!
You can create as many machines as you want with the name you want!
It's your choice!

Graphics will show your progress and your body evolution.
Graphics will show your progress and your body evolution.

Don't leave the app to get your music : a music player is integrated into the app!

Expand Down Expand Up @@ -50,7 +50,7 @@ See [Contributing.md](/Contributing.md/)

BSD 3-Clause License

Copyright (c) 2019-2020, Charles Combes
Copyright (c) 2019-2021, Charles Combes
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
28 changes: 14 additions & 14 deletions app/src/main/java/com/easyfitness/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class MainActivity extends AppCompatActivity {
private final PopupMenu.OnMenuItemClickListener onMenuItemClick = item -> {
switch (item.getItemId()) {
case R.id.create_newprofil:
getActivity().CreateNewProfil();
getActivity().CreateNewProfile();
return true;
case R.id.change_profil:
String[] profilListArray = getActivity().mDbProfils.getAllProfil();
Expand All @@ -132,7 +132,7 @@ public class MainActivity extends AppCompatActivity {
.setItems(profilListArray, (dialog, which) -> {
ListView lv = ((AlertDialog) dialog).getListView();
Object checkedItem = lv.getAdapter().getItem(which);
setCurrentProfil(checkedItem.toString());
setCurrentProfile(checkedItem.toString());
KToast.infoToast(getActivity(), getActivity().getResources().getText(R.string.profileSelected) + " : " + checkedItem.toString(), Gravity.BOTTOM, KToast.LENGTH_LONG);
//Toast.makeText(getApplicationContext(), getActivity().getResources().getText(R.string.profileSelected) + " : " + checkedItem.toString(), Toast.LENGTH_LONG).show();
});
Expand Down Expand Up @@ -513,7 +513,7 @@ private void importDatabase() {
} else {
KToast.errorToast(getActivity(), m_importCVSchosenDir + " " + getActivity().getResources().getString(R.string.import_failed), Gravity.BOTTOM, KToast.LENGTH_SHORT);
}
setCurrentProfil(getCurrentProfile()); // Refresh profile
setCurrentProfile(getCurrentProfile()); // Refresh profile
})
.setCancelText(this.getResources().getString(R.string.global_no))
.show();
Expand Down Expand Up @@ -629,7 +629,7 @@ public void onRequestPermissionsResult(int requestCode,
}
}

public boolean CreateNewProfil() {
public boolean CreateNewProfile() {
AlertDialog.Builder newProfilBuilder = new AlertDialog.Builder(this);

newProfilBuilder.setTitle(getActivity().getResources().getText(R.string.createProfilTitle));
Expand All @@ -643,18 +643,18 @@ public boolean CreateNewProfil() {
String value = input.getText().toString();

if (value.isEmpty()) {
CreateNewProfil();
CreateNewProfile();
} else {
// Create the new profil
mDbProfils.addProfile(value);
// Make it the current.
setCurrentProfil(value);
setCurrentProfile(value);
}
});

newProfilBuilder.setNegativeButton(getActivity().getResources().getText(android.R.string.cancel), (dialog, whichButton) -> {
if (getCurrentProfile() == null) {
CreateNewProfil();
CreateNewProfile();
}
});

Expand All @@ -678,14 +678,14 @@ public boolean renameProfil() {
String value = input.getText().toString();

if (!value.isEmpty()) {
// Get current profil
// Get current profile
Profile temp = getCurrentProfile();
// Rename it
temp.setName(value);
// Commit it
mDbProfils.updateProfile(temp);
// Make it the current.
setCurrentProfil(value);
setCurrentProfile(value);
}
});

Expand Down Expand Up @@ -776,12 +776,12 @@ public Profile getCurrentProfile() {
return profileViMo.getProfile().getValue();
}

public void setCurrentProfil(String newProfilName) {
public void setCurrentProfile(String newProfilName) {
Profile newProfil = this.mDbProfils.getProfil(newProfilName);
setCurrentProfil(newProfil);
setCurrentProfile(newProfil);
}

public void setCurrentProfil(Profile newProfil) {
public void setCurrentProfile(Profile newProfil) {
profileViMo.setProfile(newProfil);
}

Expand Down Expand Up @@ -969,11 +969,11 @@ public void initActivity() {
List<Profile> lList = mDbProfils.getAllProfils();
mCurrentProfile = lList.get(0);
} catch (IndexOutOfBoundsException e) {
this.CreateNewProfil();
this.CreateNewProfile();
}
}

if (mCurrentProfile != null) setCurrentProfil(mCurrentProfile.getName());
if (mCurrentProfile != null) setCurrentProfile(mCurrentProfile.getName());

}

Expand Down

0 comments on commit b2a1ef9

Please sign in to comment.