Aktuelle Prozentzahl in der Notenübersich hinzugefügt (Ohne Beschreibungstext)

This commit is contained in:
Joshua
2018-07-14 23:28:38 +02:00
parent 17e9c6e17d
commit 00f3ba8b03
4 changed files with 15 additions and 2 deletions

View File

@@ -84,7 +84,8 @@ public class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView
switch (data.first) {
case TYPE_TOTAL:
HeaderViewHolder h = (HeaderViewHolder) holder;
h.mCaption.setText(R.string.hello_blank_fragment);
//String s = R.string.Current_percentage; +": "+String.format("%.2f", mValue.getGradebookPercent()*100) +" %";
h.mCaption.setText(String.format("%.2f", mValue.getGradebookPercent()*100) +" %");//R.string.gradebook +": "+String.format("%.2f", mValue.getGradebookPercent()*100) +" %"
break;
case TYPE_GRADE:
int index = data.second / 1024;

View File

@@ -199,6 +199,16 @@ public class Modules implements Iterable<Modules.Module>, Serializable {
throw new AssertionError("Do not use this constructor!");
}*/
public float getGradebookPercent(){
float maxPoint = 0;
float userPoint = 0;
for (Gradebook g : gradebook){
maxPoint += g.getMaxPoints();
userPoint += g.getPoints();
}
return userPoint/maxPoint;
}
private Module(String semester, HashSet<String> lvNumber, String title, HashSet<Lecturer> lecturer, String type, String description, String ID) {
semester = semester.replace("SS", "S");
semester = semester.replaceAll("[0-9]{2}([0-9]{2})", "$1");

View File

@@ -31,4 +31,5 @@
<string name="past_events">Vergangene Veranstaltungen</string>
<string name="events">Veranstaltungen</string>
<string name="gradebook">Noten</string>
<string name="Current_percentage">Aktuelle Prozentzahl</string>
</resources>

View File

@@ -37,4 +37,5 @@
<string name="past_events">Past Events</string>
<string name="events">Events</string>
<string name="gradebook">Gradebook</string>
<string name="Current_percentage">Current Percentage</string>
</resources>