Aktuelle Prozentzahl in der Notenübersich hinzugefügt (Ohne Beschreibungstext)
This commit is contained in:
@@ -84,8 +84,9 @@ 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);
|
||||
break;
|
||||
//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;
|
||||
GradebookViewHolder i = (GradebookViewHolder) holder;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user