Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadec committed Aug 31, 2018
1 parent 26de39f commit fec47ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
15 changes: 6 additions & 9 deletions app/src/main/java/hu/kfg/naplo/ChangeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,13 @@ public void run() {

String lessonsToIgnore = pref.getString("ignore_lessons", "semmitsemignoral")
.replace(", ", ",").replace(" ,", "");
String ilessons[] = null;
boolean ignore = false;
List<String> ilessons = new LinkedList<>();
try {
ilessons = lessonsToIgnore.split(",");
ignore = true;
ilessons = Arrays.asList(lessonsToIgnore.split(","));
} catch (Exception e) {
e.printStackTrace();
}
Log.i(TAG, ilessons.size() + " <-- size of ignore");
int day = 0;
List<Substitution> subs = new ArrayList<>();
try {
Expand Down Expand Up @@ -498,11 +497,9 @@ public void run() {
for (Substitution sub : subs) {
for (String cla : cls) {
if (cla.equals(sub.getGroup()) && !sub.isOver()) {
if (ignore) {
for (String toIgnore : ilessons)
if (toIgnore.equals(sub.getSubject()))
continue substitutions;
}
for (String toIgnore : ilessons)
if (toIgnore.equalsIgnoreCase(sub.getSubject()))
continue substitutions;
text.append("\n");
text.append(sub.toString("PDD. S: T C8 R, G"));
Log.d(TAG, sub.toString("PDD. S: T C8 R, G"));
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/hu/kfg/naplo/TableViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void run() {
Date dd = s.parse(grades.get(j + 1).date);
if (j != -1 && j + 1 < grades.size()) {
if (grades.get(j).description.equals(grades.get(j + 1).description)) {
if (Math.abs(d.getTime() - dd.getTime()) < 40 * 1000) {
if (Math.abs(d.getTime() - dd.getTime()) < 40 * 1000) {
doublegrade++;
continue;
}
Expand Down Expand Up @@ -174,7 +174,7 @@ public void run() {
Values.setTextSize(18.0f);
Values.setTextColor(Color.parseColor(doublegrade > 0 ? "#FF4500" : "#FFFFFF"));
Values.setTypeface(null, Typeface.ITALIC);
Values.setText(j == -1 || doublegrade > 0 ? new DecimalFormat(doublegrade > 0 ? "#.###" : "#.##").format(avg) : "" + grades.get(j).value);
Values.setText(j == -1 || doublegrade > 0 ? new DecimalFormat("#.##").format(avg) : "" + grades.get(j).value);
Values.setId(j != -1 ? grades.get(j).id + 1000000 : grades.get(j + 1).id - 30000);
final int minPos = j - doublegrade;
final int maxPos = j;
Expand Down

0 comments on commit fec47ab

Please sign in to comment.